aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_confirm.php1
-rw-r--r--mod/profile.php31
-rw-r--r--mod/settings.php18
3 files changed, 20 insertions, 30 deletions
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 6b9bbfe13..41e0771af 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -432,6 +432,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
$arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
$arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
$arr['object'] .= '</link></object>' . "\n";
+ $arr['last-child'] = 1;
$i = item_store($arr);
diff --git a/mod/profile.php b/mod/profile.php
index a5f440f43..ffc412805 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -18,38 +18,19 @@ function profile_init(&$a) {
profile_load($a,$which,$profile);
- if (!get_config('system','no_openid') && $a->profile['openid']!=""){
- if (!isset($a->profile['openidserver'])){
- logger('friendika user table must be updated. `openidserver` field is missing');
- } else {
- 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";
- }
-
+ if(x($a->profile,'openidserver'))
+ $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
+ if(x($a->profile,'openid')) {
+ $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'http://' . $a->profile['openid']);
+ $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\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 : ''));
$a->page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '" />' . "\r\n";
header('Link: <' . $a->get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
-
-
+
$dfrn_pages = array('request', 'confirm', 'notify', 'poll');
foreach($dfrn_pages as $dfrn)
$a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".$a->get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
diff --git a/mod/settings.php b/mod/settings.php
index af826c53b..6eaa17ad0 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -109,12 +109,17 @@ function settings_post(&$a) {
$str_group_deny = perms2str($_POST['group_deny']);
$str_contact_deny = perms2str($_POST['contact_deny']);
- $openidserver="";
- if ($openid != $a->user['openid'] && isset($a->user['openidserver'])){
- $openidserver = ", `openidserver` = ''";
+ $openidserver = $a->user['openidserver'];
+
+ if($openid != $a->user['openid']) {
+ logger('updating openidserver');
+ require_once('library/openid.php');
+ $open_id_obj = new LightOpenID;
+ $open_id_obj->identity = $openid;
+ $openidserver = $open_id_obj->discover($open_id_obj->identity);
}
- $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d".$openidserver." WHERE `uid` = %d LIMIT 1",
+ $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s', `maxreq` = %d, `openidserver` = '%s' WHERE `uid` = %d LIMIT 1",
dbesc($username),
dbesc($email),
dbesc($openid),
@@ -129,6 +134,7 @@ function settings_post(&$a) {
intval($allow_location),
dbesc($theme),
intval($maxreq),
+ dbesc($openidserver),
intval(local_user())
);
if($r)
@@ -306,7 +312,9 @@ function settings_content(&$a) {
'$pagetype' => $pagetype
));
- call_hooks('settings_page',$o);
+ call_hooks('settings_form',$o);
+
+ $o .= '</form>' . "\r\n";
return $o;