don't update openidserver if openid is empty

This commit is contained in:
Friendika 2011-01-02 21:20:17 -08:00
parent 0a485e6664
commit 03e15bd22f

View file

@ -117,11 +117,15 @@ function settings_post(&$a) {
// If openid has changed or if there's an openid but no openidserver, try and discover it. // If openid has changed or if there's an openid but no openidserver, try and discover it.
if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) { if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) {
logger('updating openidserver'); if(strlen($openid)) {
require_once('library/openid.php'); logger('updating openidserver');
$open_id_obj = new LightOpenID; require_once('library/openid.php');
$open_id_obj->identity = $openid; $open_id_obj = new LightOpenID;
$openidserver = $open_id_obj->discover($open_id_obj->identity); $open_id_obj->identity = $openid;
$openidserver = $open_id_obj->discover($open_id_obj->identity);
}
else
$openidserver = '';
} }
$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", $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",