1
1
複製 0

OpenID delegation in profile page

This commit is contained in:
fabrixxm 2010-12-23 21:32:13 +01:00
父節點 d8969bb84b
當前提交 fa756ffcb9
共有 2 個文件被更改,包括 27 次插入1 次删除

查看文件

@ -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;
}
}