X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fopenidlogin.php;h=1b289dbeab3ab8e865be36e190890614685b9677;hb=2abe10b8ea4b5d69fc7f6513bf465541454ca2cf;hp=136421cb0d85066e9c597215cb0e5325b45660fd;hpb=42a6492152a85124d8832b75ee05be3906a98d55;p=quix0rs-gnu-social.git diff --git a/actions/openidlogin.php b/actions/openidlogin.php index 136421cb0d..1b289dbeab 100644 --- a/actions/openidlogin.php +++ b/actions/openidlogin.php @@ -28,17 +28,26 @@ class OpenidloginAction extends Action { if (common_logged_in()) { common_user_error(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $openid_url = $this->trimmed('openid_url'); + # CSRF protection $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->show_form(_('There was a problem with your session token. Try again, please.')); + $this->show_form(_('There was a problem with your session token. Try again, please.'), $openid_url); return; } - $openid_url = $this->trimmed('openid_url'); + $rememberme = $this->boolean('rememberme'); + + common_ensure_session(); + + $_SESSION['openid_rememberme'] = $rememberme; + $result = oid_authenticate($openid_url, 'finishopenidlogin'); + if (is_string($result)) { # error message + unset($_SESSION['openid_rememberme']); $this->show_form($result, $openid_url); } } else { @@ -73,6 +82,9 @@ class OpenidloginAction extends Action { common_input('openid_url', _('OpenID URL'), $openid_url, _('Your OpenID URL')); + common_checkbox('rememberme', _('Remember me'), false, + _('Automatically login in the future; ' . + 'not for shared computers!')); common_submit('submit', _('Login')); common_element_end('form'); common_show_footer();