X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOpenID%2Ffinishaddopenid.php;h=c442aac989f120e9a674785fdc2e2859cc4394d8;hb=3ddaa5bff44f052996ca78ff354542a4f411f05f;hp=77fcc3805d8ca66c6b8aa1fc88c1509d44f39a36;hpb=dacd8f7f480b005ca1c7d60eaa167055e6c71c20;p=quix0rs-gnu-social.git diff --git a/plugins/OpenID/finishaddopenid.php b/plugins/OpenID/finishaddopenid.php index 77fcc3805d..c442aac989 100644 --- a/plugins/OpenID/finishaddopenid.php +++ b/plugins/OpenID/finishaddopenid.php @@ -27,7 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { +if (!defined('STATUSNET')) { exit(1); } @@ -64,7 +64,7 @@ class FinishaddopenidAction extends Action { parent::handle($args); if (!common_logged_in()) { - // TRANS: Client error message + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $this->clientError(_m('Not logged in.')); } else { $this->tryLogin(); @@ -106,6 +106,12 @@ class FinishaddopenidAction extends Action $sreg = $sreg_resp->contents(); } + // Launchpad teams extension + if (!oid_check_teams($response)) { + $this->message(_m('OpenID authentication aborted: you are not allowed to login to this site.')); + return; + } + $cur = common_current_user(); $other = oid_get_user($canonical); @@ -132,13 +138,16 @@ class FinishaddopenidAction extends Action $this->message(_m('Error connecting user.')); return; } - if ($sreg) { - if (!oid_update_user($cur, $sreg)) { - // TRANS: message in case the user or the user profile cannot be saved in StatusNet. - $this->message(_m('Error updating profile')); - return; + if (Event::handle('StartOpenIDUpdateUser', array($cur, $canonical, &$sreg))) { + if ($sreg) { + if (!oid_update_user($cur, $sreg)) { + // TRANS: message in case the user or the user profile cannot be saved in StatusNet. + $this->message(_m('Error updating profile')); + return; + } } } + Event::handle('EndOpenIDUpdateUser', array($cur, $canonical, $sreg)); // success!