aboutsummaryrefslogtreecommitdiffstats
path: root/mod/profile.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2010-12-23 21:32:13 +0100
committerfabrixxm <fabrix.xm@gmail.com>2010-12-23 21:32:13 +0100
commitfa756ffcb987a37dae888bf84c9519d55a484da5 (patch)
tree6b153e8e855a068aa8e299a0bd29a35a63645600 /mod/profile.php
parentd8969bb84b7a710bf77f23de0d392a192dfc8f53 (diff)
downloadvolse-hubzilla-fa756ffcb987a37dae888bf84c9519d55a484da5.tar.gz
volse-hubzilla-fa756ffcb987a37dae888bf84c9519d55a484da5.tar.bz2
volse-hubzilla-fa756ffcb987a37dae888bf84c9519d55a484da5.zip
OpenID delegation in profile page
Diffstat (limited to 'mod/profile.php')
-rw-r--r--mod/profile.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/mod/profile.php b/mod/profile.php
index b1f020930..000e955ea 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -18,6 +18,31 @@ function profile_init(&$a) {
profile_load($a,$which,$profile);
+ if (!get_config('system','no_openid') && $a->profile['openid']!=""){
+ if (!isset($a->profile['openidserver'])){
+ die('friendika user table must be updated. `openidserver` field is missing');
+ }
+ if ($a->profile['openidserver']==''){
+ require_once('library/openid.php');
+ $openid = new LightOpenID;
+ $openid->identity = $a->profile['openid'];
+ $a->profile['openidserver'] = $openid->discover($openid->identity);
+
+ q("UPDATE `user` SET `openidserver` = '%s' WHERE `uid` = %d LIMIT 1",
+ dbesc($a->profile['openidserver']),
+ intval($a->profile['uid'])
+ );
+ }
+
+
+ $a->page['htmlhead'] .= '<link rel="openid.server" href="'.$a->profile['openidserver'].'" />'. "\r\n";
+ $a->page['htmlhead'] .= '<link rel="openid.delegate" href="'.$a->profile['openid'].'" />'. "\r\n";
+
+
+ }
+
+
+
$a->page['htmlhead'] .= '<meta name="dfrn-global-visibility" content="' . (($a->profile['net-publish']) ? 'true' : 'false') . '" />' . "\r\n" ;
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/dfrn_poll/' . $which .'" />' . "\r\n" ;
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : ''));
@@ -365,4 +390,4 @@ function profile_content(&$a, $update = 0) {
$o .= paginate($a);
return $o;
-} \ No newline at end of file
+}