8000 Fixed some more issues. · linkeddata/ldphp@32cb1fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 32cb1fc

Browse files
author
deiu
committed
Fixed some more issues.
1 parent b9d5d72 commit 32cb1fc

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

www/inc/runtime.inc.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ function librdf_php_last_log_message(){}
7979
require_once('webid.lib.php');
8080
$q = webid_claim();
8181
if (isset($q['uri']) && $q['uri'] != $_user) {
82-
if (is_null($g))
83-
$g = new Graph('uri', $uri, '', $uri);
84-
85-
$_user = webid_verify($q, $g);
86-
$_webid = webid_getinfo($_user, $g);
8 8000 2+
$_user = webid_verify($q);
83+
$_webid = webid_getinfo($_user);
8784

8885
if (DEBUG) {
8986
openlog('RWW.IO', LOG_PID | LOG_ODELAY,LOG_LOCAL4);

www/inc/webid.lib.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ function webid_query($uri, $g=null) {
3232
$r = array();
3333
if (is_null($g))
3434
$g = new Graph('uri', $uri, '', $uri);
35-
else
36-
$g->load($uri);
3735

3836
$q = $g->SELECT(sprintf("PREFIX : <http://www.w3.org/ns/auth/cert#> SELECT ?m ?e WHERE { <%s> :key [ :modulus ?m; :exponent ?e; ] . }", $uri));
3937
if (isset($q['results']) && isset($q['results']['bindings']))
@@ -42,12 +40,12 @@ function webid_query($uri, $g=null) {
4240
return $r;
4341
}
4442

45-
function webid_verify($q=null, $g=null) {
43+
function webid_verify($q=null) {
4644
if (is_null($q))
4745
$q = webid_claim();
4846
if (isset($q['uri'])) {
4947
foreach ($q['uri'] as $uri) {
50-
foreach (webid_query($uri, $g) as $elt) {
48+
foreach (webid_query($uri) as $elt) {
5149
if ($q['e'] == $elt['e']['value'] && $q['m'] == strtolower(preg_replace('/[^0-9a-fA-F]/', '', $elt['m']['value']))) {
5250
return $uri;
5351
}
@@ -57,9 +55,8 @@ function webid_verify($q=null, $g=null) {
5755
return '';
5856
}
5957

60-
function webid_getinfo($uri, $g=null) {
61-
if (is_null($g))
62-
$g = new Graph('uri', $uri, '', $uri);
58+
function webid_getinfo($uri) {
59+
$g = new Graph('uri', $uri, '', $uri);
6360
$q = $g->SELECT(sprintf("PREFIX : <http://xmlns.com/foaf/0.1/>
6461
SELECT ?name ?pic ?depic FROM <%s> WHERE {
6562
?s a :Person .

0 commit comments

Comments
 (0)
0