X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ffinishopenidlogin.php;h=bc33ac330b705e3bcd1ee75b32601042972abdf6;hb=12c475c101c070cbcc4c63f7b1049f6d3282b9ee;hp=bdb8516a321b1459a5d24abf931dd29e137aa3b4;hpb=b264c03d32d04d7a33d28a5830848660f4484943;p=quix0rs-gnu-social.git diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index bdb8516a32..bc33ac330b 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -28,7 +28,7 @@ class FinishopenidloginAction extends Action { parent::handle($args); if (common_logged_in()) { - common_user_error(_('Already logged in.')); + $this->clientError(_('Already logged in.')); } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { @@ -57,10 +57,10 @@ class FinishopenidloginAction extends Action function show_top($error=null) { if ($error) { - common_element('div', array('class' => 'error'), $error); + $this->element('div', array('class' => 'error'), $error); } else { global $config; - common_element('div', 'instructions', + $this->element('div', 'instructions', sprintf(_('This is the first time you\'ve logged into %s so we must connect your OpenID to a local account. You can either create a new account, or connect with your existing account, if you have one.'), $config['site']['name'])); } } @@ -70,36 +70,36 @@ class FinishopenidloginAction extends Action common_show_header(_('OpenID Account Setup'), null, $error, array($this, 'show_top')); - common_element_start('form', array('method' => 'post', + $this->elementStart('form', array('method' => 'post', 'id' => 'account_connect', 'action' => common_local_url('finishopenidlogin'))); - common_hidden('token', common_session_token()); - common_element('h2', null, + $this->hidden('token', common_session_token()); + $this->element('h2', null, _('Create new account')); - common_element('p', null, + $this->element('p', null, _('Create a new user with this nickname.')); - common_input('newname', _('New nickname'), + $this->input('newname', _('New nickname'), ($username) ? $username : '', _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_element_start('p'); - common_element('input', array('type' => 'checkbox', + $this->elementStart('p'); + $this->element('input', array('type' => 'checkbox', 'id' => 'license', 'name' => 'license', 'value' => 'true')); - common_text(_('My text and files are available under ')); - common_element('a', array(href => common_config('license', 'url')), + $this->text(_('My text and files are available under ')); + $this->element('a', array(href => common_config('license', 'url')), common_config('license', 'title')); - common_text(_(' except this private data: password, email address, IM address, phone number.')); - common_element_end('p'); - common_submit('create', _('Create')); - common_element('h2', null, + $this->text(_(' except this private data: password, email address, IM address, phone number.')); + $this->elementEnd('p'); + $this->submit('create', _('Create')); + $this->element('h2', null, _('Connect existing account')); - common_element('p', null, + $this->element('p', null, _('If you already have an account, login with your username and password to connect it to your OpenID.')); - common_input('nickname', _('Existing nickname')); - common_password('password', _('Password')); - common_submit('connect', _('Connect')); - common_element_end('form'); + $this->input('nickname', _('Existing nickname')); + $this->password('password', _('Password')); + $this->submit('connect', _('Connect')); + $this->elementEnd('form'); common_show_footer(); } @@ -154,7 +154,7 @@ class FinishopenidloginAction extends Action function message($msg) { common_show_header(_('OpenID Login')); - common_element('p', null, $msg); + $this->element('p', null, $msg); common_show_footer(); } @@ -179,7 +179,7 @@ class FinishopenidloginAction extends Action # FIXME: save invite code before redirect, and check here if (common_config('site', 'closed') || common_config('site', 'inviteonly')) { - common_user_error(_('Registration not allowed.')); + $this->clientError(_('Registration not allowed.')); return; } @@ -205,7 +205,7 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } @@ -214,7 +214,7 @@ class FinishopenidloginAction extends Action $other = oid_get_user($canonical); if ($other) { - common_server_error(_('Creating new account for OpenID that already has a user.')); + $this->serverError(_('Creating new account for OpenID that already has a user.')); return; } @@ -274,14 +274,14 @@ class FinishopenidloginAction extends Action list($display, $canonical, $sreg) = $this->get_saved_values(); if (!$display || !$canonical) { - common_server_error(_('Stored OpenID not found.')); + $this->serverError(_('Stored OpenID not found.')); return; } $result = oid_link_user($user->id, $canonical, $display); if (!$result) { - common_server_error(_('Error connecting user to OpenID.')); + $this->serverError(_('Error connecting user to OpenID.')); return; }