X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOpenID%2Fopenidlogin.php;h=86ebcae2e1d26335944938d1b1a20afb73d777a5;hb=c658ede37c62457487eb62faa4b9ebf150da20a4;hp=34e00cccebd509cc3f83c8d7d03c0d569330d79d;hpb=7005ef66617b265ddccdd9082c2368bf014a7e83;p=quix0rs-gnu-social.git diff --git a/plugins/OpenID/openidlogin.php b/plugins/OpenID/openidlogin.php index 34e00ccceb..86ebcae2e1 100644 --- a/plugins/OpenID/openidlogin.php +++ b/plugins/OpenID/openidlogin.php @@ -17,7 +17,9 @@ * along with this program. If not, see . */ -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET')) { + exit(1); +} require_once INSTALLDIR.'/plugins/OpenID/openid.php'; @@ -33,20 +35,15 @@ class OpenidloginAction extends Action $provider = common_config('openid', 'trusted_provider'); if ($provider) { $openid_url = $provider; + if (common_config('openid', 'append_username')) { + $openid_url .= $this->trimmed('openid_username'); + } } else { $openid_url = $this->trimmed('openid_url'); } oid_assert_allowed($openid_url); - # CSRF protection - $token = $this->trimmed('token'); - if (!$token || $token != common_session_token()) { - // TRANS: Message given when there is a problem with the user's session token. - $this->showForm(_m('There was a problem with your session token. Try again, please.'), $openid_url); - return; - } - $rememberme = $this->boolean('rememberme'); common_ensure_session(); @@ -100,13 +97,21 @@ class OpenidloginAction extends Action function showScripts() { parent::showScripts(); - $this->autofocus('openid_url'); + if (common_config('openid', 'trusted_provider')) { + if (common_config('openid', 'append_username')) { + $this->autofocus('openid_username'); + } else { + $this->autofocus('rememberme'); + } + } else { + $this->autofocus('openid_url'); + } } function title() { // TRANS: OpenID plugin message. Title. - return _m('OpenID Login'); + return _m('TITLE','OpenID Login'); } function showForm($error=null, $openid_url) @@ -124,30 +129,39 @@ class OpenidloginAction extends Action 'action' => $formaction)); $this->elementStart('fieldset'); // TRANS: OpenID plugin logon form legend. - $this->element('legend', null, _m('OpenID login')); - $this->hidden('token', common_session_token()); + $this->element('legend', null, _m('LEGEND','OpenID login')); $this->elementStart('ul', 'form_data'); $this->elementStart('li'); $provider = common_config('openid', 'trusted_provider'); + $appendUsername = common_config('openid', 'append_username'); if ($provider) { - $this->element('label', array(), _m('OpenID provider')); + // TRANS: Field label. + $this->element('label', array(), _m('LABEL','OpenID provider')); $this->element('span', array(), $provider); + if ($appendUsername) { + $this->element('input', array('id' => 'openid_username', + 'name' => 'openid_username', + 'style' => 'float: none')); + } $this->element('p', 'form_guide', + // TRANS: Form guide. + ($appendUsername ? _m('Enter your username.') . ' ' : '') . + // TRANS: Form guide. _m('You will be sent to the provider\'s site for authentication.')); $this->hidden('openid_url', $provider); } else { // TRANS: OpenID plugin logon form field label. $this->input('openid_url', _m('OpenID URL'), $this->openid_url, - // TRANS: OpenID plugin logon form field instructions. - _m('Your OpenID URL')); + // TRANS: OpenID plugin logon form field title. + _m('Your OpenID URL.')); } $this->elementEnd('li'); $this->elementStart('li', array('id' => 'settings_rememberme')); // TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie. $this->checkbox('rememberme', _m('Remember me'), false, - // TRANS: OpenID plugin logon form field instructions. + // TRANS: OpenID plugin logon form field title. _m('Automatically login in the future; ' . 'not for shared computers!')); $this->elementEnd('li'); @@ -163,4 +177,12 @@ class OpenidloginAction extends Action $nav = new LoginGroupNav($this); $nav->show(); } + + function showNoticeForm() + { + } + + function showProfileBlock() + { + } }