10BC0 Only verify WebID if the URI doesn't match the one in the session. · linkeddata/ldphp@cdae89c · GitHub
[go: up one dir, main page]

Skip to content

Commit cdae89c

Browse files
author
deiu
committed
Only verify WebID if the URI doesn't match the one in the session.
1 parent 19d6489 commit cdae89c

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

www/inc/runtime.inc.php

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,26 @@ function librdf_php_last_log_message(){}
7777

7878
if (isset($_SERVER['SSL_CLIENT_CERT'])) {
7979
require_once('webid.lib.php');
80-
$_user = webid_verify();
81-
82-
$_webid = webid_getinfo($_user);
83-
84-
if (DEBUG) {
85-
openlog('RWW.IO', LOG_PID | LOG_ODELAY,LOG_LOCAL4);
86-
syslog(LOG_INFO, 'Authenticated: '.$_user.' / '.$_webid['name']);
87-
closelog();
80+
$q = webid_claim();
81+
if (isset($q['uri']) && $q['uri'] != $_user) {
82+
$_user = webid_verify();
83+
84+
$_webid = webid_getinfo($_user);
85+
86+
if (DEBUG) {
87+
openlog('RWW.IO', LOG_PID | LOG_ODELAY,LOG_LOCAL4);
88+
syslog(LOG_INFO, 'Authenticated: '.$_user.' / '.$_webid['name']);
89+
closelog();
90+
}
91+
92+
//if (!isSess('u:name'))
93+
sess('u:name', $_webid['name']);
94+
//if (!isSess('u:pic'))
95+
sess('u:pic', $_webid['pic']);
96+
97+
if (strlen($_user) && isset($_SERVER['SSL_CLIENT_S_DN_CN']))
98+
$_user_name = $_SERVER['SSL_CLIENT_S_DN_CN'];
8899
}
89-
// overwrite the name and pic
90-
sess('u:name', $_webid['name']);
91-
sess('u:pic', $_webid['pic']);
92-
93-
if (strlen($_user) && isset($_SERVER['SSL_CLIENT_S_DN_CN']))
94-
$_user_name = $_SERVER['SSL_CLIENT_S_DN_CN'];
95100
}
96101

97102
# proper Emails

0 commit comments

Comments
 (0)
0