X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Ffinishopenidlogin.php;h=9ac03698529f8569eebcf4a1c6048582a539298b;hb=e54d3e024e9e35563dbd9dae7a74c3735fdec335;hp=e9f7c746bb9195888f4bab95e558dcd3db06fc23;hpb=6328add622641e5f5721cc34d27d4d872c86a561;p=quix0rs-gnu-social.git diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index e9f7c746bb..9ac0369852 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/openid.php'); @@ -30,7 +30,9 @@ class FinishopenidloginAction extends Action function handle($args) { parent::handle($args); - if (common_is_real_login()) { + if (!common_config('openid', 'enabled')) { + common_redirect(common_local_url('login')); + } else if (common_is_real_login()) { $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $token = $this->trimmed('token'); @@ -83,7 +85,7 @@ class FinishopenidloginAction extends Action function showContent() { if (!empty($this->message_text)) { - $this->element('p', null, $this->message); + $this->element('div', array('class' => 'error'), $this->message_text); return; } @@ -217,7 +219,7 @@ class FinishopenidloginAction extends Action if (!Validate::string($nickname, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { $this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.')); return; } @@ -389,7 +391,7 @@ class FinishopenidloginAction extends Action { if (!Validate::string($str, array('min_length' => 1, 'max_length' => 64, - 'format' => VALIDATE_NUM . VALIDATE_ALPHA_LOWER))) { + 'format' => NICKNAME_FMT))) { return false; } if (!User::allowed_nickname($str)) { @@ -410,7 +412,7 @@ class FinishopenidloginAction extends Action } } - # We try to use an OpenID URL as a legal Laconica user name in this order + # We try to use an OpenID URL as a legal StatusNet user name in this order # 1. Plain hostname, like http://evanp.myopenid.com/ # 2. One element in path, like http://profile.typekey.com/EvanProdromou/ # or http://getopenid.com/evanprodromou