Update translator documentation for OpenID plugin.
This commit is contained in:
parent
193fdd8071
commit
7ec5e7cd76
@ -202,16 +202,16 @@ class OpenIDPlugin extends Plugin
|
|||||||
if ($this->openidOnly && !common_logged_in()) {
|
if ($this->openidOnly && !common_logged_in()) {
|
||||||
// TRANS: Tooltip for main menu option "Login"
|
// TRANS: Tooltip for main menu option "Login"
|
||||||
$tooltip = _m('TOOLTIP', 'Login to the site');
|
$tooltip = _m('TOOLTIP', 'Login to the site');
|
||||||
// TRANS: Main menu option when not logged in to log in
|
|
||||||
$action->menuItem(common_local_url('openidlogin'),
|
$action->menuItem(common_local_url('openidlogin'),
|
||||||
|
// TRANS: Main menu option when not logged in to log in
|
||||||
_m('MENU', 'Login'),
|
_m('MENU', 'Login'),
|
||||||
$tooltip,
|
$tooltip,
|
||||||
false,
|
false,
|
||||||
'nav_login');
|
'nav_login');
|
||||||
// TRANS: Tooltip for main menu option "Help"
|
// TRANS: Tooltip for main menu option "Help"
|
||||||
$tooltip = _m('TOOLTIP', 'Help me!');
|
$tooltip = _m('TOOLTIP', 'Help me!');
|
||||||
// TRANS: Main menu option for help on the StatusNet site
|
|
||||||
$action->menuItem(common_local_url('doc', array('title' => 'help')),
|
$action->menuItem(common_local_url('doc', array('title' => 'help')),
|
||||||
|
// TRANS: Main menu option for help on the StatusNet site
|
||||||
_m('MENU', 'Help'),
|
_m('MENU', 'Help'),
|
||||||
$tooltip,
|
$tooltip,
|
||||||
false,
|
false,
|
||||||
@ -219,8 +219,8 @@ class OpenIDPlugin extends Plugin
|
|||||||
if (!common_config('site', 'private')) {
|
if (!common_config('site', 'private')) {
|
||||||
// TRANS: Tooltip for main menu option "Search"
|
// TRANS: Tooltip for main menu option "Search"
|
||||||
$tooltip = _m('TOOLTIP', 'Search for people or text');
|
$tooltip = _m('TOOLTIP', 'Search for people or text');
|
||||||
// TRANS: Main menu option when logged in or when the StatusNet instance is not private
|
|
||||||
$action->menuItem(common_local_url('peoplesearch'),
|
$action->menuItem(common_local_url('peoplesearch'),
|
||||||
|
// TRANS: Main menu option when logged in or when the StatusNet instance is not private
|
||||||
_m('MENU', 'Search'), $tooltip, false, 'nav_search');
|
_m('MENU', 'Search'), $tooltip, false, 'nav_search');
|
||||||
}
|
}
|
||||||
Event::handle('EndPrimaryNav', array($action));
|
Event::handle('EndPrimaryNav', array($action));
|
||||||
@ -280,7 +280,9 @@ class OpenIDPlugin extends Plugin
|
|||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
||||||
$action->menuItem(common_local_url('openidlogin'),
|
$action->menuItem(common_local_url('openidlogin'),
|
||||||
_m('OpenID'),
|
// TRANS: OpenID plugin menu item on site logon page.
|
||||||
|
_m('MENU', 'OpenID'),
|
||||||
|
// TRANS: OpenID plugin tooltip for logon menu item.
|
||||||
_m('Login or register with OpenID'),
|
_m('Login or register with OpenID'),
|
||||||
$action_name === 'openidlogin');
|
$action_name === 'openidlogin');
|
||||||
}
|
}
|
||||||
@ -316,7 +318,9 @@ class OpenIDPlugin extends Plugin
|
|||||||
$action_name = $action->trimmed('action');
|
$action_name = $action->trimmed('action');
|
||||||
|
|
||||||
$action->menuItem(common_local_url('openidsettings'),
|
$action->menuItem(common_local_url('openidsettings'),
|
||||||
_m('OpenID'),
|
// TRANS: OpenID plugin menu item on user settings page.
|
||||||
|
_m('MENU', 'OpenID'),
|
||||||
|
// TRANS: OpenID plugin tooltip for user settings menu item.
|
||||||
_m('Add or remove OpenIDs'),
|
_m('Add or remove OpenIDs'),
|
||||||
$action_name === 'openidsettings');
|
$action_name === 'openidsettings');
|
||||||
|
|
||||||
@ -592,6 +596,7 @@ class OpenIDPlugin extends Plugin
|
|||||||
'author' => 'Evan Prodromou, Craig Andrews',
|
'author' => 'Evan Prodromou, Craig Andrews',
|
||||||
'homepage' => 'http://status.net/wiki/Plugin:OpenID',
|
'homepage' => 'http://status.net/wiki/Plugin:OpenID',
|
||||||
'rawdescription' =>
|
'rawdescription' =>
|
||||||
|
// TRANS: OpenID plugin description.
|
||||||
_m('Use <a href="http://openid.net/">OpenID</a> to login to the site.'));
|
_m('Use <a href="http://openid.net/">OpenID</a> to login to the site.'));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,7 @@ class FinishaddopenidAction extends Action
|
|||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
if (!common_logged_in()) {
|
if (!common_logged_in()) {
|
||||||
|
// TRANS: Client error message
|
||||||
$this->clientError(_m('Not logged in.'));
|
$this->clientError(_m('Not logged in.'));
|
||||||
} else {
|
} else {
|
||||||
$this->tryLogin();
|
$this->tryLogin();
|
||||||
@ -85,10 +86,12 @@ class FinishaddopenidAction extends Action
|
|||||||
$response = $consumer->complete(common_local_url('finishaddopenid'));
|
$response = $consumer->complete(common_local_url('finishaddopenid'));
|
||||||
|
|
||||||
if ($response->status == Auth_OpenID_CANCEL) {
|
if ($response->status == Auth_OpenID_CANCEL) {
|
||||||
|
// TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled.
|
||||||
$this->message(_m('OpenID authentication cancelled.'));
|
$this->message(_m('OpenID authentication cancelled.'));
|
||||||
return;
|
return;
|
||||||
} else if ($response->status == Auth_OpenID_FAILURE) {
|
} else if ($response->status == Auth_OpenID_FAILURE) {
|
||||||
// Authentication failed; display the error message.
|
// TRANS: OpenID authentication failed; display the error message.
|
||||||
|
// TRANS: %s is the error message.
|
||||||
$this->message(sprintf(_m('OpenID authentication failed: %s'),
|
$this->message(sprintf(_m('OpenID authentication failed: %s'),
|
||||||
$response->message));
|
$response->message));
|
||||||
} else if ($response->status == Auth_OpenID_SUCCESS) {
|
} else if ($response->status == Auth_OpenID_SUCCESS) {
|
||||||
@ -109,8 +112,10 @@ class FinishaddopenidAction extends Action
|
|||||||
|
|
||||||
if ($other) {
|
if ($other) {
|
||||||
if ($other->id == $cur->id) {
|
if ($other->id == $cur->id) {
|
||||||
|
// TRANS: message in case a user tries to add an OpenID that is already connected to them.
|
||||||
$this->message(_m('You already have this OpenID!'));
|
$this->message(_m('You already have this OpenID!'));
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: message in case a user tries to add an OpenID that is already used by another user.
|
||||||
$this->message(_m('Someone else already has this OpenID.'));
|
$this->message(_m('Someone else already has this OpenID.'));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -123,11 +128,13 @@ class FinishaddopenidAction extends Action
|
|||||||
$result = oid_link_user($cur->id, $canonical, $display);
|
$result = oid_link_user($cur->id, $canonical, $display);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
// TRANS: message in case the OpenID object cannot be connected to the user.
|
||||||
$this->message(_m('Error connecting user.'));
|
$this->message(_m('Error connecting user.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($sreg) {
|
if ($sreg) {
|
||||||
if (!oid_update_user($cur, $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'));
|
$this->message(_m('Error updating profile'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -167,6 +174,7 @@ class FinishaddopenidAction extends Action
|
|||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title after getting the status of the OpenID authorisation request.
|
||||||
return _m('OpenID Login');
|
return _m('OpenID Login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,15 +31,18 @@ class FinishopenidloginAction extends Action
|
|||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
if (common_is_real_login()) {
|
if (common_is_real_login()) {
|
||||||
|
// TRANS: Client error message trying to log on with OpenID while already logged on.
|
||||||
$this->clientError(_m('Already logged in.'));
|
$this->clientError(_m('Already logged in.'));
|
||||||
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (!$token || $token != common_session_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.'));
|
$this->showForm(_m('There was a problem with your session token. Try again, please.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->arg('create')) {
|
if ($this->arg('create')) {
|
||||||
if (!$this->boolean('license')) {
|
if (!$this->boolean('license')) {
|
||||||
|
// TRANS: Message given if user does not agree with the site's license.
|
||||||
$this->showForm(_m('You can\'t register if you don\'t agree to the license.'),
|
$this->showForm(_m('You can\'t register if you don\'t agree to the license.'),
|
||||||
$this->trimmed('newname'));
|
$this->trimmed('newname'));
|
||||||
return;
|
return;
|
||||||
@ -48,7 +51,8 @@ class FinishopenidloginAction extends Action
|
|||||||
} else if ($this->arg('connect')) {
|
} else if ($this->arg('connect')) {
|
||||||
$this->connectUser();
|
$this->connectUser();
|
||||||
} else {
|
} else {
|
||||||
$this->showForm(_m('Something weird happened.'),
|
// TRANS: Messag given on an unknown error.
|
||||||
|
$this->showForm(_m('An unknown error has occured.'),
|
||||||
$this->trimmed('newname'));
|
$this->trimmed('newname'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -62,12 +66,15 @@ class FinishopenidloginAction extends Action
|
|||||||
$this->element('div', array('class' => 'error'), $this->error);
|
$this->element('div', array('class' => 'error'), $this->error);
|
||||||
} else {
|
} else {
|
||||||
$this->element('div', 'instructions',
|
$this->element('div', 'instructions',
|
||||||
|
// TRANS: Instructions given after a first successful logon using OpenID.
|
||||||
|
// TRANS: %s is the site name.
|
||||||
sprintf(_m('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.'), common_config('site', 'name')));
|
sprintf(_m('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.'), common_config('site', 'name')));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title
|
||||||
return _m('OpenID Account Setup');
|
return _m('OpenID Account Setup');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,6 +122,8 @@ class FinishopenidloginAction extends Action
|
|||||||
'value' => 'true'));
|
'value' => 'true'));
|
||||||
$this->elementStart('label', array('for' => 'license',
|
$this->elementStart('label', array('for' => 'license',
|
||||||
'class' => 'checkbox'));
|
'class' => 'checkbox'));
|
||||||
|
// TRANS: OpenID plugin link text.
|
||||||
|
// TRANS: %s is a link to a licese with the license name as link text.
|
||||||
$message = _('My text and files are available under %s ' .
|
$message = _('My text and files are available under %s ' .
|
||||||
'except this private data: password, ' .
|
'except this private data: password, ' .
|
||||||
'email address, IM address, and phone number.');
|
'email address, IM address, and phone number.');
|
||||||
@ -127,23 +136,29 @@ class FinishopenidloginAction extends Action
|
|||||||
$this->elementEnd('label');
|
$this->elementEnd('label');
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
$this->submit('create', _m('Create'));
|
// TRANS: Button label in form in which to create a new user on the site for an OpenID.
|
||||||
|
$this->submit('create', _m('BUTTON', 'Create'));
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
|
|
||||||
$this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
|
$this->elementStart('fieldset', array('id' => 'form_openid_createaccount'));
|
||||||
$this->element('legend', null,
|
$this->element('legend', null,
|
||||||
|
// TRANS: Used as form legend for form in which to connect an OpenID to an existing user on the site.
|
||||||
_m('Connect existing account'));
|
_m('Connect existing account'));
|
||||||
$this->element('p', null,
|
$this->element('p', null,
|
||||||
|
// TRANS: User instructions for form in which to connect an OpenID to an existing user on the site.
|
||||||
_m('If you already have an account, login with your username and password to connect it to your OpenID.'));
|
_m('If you already have an account, login with your username and password to connect it to your OpenID.'));
|
||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
|
// TRANS: Field label in form in which to connect an OpenID to an existing user on the site.
|
||||||
$this->input('nickname', _m('Existing nickname'));
|
$this->input('nickname', _m('Existing nickname'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
|
// TRANS: Field label in form in which to connect an OpenID to an existing user on the site.
|
||||||
$this->password('password', _m('Password'));
|
$this->password('password', _m('Password'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
$this->submit('connect', _m('Connect'));
|
// TRANS: Button label in form in which to connect an OpenID to an existing user on the site.
|
||||||
|
$this->submit('connect', _m('BUTTON', 'Connect'));
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
$this->elementEnd('form');
|
$this->elementEnd('form');
|
||||||
}
|
}
|
||||||
@ -155,10 +170,11 @@ class FinishopenidloginAction extends Action
|
|||||||
$response = $consumer->complete(common_local_url('finishopenidlogin'));
|
$response = $consumer->complete(common_local_url('finishopenidlogin'));
|
||||||
|
|
||||||
if ($response->status == Auth_OpenID_CANCEL) {
|
if ($response->status == Auth_OpenID_CANCEL) {
|
||||||
|
// TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled.
|
||||||
$this->message(_m('OpenID authentication cancelled.'));
|
$this->message(_m('OpenID authentication cancelled.'));
|
||||||
return;
|
return;
|
||||||
} else if ($response->status == Auth_OpenID_FAILURE) {
|
} else if ($response->status == Auth_OpenID_FAILURE) {
|
||||||
// Authentication failed; display the error message.
|
// TRANS: OpenID authentication failed; display the error message. %s is the error message.
|
||||||
$this->message(sprintf(_m('OpenID authentication failed: %s'), $response->message));
|
$this->message(sprintf(_m('OpenID authentication failed: %s'), $response->message));
|
||||||
} else if ($response->status == Auth_OpenID_SUCCESS) {
|
} else if ($response->status == Auth_OpenID_SUCCESS) {
|
||||||
// This means the authentication succeeded; extract the
|
// This means the authentication succeeded; extract the
|
||||||
@ -224,6 +240,7 @@ class FinishopenidloginAction extends Action
|
|||||||
# FIXME: save invite code before redirect, and check here
|
# FIXME: save invite code before redirect, and check here
|
||||||
|
|
||||||
if (common_config('site', 'closed')) {
|
if (common_config('site', 'closed')) {
|
||||||
|
// TRANS: OpenID plugin message. No new user registration is allowed on the site.
|
||||||
$this->clientError(_m('Registration not allowed.'));
|
$this->clientError(_m('Registration not allowed.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -233,6 +250,7 @@ class FinishopenidloginAction extends Action
|
|||||||
if (common_config('site', 'inviteonly')) {
|
if (common_config('site', 'inviteonly')) {
|
||||||
$code = $_SESSION['invitecode'];
|
$code = $_SESSION['invitecode'];
|
||||||
if (empty($code)) {
|
if (empty($code)) {
|
||||||
|
// TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and none was provided.
|
||||||
$this->clientError(_m('Registration not allowed.'));
|
$this->clientError(_m('Registration not allowed.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -240,6 +258,7 @@ class FinishopenidloginAction extends Action
|
|||||||
$invite = Invitation::staticGet($code);
|
$invite = Invitation::staticGet($code);
|
||||||
|
|
||||||
if (empty($invite)) {
|
if (empty($invite)) {
|
||||||
|
// TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid.
|
||||||
$this->clientError(_m('Not a valid invitation code.'));
|
$this->clientError(_m('Not a valid invitation code.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -250,16 +269,19 @@ class FinishopenidloginAction extends Action
|
|||||||
if (!Validate::string($nickname, array('min_length' => 1,
|
if (!Validate::string($nickname, array('min_length' => 1,
|
||||||
'max_length' => 64,
|
'max_length' => 64,
|
||||||
'format' => NICKNAME_FMT))) {
|
'format' => NICKNAME_FMT))) {
|
||||||
|
// TRANS: OpenID plugin message. The entered new user name did not conform to the requirements.
|
||||||
$this->showForm(_m('Nickname must have only lowercase letters and numbers and no spaces.'));
|
$this->showForm(_m('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!User::allowed_nickname($nickname)) {
|
if (!User::allowed_nickname($nickname)) {
|
||||||
|
// TRANS: OpenID plugin message. The entered new user name is blacklisted.
|
||||||
$this->showForm(_m('Nickname not allowed.'));
|
$this->showForm(_m('Nickname not allowed.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (User::staticGet('nickname', $nickname)) {
|
if (User::staticGet('nickname', $nickname)) {
|
||||||
|
// TRANS: OpenID plugin message. The entered new user name is already used.
|
||||||
$this->showForm(_m('Nickname already in use. Try another one.'));
|
$this->showForm(_m('Nickname already in use. Try another one.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -267,6 +289,7 @@ class FinishopenidloginAction extends Action
|
|||||||
list($display, $canonical, $sreg) = $this->getSavedValues();
|
list($display, $canonical, $sreg) = $this->getSavedValues();
|
||||||
|
|
||||||
if (!$display || !$canonical) {
|
if (!$display || !$canonical) {
|
||||||
|
// TRANS: OpenID plugin server error. A stored OpenID cannot be retrieved.
|
||||||
$this->serverError(_m('Stored OpenID not found.'));
|
$this->serverError(_m('Stored OpenID not found.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -276,6 +299,7 @@ class FinishopenidloginAction extends Action
|
|||||||
$other = oid_get_user($canonical);
|
$other = oid_get_user($canonical);
|
||||||
|
|
||||||
if ($other) {
|
if ($other) {
|
||||||
|
// TRANS: OpenID plugin server error.
|
||||||
$this->serverError(_m('Creating new account for OpenID that already has a user.'));
|
$this->serverError(_m('Creating new account for OpenID that already has a user.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -336,6 +360,7 @@ class FinishopenidloginAction extends Action
|
|||||||
$password = $this->trimmed('password');
|
$password = $this->trimmed('password');
|
||||||
|
|
||||||
if (!common_check_user($nickname, $password)) {
|
if (!common_check_user($nickname, $password)) {
|
||||||
|
// TRANS: OpenID plugin message.
|
||||||
$this->showForm(_m('Invalid username or password.'));
|
$this->showForm(_m('Invalid username or password.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -347,6 +372,7 @@ class FinishopenidloginAction extends Action
|
|||||||
list($display, $canonical, $sreg) = $this->getSavedValues();
|
list($display, $canonical, $sreg) = $this->getSavedValues();
|
||||||
|
|
||||||
if (!$display || !$canonical) {
|
if (!$display || !$canonical) {
|
||||||
|
// TRANS: OpenID plugin server error. A stored OpenID cannot be found.
|
||||||
$this->serverError(_m('Stored OpenID not found.'));
|
$this->serverError(_m('Stored OpenID not found.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -354,6 +380,7 @@ class FinishopenidloginAction extends Action
|
|||||||
$result = oid_link_user($user->id, $canonical, $display);
|
$result = oid_link_user($user->id, $canonical, $display);
|
||||||
|
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
|
// TRANS: OpenID plugin server error. The user or user profile could not be saved.
|
||||||
$this->serverError(_m('Error connecting user to OpenID.'));
|
$this->serverError(_m('Error connecting user to OpenID.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -134,6 +134,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
$consumer = oid_consumer();
|
$consumer = oid_consumer();
|
||||||
|
|
||||||
if (!$consumer) {
|
if (!$consumer) {
|
||||||
|
// TRANS: OpenID plugin server error.
|
||||||
common_server_error(_m('Cannot instantiate OpenID consumer object.'));
|
common_server_error(_m('Cannot instantiate OpenID consumer object.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -144,8 +145,11 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
|
|
||||||
// Handle failure status return values.
|
// Handle failure status return values.
|
||||||
if (!$auth_request) {
|
if (!$auth_request) {
|
||||||
|
// TRANS: OpenID plugin message. Given when an OpenID is not valid.
|
||||||
return _m('Not a valid OpenID.');
|
return _m('Not a valid OpenID.');
|
||||||
} else if (Auth_OpenID::isFailure($auth_request)) {
|
} else if (Auth_OpenID::isFailure($auth_request)) {
|
||||||
|
// TRANS: OpenID plugin server error. Given when the OpenID authentication request fails.
|
||||||
|
// TRANS: %s is the failure message.
|
||||||
return sprintf(_m('OpenID failure: %s'), $auth_request->message);
|
return sprintf(_m('OpenID failure: %s'), $auth_request->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,6 +177,8 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
$immediate);
|
$immediate);
|
||||||
if (!$redirect_url) {
|
if (!$redirect_url) {
|
||||||
} else if (Auth_OpenID::isFailure($redirect_url)) {
|
} else if (Auth_OpenID::isFailure($redirect_url)) {
|
||||||
|
// TRANS: OpenID plugin server error. Given when the OpenID authentication request cannot be redirected.
|
||||||
|
// TRANS: %s is the failure message.
|
||||||
return sprintf(_m('Could not redirect to server: %s'), $redirect_url->message);
|
return sprintf(_m('Could not redirect to server: %s'), $redirect_url->message);
|
||||||
} else {
|
} else {
|
||||||
common_redirect($redirect_url, 303);
|
common_redirect($redirect_url, 303);
|
||||||
@ -191,6 +197,8 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
// Display an error if the form markup couldn't be generated;
|
// Display an error if the form markup couldn't be generated;
|
||||||
// otherwise, render the HTML.
|
// otherwise, render the HTML.
|
||||||
if (Auth_OpenID::isFailure($form_html)) {
|
if (Auth_OpenID::isFailure($form_html)) {
|
||||||
|
// TRANS: OpenID plugin server error if the form markup could not be generated.
|
||||||
|
// TRANS: %s is the failure message.
|
||||||
common_server_error(sprintf(_m('Could not create OpenID form: %s'), $form_html->message));
|
common_server_error(sprintf(_m('Could not create OpenID form: %s'), $form_html->message));
|
||||||
} else {
|
} else {
|
||||||
$action = new AutosubmitAction(); // see below
|
$action = new AutosubmitAction(); // see below
|
||||||
@ -207,6 +215,7 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
|
|||||||
function _oid_print_instructions()
|
function _oid_print_instructions()
|
||||||
{
|
{
|
||||||
common_element('div', 'instructions',
|
common_element('div', 'instructions',
|
||||||
|
// TRANS: OpenID plugin user instructions.
|
||||||
_m('This form should automatically submit itself. '.
|
_m('This form should automatically submit itself. '.
|
||||||
'If not, click the submit button to go to your '.
|
'If not, click the submit button to go to your '.
|
||||||
'OpenID provider.'));
|
'OpenID provider.'));
|
||||||
@ -239,6 +248,7 @@ function oid_update_user(&$user, &$sreg)
|
|||||||
# XXX save timezone if it's passed
|
# XXX save timezone if it's passed
|
||||||
|
|
||||||
if (!$profile->update($orig_profile)) {
|
if (!$profile->update($orig_profile)) {
|
||||||
|
// TRANS: OpenID plugin server error.
|
||||||
common_server_error(_m('Error saving the profile.'));
|
common_server_error(_m('Error saving the profile.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -250,6 +260,7 @@ function oid_update_user(&$user, &$sreg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!$user->update($orig_user)) {
|
if (!$user->update($orig_user)) {
|
||||||
|
// TRANS: OpenID plugin server error.
|
||||||
common_server_error(_m('Error saving the user.'));
|
common_server_error(_m('Error saving the user.'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -279,6 +290,7 @@ function oid_assert_allowed($url)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TRANS: OpenID plugin client exception (403).
|
||||||
throw new ClientException(_m("Unauthorized URL used for OpenID login."), 403);
|
throw new ClientException(_m("Unauthorized URL used for OpenID login."), 403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -299,6 +311,7 @@ class AutosubmitAction extends Action
|
|||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: Title
|
||||||
return _m('OpenID Login Submission');
|
return _m('OpenID Login Submission');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,9 +322,11 @@ class AutosubmitAction extends Action
|
|||||||
$this->element('img', array('src' => Theme::path('images/icons/icon_processing.gif', 'base'),
|
$this->element('img', array('src' => Theme::path('images/icons/icon_processing.gif', 'base'),
|
||||||
// for some reason the base CSS sets <img>s as block display?!
|
// for some reason the base CSS sets <img>s as block display?!
|
||||||
'style' => 'display: inline'));
|
'style' => 'display: inline'));
|
||||||
|
// TRANS: OpenID plugin message used while requesting authorization user's OpenID login provider.
|
||||||
$this->text(_m('Requesting authorization from your login provider...'));
|
$this->text(_m('Requesting authorization from your login provider...'));
|
||||||
$this->raw('</p>');
|
$this->raw('</p>');
|
||||||
$this->raw('<p style="margin-top: 60px; font-style: italic">');
|
$this->raw('<p style="margin-top: 60px; font-style: italic">');
|
||||||
|
// TRANS: OpenID plugin message. User instruction while requesting authorization user's OpenID login provider.
|
||||||
$this->text(_m('If you are not redirected to your login provider in a few seconds, try pushing the button below.'));
|
$this->text(_m('If you are not redirected to your login provider in a few seconds, try pushing the button below.'));
|
||||||
$this->raw('</p>');
|
$this->raw('</p>');
|
||||||
$this->raw($this->form_html);
|
$this->raw($this->form_html);
|
||||||
|
@ -27,6 +27,7 @@ class OpenidloginAction extends Action
|
|||||||
{
|
{
|
||||||
parent::handle($args);
|
parent::handle($args);
|
||||||
if (common_is_real_login()) {
|
if (common_is_real_login()) {
|
||||||
|
// TRANS: Client error message trying to log on with OpenID while already logged on.
|
||||||
$this->clientError(_m('Already logged in.'));
|
$this->clientError(_m('Already logged in.'));
|
||||||
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
||||||
$openid_url = $this->trimmed('openid_url');
|
$openid_url = $this->trimmed('openid_url');
|
||||||
@ -36,6 +37,7 @@ class OpenidloginAction extends Action
|
|||||||
# CSRF protection
|
# CSRF protection
|
||||||
$token = $this->trimmed('token');
|
$token = $this->trimmed('token');
|
||||||
if (!$token || $token != common_session_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);
|
$this->showForm(_m('There was a problem with your session token. Try again, please.'), $openid_url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -65,10 +67,14 @@ class OpenidloginAction extends Action
|
|||||||
common_get_returnto()) {
|
common_get_returnto()) {
|
||||||
// rememberme logins have to reauthenticate before
|
// rememberme logins have to reauthenticate before
|
||||||
// changing any profile settings (cookie-stealing protection)
|
// changing any profile settings (cookie-stealing protection)
|
||||||
|
// TRANS: OpenID plugin message. Rememberme logins have to reauthenticate before changing any profile settings.
|
||||||
|
// TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)".
|
||||||
return _m('For security reasons, please re-login with your ' .
|
return _m('For security reasons, please re-login with your ' .
|
||||||
'[OpenID](%%doc.openid%%) ' .
|
'[OpenID](%%doc.openid%%) ' .
|
||||||
'before changing your settings.');
|
'before changing your settings.');
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: OpenID plugin message.
|
||||||
|
// TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)".
|
||||||
return _m('Login with an [OpenID](%%doc.openid%%) account.');
|
return _m('Login with an [OpenID](%%doc.openid%%) account.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,6 +100,7 @@ class OpenidloginAction extends Action
|
|||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
|
// TRANS: OpenID plugin message. Title.
|
||||||
return _m('OpenID Login');
|
return _m('OpenID Login');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,22 +118,28 @@ class OpenidloginAction extends Action
|
|||||||
'class' => 'form_settings',
|
'class' => 'form_settings',
|
||||||
'action' => $formaction));
|
'action' => $formaction));
|
||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
|
// TRANS: OpenID plugin logon form legend.
|
||||||
$this->element('legend', null, _m('OpenID login'));
|
$this->element('legend', null, _m('OpenID login'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
|
|
||||||
$this->elementStart('ul', 'form_data');
|
$this->elementStart('ul', 'form_data');
|
||||||
$this->elementStart('li');
|
$this->elementStart('li');
|
||||||
|
// TRANS: OpenID plugin logon form field label.
|
||||||
$this->input('openid_url', _m('OpenID URL'),
|
$this->input('openid_url', _m('OpenID URL'),
|
||||||
$this->openid_url,
|
$this->openid_url,
|
||||||
|
// TRANS: OpenID plugin logon form field instructions.
|
||||||
_m('Your OpenID URL'));
|
_m('Your OpenID URL'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementStart('li', array('id' => 'settings_rememberme'));
|
$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,
|
$this->checkbox('rememberme', _m('Remember me'), false,
|
||||||
|
// TRANS: OpenID plugin logon form field instructions.
|
||||||
_m('Automatically login in the future; ' .
|
_m('Automatically login in the future; ' .
|
||||||
'not for shared computers!'));
|
'not for shared computers!'));
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
$this->elementEnd('ul');
|
$this->elementEnd('ul');
|
||||||
$this->submit('submit', _m('Login'));
|
// TRANS: OpenID plugin logon form button label to start logon with the data provided in the logon form.
|
||||||
|
$this->submit('submit', _m('BUTTON', 'Login'));
|
||||||
$this->elementEnd('fieldset');
|
$this->elementEnd('fieldset');
|
||||||
$this->elementEnd('form');
|
$this->elementEnd('form');
|
||||||
}
|
}
|
||||||
|
@ -103,6 +103,7 @@ class OpenidserverAction extends Action
|
|||||||
$response = $this->generateDenyResponse($request);
|
$response = $this->generateDenyResponse($request);
|
||||||
} else {
|
} else {
|
||||||
//invalid
|
//invalid
|
||||||
|
// TRANS: OpenID plugin client error given trying to add an unauthorised OpenID to a user (403).
|
||||||
$this->clientError(sprintf(_m('You are not authorized to use the identity %s.'),$request->identity),$code=403);
|
$this->clientError(sprintf(_m('You are not authorized to use the identity %s.'),$request->identity),$code=403);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -123,6 +124,7 @@ class OpenidserverAction extends Action
|
|||||||
}
|
}
|
||||||
$this->raw($response->body);
|
$this->raw($response->body);
|
||||||
}else{
|
}else{
|
||||||
|
// TRANS: OpenID plugin client error given when not getting a response for a given OpenID provider (500).
|
||||||
$this->clientError(_m('Just an OpenID provider. Nothing to see here, move along...'),$code=500);
|
$this->clientError(_m('Just an OpenID provider. Nothing to see here, move along...'),$code=500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user