From 68868fd74bbc6a6f2268b6c5467ccf9e025af011 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Thu, 23 Dec 2010 21:52:51 +0100 Subject: OpenID delegation degrade gracefully if database table is not updated. --- mod/settings.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mod/settings.php') diff --git a/mod/settings.php b/mod/settings.php index 4743ecd66..af826c53b 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -109,7 +109,12 @@ function settings_post(&$a) { $str_group_deny = perms2str($_POST['group_deny']); $str_contact_deny = perms2str($_POST['contact_deny']); - $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 WHERE `uid` = %d LIMIT 1", + $openidserver=""; + if ($openid != $a->user['openid'] && isset($a->user['openidserver'])){ + $openidserver = ", `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." WHERE `uid` = %d LIMIT 1", dbesc($username), dbesc($email), dbesc($openid), -- cgit v1.2.3