X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fopenid.php;h=0ebda485d023a5cf090aed7138a824538f71e7f1;hb=0c9cc29a51941eb572bf16fd5489d0947d47d033;hp=594a90937cc2a19c510b755c48629ab730fc2a8c;hpb=9e133d6412945f84f858d4bfde26c69f9e1afbfd;p=friendica.git diff --git a/mod/openid.php b/mod/openid.php old mode 100755 new mode 100644 index 594a90937c..0ebda485d0 --- a/mod/openid.php +++ b/mod/openid.php @@ -13,24 +13,35 @@ function openid_content(&$a) { logger('mod_openid ' . print_r($_REQUEST,true), LOGGER_DATA); if((x($_GET,'openid_mode')) && (x($_SESSION,'openid'))) { + $openid = new LightOpenID; if($openid->validate()) { - $authid = normalise_openid($_REQUEST['openid_identity']); + $authid = $_REQUEST['openid_identity']; if(! strlen($authid)) { logger( t('OpenID protocol error. No ID returned.') . EOL); goaway(z_root()); } - $r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey` - FROM `user` WHERE `openid` = '%s' AND `blocked` = 0 - AND `account_expired` = 0 AND `verified` = 1 LIMIT 1", - dbesc($authid) + // NOTE: we search both for normalised and non-normalised form of $authid + // because the normalization step was removed from setting + // mod/settings.php in 8367cad so it might have left mixed + // records in the user table + // + $r = q("SELECT * FROM `user` + WHERE ( `openid` = '%s' OR `openid` = '%s' ) + AND `blocked` = 0 AND `account_expired` = 0 + AND `account_removed` = 0 AND `verified` = 1 + LIMIT 1", + dbesc($authid), dbesc(normalise_openid($authid)) ); if($r && count($r)) { + + // successful OpenID login + unset($_SESSION['openid']); require_once('include/security.php'); @@ -42,7 +53,8 @@ function openid_content(&$a) { goaway(z_root()); } - // new registration? + // Successful OpenID login - but we can't match it to an existing account. + // New registration? if($a->config['register_policy'] == REGISTER_CLOSED) { notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL);