From 69a1d77480794e0357ce329a0951cf424a9c4204 Mon Sep 17 00:00:00 2001 From: brunoccast Date: Tue, 4 Jun 2019 16:55:49 +0100 Subject: [PATCH 1/3] [OpenID] Add sync confirmation in both OpenID settings and login connection --- plugins/OpenID/actions/finishaddopenid.php | 32 ++-- plugins/OpenID/actions/finishopenidlogin.php | 164 ++++++++++--------- plugins/OpenID/actions/openidsettings.php | 143 ++++++++-------- 3 files changed, 182 insertions(+), 157 deletions(-) diff --git a/plugins/OpenID/actions/finishaddopenid.php b/plugins/OpenID/actions/finishaddopenid.php index e3e100c9e4..12029eb57a 100644 --- a/plugins/OpenID/actions/finishaddopenid.php +++ b/plugins/OpenID/actions/finishaddopenid.php @@ -46,7 +46,7 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php'; */ class FinishaddopenidAction extends Action { - var $msg = null; + public $msg = null; /** * Handle the redirect back from OpenID confirmation @@ -58,7 +58,7 @@ class FinishaddopenidAction extends Action * * @return void */ - function handle() + public function handle() { parent::handle(); if (!common_logged_in()) { @@ -76,7 +76,7 @@ class FinishaddopenidAction extends Action * * @return void */ - function tryLogin() + public function tryLogin() { $consumer = oid_consumer(); @@ -86,13 +86,14 @@ class FinishaddopenidAction extends Action // TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled. $this->message(_m('OpenID authentication cancelled.')); return; - } else if ($response->status == Auth_OpenID_FAILURE) { + } elseif ($response->status == Auth_OpenID_FAILURE) { // TRANS: OpenID authentication failed; display the error message. // TRANS: %s is the error message. - $this->message(sprintf(_m('OpenID authentication failed: %s.'), - $response->message)); - } else if ($response->status == Auth_OpenID_SUCCESS) { - + $this->message(sprintf( + _m('OpenID authentication failed: %s.'), + $response->message + )); + } elseif ($response->status == Auth_OpenID_SUCCESS) { $display = $response->getDisplayIdentifier(); $canonical = ($response->endpoint && $response->endpoint->canonicalID) ? $response->endpoint->canonicalID : $display; @@ -136,17 +137,20 @@ class FinishaddopenidAction extends Action $this->message(_m('Error connecting user.')); return; } - if (Event::handle('StartOpenIDUpdateUser', array($cur, $canonical, &$sreg))) { - if ($sreg) { + + if (isset($_SESSION['openid_sync']) && $_SESSION['openid_sync']) { + if (Event::handle('StartOpenIDUpdateUser', [$cur, $canonical, &$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.')); return; } } + Event::handle('EndOpenIDUpdateUser', [$cur, $canonical, $sreg]); } - Event::handle('EndOpenIDUpdateUser', array($cur, $canonical, $sreg)); + unset($_SESSION['openid_sync']); + // success! $cur->query('COMMIT'); @@ -166,7 +170,7 @@ class FinishaddopenidAction extends Action * * @return void */ - function message($msg) + public function message($msg) { $this->message = $msg; $this->showPage(); @@ -177,7 +181,7 @@ class FinishaddopenidAction extends Action * * @return string title */ - function title() + public function title() { // TRANS: Title after getting the status of the OpenID authorisation request. return _m('OpenID Login'); @@ -188,7 +192,7 @@ class FinishaddopenidAction extends Action * * @return void */ - function showPageNotice() + public function showPageNotice() { if ($this->message) { $this->element('p', 'error', $this->message); diff --git a/plugins/OpenID/actions/finishopenidlogin.php b/plugins/OpenID/actions/finishopenidlogin.php index f91d10d252..4ba09624cb 100644 --- a/plugins/OpenID/actions/finishopenidlogin.php +++ b/plugins/OpenID/actions/finishopenidlogin.php @@ -25,17 +25,17 @@ require_once INSTALLDIR.'/plugins/OpenID/openid.php'; class FinishopenidloginAction extends Action { - var $error = null; - var $username = null; - var $message = null; + public $error = null; + public $username = null; + public $message = null; - function handle() + public function handle() { parent::handle(); 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.')); - } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { + } elseif ($_SERVER['REQUEST_METHOD'] == 'POST') { $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { // TRANS: Message given when there is a problem with the user's session token. @@ -45,27 +45,31 @@ class FinishopenidloginAction extends Action if ($this->arg('create')) { if (!$this->boolean('license')) { // TRANS: Message given if user does not agree with the site's license. - $this->showForm(_m('You cannot register if you do not agree to the license.'), - $this->trimmed('newname')); + $this->showForm( + _m('You cannot register if you do not agree to the license.'), + $this->trimmed('newname') + ); return; } $this->createNewUser(); - } else if ($this->arg('connect')) { + } elseif ($this->arg('connect')) { $this->connectUser(); } else { // TRANS: Messag given on an unknown error. - $this->showForm(_m('An unknown error has occured.'), - $this->trimmed('newname')); + $this->showForm( + _m('An unknown error has occured.'), + $this->trimmed('newname') + ); } } else { $this->tryLogin(); } } - function showPageNotice() + public function showPageNotice() { if ($this->error) { - $this->element('div', array('class' => 'error'), $this->error); + $this->element('div', ['class' => 'error'], $this->error); } else { $this->element('div', 'instructions', // TRANS: Instructions given after a first successful logon using OpenID. @@ -74,13 +78,13 @@ class FinishopenidloginAction extends Action } } - function title() + public function title() { // TRANS: Title - return _m('TITLE','OpenID Account Setup'); + return _m('TITLE', 'OpenID Account Setup'); } - function showForm($error=null, $username=null) + public function showForm($error=null, $username=null) { $this->error = $error; $this->username = $username; @@ -93,10 +97,10 @@ class FinishopenidloginAction extends Action * Should probably be replaced with an extensible mini version of * the core registration form. */ - function showContent() + public function showContent() { if (!empty($this->message_text)) { - $this->element('div', array('class' => 'error'), $this->message_text); + $this->element('div', ['class' => 'error'], $this->message_text); return; } @@ -107,12 +111,12 @@ class FinishopenidloginAction extends Action // info. The profile will be pre-populated with whatever name, // email, and location we can get from the OpenID provider, so // all we ask for is the license confirmation. - $this->elementStart('form', array('method' => 'post', - 'id' => 'account_create', - 'class' => 'form_settings', - 'action' => common_local_url('finishopenidlogin'))); + $this->elementStart('form', ['method' => 'post', + 'id' => 'account_create', + 'class' => 'form_settings', + 'action' => common_local_url('finishopenidlogin')]); $this->hidden('token', common_session_token()); - $this->elementStart('fieldset', array('id' => 'form_openid_createaccount')); + $this->elementStart('fieldset', ['id' => 'form_openid_createaccount']); $this->element('legend', null, // TRANS: Fieldset legend. _m('Create new account')); @@ -122,39 +126,41 @@ class FinishopenidloginAction extends Action $this->elementStart('ul', 'form_data'); // Hook point for captcha etc - Event::handle('StartRegistrationFormData', array($this)); + Event::handle('StartRegistrationFormData', [$this]); $this->elementStart('li'); // TRANS: Field label. - $this->input('newname', _m('New nickname'), + $this->input('newname', + _m('New nickname'), ($this->username) ? $this->username : '', // TRANS: Field title. _m('1-64 lowercase letters or numbers, no punctuation or spaces.')); $this->elementEnd('li'); $this->elementStart('li'); // TRANS: Field label. - $this->input('email', _m('Email'), $this->getEmail(), + $this->input('email', _m('Email'), + $this->getEmail(), // TRANS: Field title. _m('Used only for updates, announcements, '. - 'and password recovery.')); + 'and password recovery.')); $this->elementEnd('li'); // Hook point for captcha etc - Event::handle('EndRegistrationFormData', array($this)); + Event::handle('EndRegistrationFormData', [$this]); $this->elementStart('li'); - $this->element('input', array('type' => 'checkbox', - 'id' => 'license', - 'class' => 'checkbox', - 'name' => 'license', - 'value' => 'true')); - $this->elementStart('label', array('for' => 'license', - 'class' => 'checkbox')); + $this->element('input', ['type' => 'checkbox', + 'id' => 'license', + 'class' => 'checkbox', + 'name' => 'license', + 'value' => 'true']); + $this->elementStart('label', ['for' => 'license', + 'class' => 'checkbox']); // TRANS: OpenID plugin link text. // TRANS: %s is a link to a license with the license name as link text. $message = _m('My text and files are available under %s ' . - 'except this private data: password, ' . - 'email address, IM address, and phone number.'); + 'except this private data: password, ' . + 'email address, IM address, and phone number.'); $link = '' . @@ -171,12 +177,12 @@ class FinishopenidloginAction extends Action // The second option is to attach this OpenID to an existing account // on the local system, which they need to provide a password for. - $this->elementStart('form', array('method' => 'post', - 'id' => 'account_connect', - 'class' => 'form_settings', - 'action' => common_local_url('finishopenidlogin'))); + $this->elementStart('form', ['method' => 'post', + 'id' => 'account_connect', + 'class' => 'form_settings', + 'action' => common_local_url('finishopenidlogin')]); $this->hidden('token', common_session_token()); - $this->elementStart('fieldset', array('id' => 'form_openid_createaccount')); + $this->elementStart('fieldset', ['id' => 'form_openid_createaccount']); $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')); @@ -192,6 +198,11 @@ class FinishopenidloginAction extends Action // TRANS: Field label in form in which to connect an OpenID to an existing user on the site. $this->password('password', _m('Password')); $this->elementEnd('li'); + $this->elementStart('li'); + // TRANS: Field label in form in which to connect an OpenID to an existing user on the site. + $this->checkbox('openid-sync', _m('Sync Account'), false, + _m('Syncronize GNU social profile with this OpenID identity.')); + $this->elementEnd('li'); $this->elementEnd('ul'); // TRANS: Button text in form in which to connect an OpenID to an existing user on the site. $this->submit('connect', _m('BUTTON', 'Connect')); @@ -205,7 +216,7 @@ class FinishopenidloginAction extends Action * * @return string */ - function getEmail() + public function getEmail() { $email = $this->trimmed('email'); if (!empty($email)) { @@ -232,7 +243,7 @@ class FinishopenidloginAction extends Action return ''; } - function tryLogin() + public function tryLogin() { $consumer = oid_consumer(); @@ -242,10 +253,10 @@ class FinishopenidloginAction extends Action // TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled. $this->message(_m('OpenID authentication cancelled.')); return; - } else if ($response->status == Auth_OpenID_FAILURE) { + } elseif ($response->status == Auth_OpenID_FAILURE) { // TRANS: OpenID authentication failed; display the error message. %s is the error message. $this->message(sprintf(_m('OpenID authentication failed: %s.'), $response->message)); - } else if ($response->status == Auth_OpenID_SUCCESS) { + } elseif ($response->status == Auth_OpenID_SUCCESS) { // This means the authentication succeeded; extract the // identity URL and Simple Registration data (if it was // returned). @@ -290,13 +301,13 @@ class FinishopenidloginAction extends Action } } - function message($msg) + public function message($msg) { $this->message_text = $msg; $this->showPage(); } - function saveValues($display, $canonical, $sreg) + public function saveValues($display, $canonical, $sreg) { common_ensure_session(); $_SESSION['openid_display'] = $display; @@ -304,18 +315,18 @@ class FinishopenidloginAction extends Action $_SESSION['openid_sreg'] = $sreg; } - function getSavedValues() + public function getSavedValues() { - return array($_SESSION['openid_display'], - $_SESSION['openid_canonical'], - $_SESSION['openid_sreg']); + return [$_SESSION['openid_display'], + $_SESSION['openid_canonical'], + $_SESSION['openid_sreg']]; } - function createNewUser() + public function createNewUser() { // FIXME: save invite code before redirect, and check here - if (!Event::handle('StartRegistrationTry', array($this))) { + if (!Event::handle('StartRegistrationTry', [$this])) { return; } @@ -364,7 +375,7 @@ class FinishopenidloginAction extends Action $this->serverError(_m('Creating new account for OpenID that already has a user.')); } - Event::handle('StartOpenIDCreateNewUser', array($canonical, &$sreg)); + Event::handle('StartOpenIDCreateNewUser', [$canonical, &$sreg]); $location = ''; if (!empty($sreg['country'])) { @@ -388,10 +399,10 @@ class FinishopenidloginAction extends Action // XXX: add language // XXX: add timezone - $args = array('nickname' => $nickname, - 'email' => $email, - 'fullname' => $fullname, - 'location' => $location); + $args = ['nickname' => $nickname, + 'email' => $email, + 'fullname' => $fullname, + 'location' => $location]; if (!empty($invite)) { $args['code'] = $invite->code; @@ -401,7 +412,7 @@ class FinishopenidloginAction extends Action $result = oid_link_user($user->id, $canonical, $display); - Event::handle('EndOpenIDCreateNewUser', array($user, $canonical, $sreg)); + Event::handle('EndOpenIDCreateNewUser', [$user, $canonical, $sreg]); oid_set_last($display); common_set_user($user); @@ -411,16 +422,17 @@ class FinishopenidloginAction extends Action } unset($_SESSION['openid_rememberme']); - Event::handle('EndRegistrationTry', array($this)); + Event::handle('EndRegistrationTry', [$this]); - common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), 303); + common_redirect(common_local_url('showstream', ['nickname' => $user->nickname]), 303); } - function connectUser() + public function connectUser() { $nickname = $this->trimmed('nickname'); $password = $this->trimmed('password'); - + $sync = $this->boolean('openid-sync'); + if (!common_check_user($nickname, $password)) { // TRANS: OpenID plugin message. $this->showForm(_m('Invalid username or password.')); @@ -445,10 +457,12 @@ class FinishopenidloginAction extends Action $this->serverError(_m('Error connecting user to OpenID.')); } - if (Event::handle('StartOpenIDUpdateUser', array($user, $canonical, &$sreg))) { - oid_update_user($user, $sreg); + if ($sync) { + if (Event::handle('StartOpenIDUpdateUser', [$user, $canonical, &$sreg])) { + oid_update_user($user, $sreg); + } + Event::handle('EndOpenIDUpdateUser', [$user, $canonical, $sreg]); } - Event::handle('EndOpenIDUpdateUser', array($user, $canonical, $sreg)); oid_set_last($display); common_set_user($user); @@ -460,22 +474,20 @@ class FinishopenidloginAction extends Action $this->goHome($user->nickname); } - function goHome($nickname) + public function goHome($nickname) { $url = common_get_returnto(); if ($url) { // We don't have to return to it again common_set_returnto(null); - $url = common_inject_session($url); + $url = common_inject_session($url); } else { - $url = common_local_url('all', - array('nickname' => - $nickname)); + $url = common_local_url('all', ['nickname' => $nickname]); } common_redirect($url, 303); } - function bestNewNickname($display, $sreg) + public function bestNewNickname($display, $sreg) { // Try the passed-in nickname @@ -508,7 +520,7 @@ class FinishopenidloginAction extends Action return null; } - function openidToNickname($openid) + public function openidToNickname($openid) { if (Auth_Yadis_identifierScheme($openid) == 'XRI') { return $this->xriToNickname($openid); @@ -521,12 +533,12 @@ class FinishopenidloginAction extends Action // 1. Plain hostname, like http://evanp.myopenid.com/ // 2. One element in path, like http://profile.typekey.com/EvanProdromou/ // or http://getopenid.com/evanprodromou - function urlToNickname($openid) + public function urlToNickname($openid) { return common_url_to_nickname($openid); } - function xriToNickname($xri) + public function xriToNickname($xri) { $base = $this->xriBase($xri); @@ -540,7 +552,7 @@ class FinishopenidloginAction extends Action } } - function xriBase($xri) + public function xriBase($xri) { if (substr($xri, 0, 6) == 'xri://') { return substr($xri, 6); diff --git a/plugins/OpenID/actions/openidsettings.php b/plugins/OpenID/actions/openidsettings.php index 9651ec3134..fd35e0f96f 100644 --- a/plugins/OpenID/actions/openidsettings.php +++ b/plugins/OpenID/actions/openidsettings.php @@ -27,7 +27,9 @@ * @link http://status.net/ */ -if (!defined('GNUSOCIAL')) { exit(1); } +if (!defined('GNUSOCIAL')) { + exit(1); +} require_once INSTALLDIR.'/plugins/OpenID/openid.php'; @@ -49,10 +51,10 @@ class OpenidsettingsAction extends SettingsAction * * @return string Page title */ - function title() + public function title() { // TRANS: Title of OpenID settings page for a user. - return _m('TITLE','OpenID settings'); + return _m('TITLE', 'OpenID settings'); } /** @@ -60,16 +62,16 @@ class OpenidsettingsAction extends SettingsAction * * @return string Instructions for use */ - function getInstructions() + public function getInstructions() { // TRANS: Form instructions for OpenID settings. // TRANS: This message contains Markdown links in the form [description](link). return _m('[OpenID](%%doc.openid%%) lets you log into many sites ' . - 'with the same user account. '. - 'Manage your associated OpenIDs from here.'); + 'with the same user account. '. + 'Manage your associated OpenIDs from here.'); } - function showScripts() + public function showScripts() { parent::showScripts(); $this->autofocus('openid_url'); @@ -82,30 +84,36 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function showContent() + public function showContent() { if (!common_config('openid', 'trusted_provider')) { - $this->elementStart('form', array('method' => 'post', - 'id' => 'form_settings_openid_add', - 'class' => 'form_settings', - 'action' => - common_local_url('openidsettings'))); - $this->elementStart('fieldset', array('id' => 'settings_openid_add')); + $this->elementStart('form', ['method' => 'post', + 'id' => 'form_settings_openid_add', + 'class' => 'form_settings', + 'action' => + common_local_url('openidsettings')]); + $this->elementStart('fieldset', ['id' => 'settings_openid_add']); // TRANS: Fieldset legend. - $this->element('legend', null, _m('LEGEND','Add OpenID')); + $this->element('legend', null, _m('LEGEND', 'Add OpenID')); $this->hidden('token', common_session_token()); $this->elementStart('ul', 'form_data'); $this->elementStart('li'); // TRANS: Field label. $this->input('openid_url', _m('OpenID URL'), null, - // TRANS: Form guide. - _m('An OpenID URL which identifies you.'), null, true, - array('placeholder'=>'https://example.com/you')); + // TRANS: Form guide. + _m('An OpenID URL which identifies you.'), + null, true, + ['placeholder'=>'https://example.com/you']); + $this->elementEnd('li'); + $this->elementStart('li'); + // TRANS: Field label. + $this->checkbox('openid-sync', _m('Sync Account'), false, + _m('Syncronize GNU social profile with this OpenID identity.')); $this->elementEnd('li'); $this->elementEnd('ul'); // TRANS: Button text for adding an OpenID URL. - $this->submit('settings_openid_add_action-submit', _m('BUTTON','Add'), 'submit', 'add'); + $this->submit('settings_openid_add_action-submit', _m('BUTTON', 'Add'), 'submit', 'add'); $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -117,46 +125,40 @@ class OpenidsettingsAction extends SettingsAction if ($cnt > 0) { // TRANS: Header on OpenID settings page. - $this->element('h2', null, _m('HEADER','Remove OpenID')); + $this->element('h2', null, _m('HEADER', 'Remove OpenID')); if ($cnt == 1 && !$this->scoped->hasPassword()) { - $this->element('p', 'form_guide', // TRANS: Form guide. _m('Removing your only OpenID '. - 'would make it impossible to log in! ' . - 'If you need to remove it, '. - 'add another OpenID first.')); + 'would make it impossible to log in! ' . + 'If you need to remove it, '. + 'add another OpenID first.')); if ($oid->fetch()) { $this->elementStart('p'); - $this->element('a', array('href' => $oid->canonical), - $oid->display); + $this->element('a', ['href' => $oid->canonical], $oid->display); $this->elementEnd('p'); } - } else { - $this->element('p', 'form_guide', // TRANS: Form guide. _m('You can remove an OpenID from your account '. - 'by clicking the button marked "Remove".')); + 'by clicking the button marked "Remove".')); $idx = 0; while ($oid->fetch()) { - $this->elementStart('form', - array('method' => 'POST', - 'id' => 'form_settings_openid_delete' . $idx, - 'class' => 'form_settings', - 'action' => - common_local_url('openidsettings'))); + $this->elementStart('form', ['method' => 'POST', + 'id' => 'form_settings_openid_delete' . $idx, + 'class' => 'form_settings', + 'action' => + common_local_url('openidsettings')]); $this->elementStart('fieldset'); $this->hidden('token', common_session_token()); - $this->element('a', array('href' => $oid->canonical), - $oid->display); + $this->element('a', ['href' => $oid->canonical], $oid->display); $this->hidden("openid_url{$idx}", $oid->canonical, 'openid_url'); // TRANS: Button text to remove an OpenID. - $this->submit("remove{$idx}", _m('BUTTON','Remove'), 'submit remove', 'remove'); + $this->submit("remove{$idx}", _m('BUTTON', 'Remove'), 'submit remove', 'remove'); $this->elementEnd('fieldset'); $this->elementEnd('form'); $idx++; @@ -164,49 +166,51 @@ class OpenidsettingsAction extends SettingsAction } } - $this->elementStart('form', array('method' => 'post', - 'id' => 'form_settings_openid_trustroots', - 'class' => 'form_settings', - 'action' => - common_local_url('openidsettings'))); - $this->elementStart('fieldset', array('id' => 'settings_openid_trustroots')); + $this->elementStart('form', ['method' => 'post', + 'id' => 'form_settings_openid_trustroots', + 'class' => 'form_settings', + 'action' => + common_local_url('openidsettings')]); + $this->elementStart('fieldset', ['id' => 'settings_openid_trustroots']); // TRANS: Fieldset legend. $this->element('legend', null, _m('OpenID Trusted Sites')); $this->hidden('token', common_session_token()); $this->element('p', 'form_guide', // TRANS: Form guide. _m('The following sites are allowed to access your ' . - 'identity and log you in. You can remove a site from ' . - 'this list to deny it access to your OpenID.')); + 'identity and log you in. You can remove a site from ' . + 'this list to deny it access to your OpenID.')); $this->elementStart('ul', 'form_data'); $user_openid_trustroot = new User_openid_trustroot(); $user_openid_trustroot->user_id = $this->scoped->getID(); - if($user_openid_trustroot->find()) { - while($user_openid_trustroot->fetch()) { + if ($user_openid_trustroot->find()) { + while ($user_openid_trustroot->fetch()) { $this->elementStart('li'); - $this->element('input', array('name' => 'openid_trustroot[]', - 'type' => 'checkbox', - 'class' => 'checkbox', - 'value' => $user_openid_trustroot->trustroot, - 'id' => 'openid_trustroot_' . crc32($user_openid_trustroot->trustroot))); - $this->element('label', array('class'=>'checkbox', 'for' => 'openid_trustroot_' . crc32($user_openid_trustroot->trustroot)), + $this->element('input', ['name' => 'openid_trustroot[]', + 'type' => 'checkbox', + 'class' => 'checkbox', + 'value' => $user_openid_trustroot->trustroot, + 'id' => 'openid_trustroot_' . crc32($user_openid_trustroot->trustroot)]); + $this->element('label', + ['class'=>'checkbox', + 'for' => 'openid_trustroot_' . crc32($user_openid_trustroot->trustroot)], $user_openid_trustroot->trustroot); $this->elementEnd('li'); } } $this->elementEnd('ul'); // TRANS: Button text to remove an OpenID trustroot. - $this->submit('settings_openid_trustroots_action-submit', _m('BUTTON','Remove'), 'submit', 'remove_trustroots'); + $this->submit('settings_openid_trustroots_action-submit', _m('BUTTON', 'Remove'), 'submit', 'remove_trustroots'); $this->elementEnd('fieldset'); $prefs = User_openid_prefs::getKV('user_id', $this->scoped->getID()); $this->elementStart('fieldset'); - $this->element('legend', null, _m('LEGEND','Preferences')); + $this->element('legend', null, _m('LEGEND', 'Preferences')); $this->elementStart('ul', 'form_data'); $this->checkbox('hide_profile_link', "Hide OpenID links from my profile", !empty($prefs) && $prefs->hide_profile_link); // TRANS: Button text to save OpenID prefs - $this->submit('settings_openid_prefs_save', _m('BUTTON','Save'), 'submit', 'save_prefs'); + $this->submit('settings_openid_prefs_save', _m('BUTTON', 'Save'), 'submit', 'save_prefs'); $this->elementEnd('ul'); $this->elementEnd('fieldset'); @@ -227,17 +231,21 @@ class OpenidsettingsAction extends SettingsAction // TRANS: Form validation error if no OpenID providers can be added. throw new ServerException(_m('Cannot add new providers.')); } else { + common_ensure_session(); + $_SESSION['openid_sync'] = $this->boolean('openid-sync'); + $result = oid_authenticate($this->trimmed('openid_url'), 'finishaddopenid'); if (is_string($result)) { // error message + unset($_SESSION['openid-sync']); throw new ServerException($result); } return _('Added new provider.'); } - } else if ($this->arg('remove')) { + } elseif ($this->arg('remove')) { return $this->removeOpenid(); - } else if($this->arg('remove_trustroots')) { + } elseif ($this->arg('remove_trustroots')) { return $this->removeTrustroots(); - } else if($this->arg('save_prefs')) { + } elseif ($this->arg('save_prefs')) { return $this->savePrefs(); } @@ -253,13 +261,14 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function removeTrustroots() + public function removeTrustroots() { - $trustroots = $this->arg('openid_trustroot', array()); - foreach($trustroots as $trustroot) { + $trustroots = $this->arg('openid_trustroot', []); + foreach ($trustroots as $trustroot) { $user_openid_trustroot = User_openid_trustroot::pkeyGet( - array('user_id'=>$this->scoped->getID(), 'trustroot'=>$trustroot)); - if($user_openid_trustroot) { + ['user_id'=>$this->scoped->getID(), 'trustroot'=>$trustroot] + ); + if ($user_openid_trustroot) { $user_openid_trustroot->delete(); } else { // TRANS: Form validation error when trying to remove a non-existing trustroot. @@ -279,7 +288,7 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function removeOpenid() + public function removeOpenid() { $oid = User_openid::getKV('canonical', $this->trimmed('openid_url')); @@ -304,7 +313,7 @@ class OpenidsettingsAction extends SettingsAction * * @return void */ - function savePrefs() + public function savePrefs() { $orig = null; $prefs = User_openid_prefs::getKV('user_id', $this->scoped->getID()); From b8352e912f3bb486160484918019e000086f5799 Mon Sep 17 00:00:00 2001 From: brunoccast Date: Fri, 7 Jun 2019 18:57:50 +0100 Subject: [PATCH 2/3] [THEME] Fix styles identation --- theme/base/css/display.css | 861 +++++++++++++++++++++---------------- 1 file changed, 490 insertions(+), 371 deletions(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 2be393f44b..cfb7720e63 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -703,7 +703,7 @@ address .poweredby { } .notice .automatic { -font-style:italic; + font-style:italic; } #remoteprofile .notice .h-entry, @@ -785,29 +785,29 @@ font-style:italic; } .notice .attachment.more, .mode-private .privacy_mode { -text-indent:-9999px; -width:16px; -height:16px; -display:inline-block; -overflow:hidden; -vertical-align:middle; -margin-left:4px; + text-indent:-9999px; + width:16px; + height:16px; + display:inline-block; + overflow:hidden; + vertical-align:middle; + margin-left:4px; } #attachments .attachment, .notice .attachment.more { -padding-left:0; + padding-left:0; } .notice .attachment img { -position:absolute; -top:18px; -left:0; -z-index:99; + position:absolute; + top:18px; + left:0; + z-index:99; } #shownotice .notice .attachment img { -position:static; + position:static; } .notice.h-entry .attachments { @@ -843,44 +843,49 @@ position:static; } #attachments { -clear:both; -float:left; -width:100%; -margin-top:18px; + clear:both; + float:left; + width:100%; + margin-top:18px; } + #attachments dt { -font-weight:bold; -font-size:1.3em; -margin-bottom:4px; + font-weight:bold; + font-size:1.3em; + margin-bottom:4px; } #attachments ol li { -margin-bottom:18px; -list-style-type:decimal; -float:left; -clear:both; + margin-bottom:18px; + list-style-type:decimal; + float:left; + clear:both; } #attachment_view img, #attachment_view .attachment_player { -height: auto; -width: auto; -max-width:480px; -max-height:480px; + height: auto; + width: auto; + max-width:480px; + max-height:480px; } + #attachment_view #oembed_info { -margin-top:11px; + margin-top:11px; } + #attachment_view #oembed_info dt, #attachment_view #oembed_info dd { -float:left; + float:left; } + #attachment_view #oembed_info dt { -clear:left; -margin-right:11px; -font-weight:bold; + clear:left; + margin-right:11px; + font-weight:bold; } + #attachment_view #oembed_info dt:after { -content: ":"; + content: ":"; } /* threaded replies */ @@ -1030,7 +1035,7 @@ content: ":"; .aside .section p, .aside .section .more { -clear:both; + clear:both; } .notice-headers > .u-uid { @@ -1072,17 +1077,18 @@ clear:both; } .section tbody td { -padding-right:18px; -padding-bottom:11px; + padding-right:18px; + padding-bottom:11px; } #entity_statistics dt, #entity_statistics dd { -display:inline; -margin-right:11px; + display:inline; + margin-right:11px; } + #entity_statistics dt:after { -content: ":"; + content: ":"; } .section ul.entities { @@ -1102,57 +1108,68 @@ content: ":"; } .tag-cloud { -list-style-type:none; -text-align:center; + list-style-type:none; + text-align:center; } + .aside .tag-cloud { -font-size:0.8em; -word-wrap:break-word; + font-size:0.8em; + word-wrap:break-word; } + .tag-cloud li { -display:inline; -margin-right:7px; -line-height:1.25; + display:inline; + margin-right:7px; + line-height:1.25; } .tag-cloud li:before { -content:'\0009'; + content:'\0009'; } .aside .tag-cloud li { -line-height:1.5; + line-height:1.5; } + .tag-cloud li a { -text-decoration:none; + text-decoration:none; } + #tagcloud.section dt { -text-transform:uppercase; -font-weight:bold; + text-transform:uppercase; + font-weight:bold; } + .tag-cloud-1 { -font-size:1em; + font-size:1em; } + .tag-cloud-2 { -font-size:1.25em; + font-size:1.25em; } + .tag-cloud-3 { -font-size:1.75em; + font-size:1.75em; } + .tag-cloud-4 { -font-size:2em; + font-size:2em; } + .tag-cloud-5 { -font-size:2.25em; + font-size:2.25em; } + .tag-cloud-6 { -font-size:2.75em; + font-size:2.75em; } + .tag-cloud-7 { -font-size:3.25em; + font-size:3.25em; } #publictagcloud #tagcloud.section dt { -display:none; + display:none; } /* secondary elements */ @@ -1166,8 +1183,8 @@ display:none; } #page_notice { -clear:both; -margin-bottom:18px; + clear:both; + margin-bottom:18px; } .e-content .success { @@ -1176,72 +1193,77 @@ margin-bottom:18px; .system_notice ul, .instructions ul { -margin-left:1em; + margin-left:1em; } + .instructions p, .instructions ul { -margin-bottom:18px; + margin-bottom:18px; } + .help dt { -display:none; + display:none; } + .guide { -clear:both; + clear:both; } button.close, button.minimize { -width:16px; -height:16px; -text-indent:-9999px; -padding:0; -border:0; -text-align:center; -font-weight:bold; -cursor:pointer; + width:16px; + height:16px; + text-indent:-9999px; + padding:0; + border:0; + text-align:center; + font-weight:bold; + cursor:pointer; } .dialogbox { -position:absolute; + position:absolute; width: 200px; top: 0px; right: 0px; -z-index:9; -float:none; -padding:11px; -border-style:solid; -border-width:1px; + z-index:9; + float:none; + padding:11px; + border-style:solid; + border-width:1px; background: #fff; color: #000; } .dialogbox legend { -display:block !important; -margin-right:18px; -margin-bottom:18px; + display:block !important; + margin-right:18px; + margin-bottom:18px; } .dialogbox button.close { -position:absolute; -right:3px; -top:3px; + position:absolute; + right:3px; + top:3px; } .dialogbox .form_guide { -font-weight:normal; -padding:0; + font-weight:normal; + padding:0; } .dialogbox .submit_dialogbox { -font-weight:bold; -text-indent:0; -min-width:46px; + font-weight:bold; + text-indent:0; + min-width:46px; } + .dialogbox input { -padding-left:4px; + padding-left:4px; } + .dialogbox fieldset { -margin-bottom:0; + margin-bottom:0; } .notice-options .form_repeat.dialogbox input.submit_dialogbox { @@ -1298,12 +1320,13 @@ margin-bottom:0; } #site_content_license_cc { -margin-bottom:0; + margin-bottom:0; } + #site_content_license_cc img { -display:inline; -vertical-align:top; -margin-right:4px; + display:inline; + vertical-align:top; + margin-right:4px; } form ul li { @@ -1312,7 +1335,7 @@ form ul li { } form label.submit { -display:none; + display:none; } .form_settings fieldset { @@ -1337,21 +1360,24 @@ display:none; } .form_settings input.remove { -margin-left:11px; + margin-left:11px; } + .form_settings .form_data li { -width:100%; -float:left; + width:100%; + float:left; margin-bottom: 22px; } + .form_settings .form_data label { -float:left; + float:left; } + .form_settings .form_data textarea, .form_settings .form_data select, .form_settings .form_data input { -margin-left:1.795%; -float:left; + margin-left:1.795%; + float:left; } .form_settings .form_data select { @@ -1362,18 +1388,19 @@ float:left; .form_settings .form_data input.submit, .form_settings .form_data input.checkbox, .form_settings .form_data input.radio { -width:auto; + width:auto; } + .form_settings .form_data textarea { -width:63%; + width:63%; } .form_settings .form_data input.submit { -margin-left:0; + margin-left:0; } .form_settings label { -margin-top:2px; + margin-top:2px; width: 25%; text-align: right; } @@ -1407,15 +1434,16 @@ margin-top:2px; } .form_actions label { -display:none; + display:none; } + .form_guide { -font-style:italic; + font-style:italic; } .form_settings #settings_autosubscribe label { -display:inline; -font-weight:bold; + display:inline; + font-weight:bold; } #form_settings_profile legend, @@ -1439,36 +1467,36 @@ font-weight:bold; .form_tag_user_wrap form, .form_tag_user_wrap label, .form_tag_user_wrap legend { -display:none; + display:none; } .form_tag_user_wrap { -clear:both; + clear:both; } .form_tag_user { -float:left; -width:auto; + float:left; + width:auto; } .form_tag_user input.submit { -width:50px; + width:50px; } .form_settings .form_data p.form_guide { -clear:both; + clear:both; margin-left: 27%; -margin-bottom:0; + margin-bottom:0; line-height: 1.2em; padding-top: 4px; } .form_settings p { -margin-bottom:11px; + margin-bottom:11px; } .form_settings .form_note { -padding:0 7px; + padding:0 7px; } .form_settings .form_response { @@ -1480,14 +1508,15 @@ padding:0 7px; } #form_search .submit { -margin-left:11px; + margin-left:11px; } + #form_search .form_data input { -width:auto; + width:auto; } .h-entry .e-content .form_settings ul { -margin-left:0; + margin-left:0; } .notice > footer { @@ -1510,8 +1539,8 @@ margin-left:0; } .limited-scope .e-content .timestamp:before { -content:'☠'; -font-size:150%; + content:'☠'; + font-size:150%; } #content .notice-source-activity div.entry-title, .notice-source-activity div.e-content { @@ -1547,11 +1576,11 @@ span.rtl { .entity_moderation:hover ul, .entity_role:hover ul, .dialogbox { -border-color:#DDDDDD; + border-color:#DDDDDD; } .form_settings input.form_action-primary { -background:none; + background:none; } .form_settings .form_note { @@ -1559,54 +1588,59 @@ background:none; } #form_settings_photo .form_data { -clear:both; + clear:both; } #form_settings_avatar li { -width:auto; + width:auto; } + #form_settings_avatar input { -margin-left:0; + margin-left:0; } + #avatar_original, #avatar_preview { -float:left; + float:left; } + #avatar_preview { -margin-left:29px; + margin-left:29px; } + #avatar_preview_view { -height:96px; -width:96px; -margin-bottom:18px; -overflow:hidden; + height:96px; + width:96px; + margin-bottom:18px; + overflow:hidden; } #settings_attach, #form_settings_avatar .form_actions { -clear:both; + clear:both; } #form_settings_avatar .form_actions { -margin-bottom:0; + margin-bottom:0; } .entity_profile { -position:relative; -width:73%; -min-height:123px; -float:left; -margin-bottom:18px; -margin-left:0; -overflow:hidden; + position:relative; + width:73%; + min-height:123px; + float:left; + margin-bottom:18px; + margin-left:0; + overflow:hidden; } .entity_profile dt, #entity_statistics dt { -font-weight:bold; + font-weight:bold; } + .entity_profile dd { -display:inline; + display:inline; } .entity_profile .entity_depiction { @@ -1625,16 +1659,16 @@ display:inline; .entity_profile .entity_tags, .entity_profile .entity_aliases, .entity_profile .entity_statistics { -margin-left:113px; -margin-bottom:4px; + margin-left:113px; + margin-bottom:4px; } .peopletags_edit_button { -cursor:pointer; -border:0; -padding:0; -width:16px; -height:16px; + cursor:pointer; + border:0; + padding:0; + width:16px; + height:16px; position: relative; top: -3px; } @@ -1662,7 +1696,7 @@ table.profile_list tbody tr:nth-child(2n+1) { .entity_profile .entity_nickname, .entity_profile .entity_fn { -margin-left:0; + margin-left:0; } .entity_profile .p-nickname { @@ -1678,57 +1712,66 @@ margin-left:0; } .entity_profile .p-name:before { -content: "("; -font-weight:normal; + content: "("; + font-weight:normal; } + .entity_profile .p-name:after { -content: ")"; -font-weight:normal; + content: ")"; + font-weight:normal; } + .entity_profile .p-nickname:after, .entity_profile .p-nickname:before { -content:""; + content:""; } + .entity_profile dt, .entity_profile h2 { -display:none; + display:none; } + .entity_profile .role { -margin-left:11px; -font-style:italic; + margin-left:11px; + font-style:italic; } .entity_actions { -float:right; -margin-left:2%; + float:right; + margin-left:2%; margin-bottom: 28px; -min-width:21%; + min-width:21%; } .entity_actions h2 { -display:none; + display:none; } + .entity_actions ul { -list-style-type:none; + list-style-type:none; } + .entity_actions li { -margin-bottom:7px; + margin-bottom:7px; } + .entity_actions li:first-child { -border-top:0; + border-top:0; } + .entity_actions fieldset { -border:0; -padding:0; + border:0; + padding:0; } + .entity_actions legend { -display:none; + display:none; } .entity_actions input.submit { -display:block; -text-align:left; -width:100%; + display:block; + text-align:left; + width:100%; } .entity_actions a, .entity_actions input, .entity_actions p { @@ -1738,8 +1781,8 @@ width:100%; } .entity_actions a { -text-decoration:none; -display:block; + text-decoration:none; + display:block; padding: 3px 4px 4px 28px; } @@ -1765,13 +1808,13 @@ display:block; } .entity_actions .accept { -margin-bottom:18px; + margin-bottom:18px; } .entity_send-a-message button { -position:absolute; -top:3px; -right:3px; + position:absolute; + top:3px; + right:3px; } .entity_send-a-message .form_notice { @@ -1792,16 +1835,17 @@ right:3px; } .entity_send-a-message .form_notice legend { -display:block; -margin-bottom:11px; + display:block; + margin-bottom:11px; font-weight: normal; color: #333 !important; } .entity_send-a-message .form_notice label, .entity_send-a-message .form_notice select { -display:none; + display:none; } + .entity_send-a-message .form_notice .submit { position: absolute; top: 52px; @@ -1811,45 +1855,50 @@ display:none; .entity_moderation, .entity_role { -position:relative; + position:relative; } + .entity_moderation p, .entity_role p { - -padding-bottom:2px; -margin-bottom:7px; + padding-bottom:2px; + margin-bottom:7px; } + .entity_moderation ul, .entity_role ul { -display:none; + display:none; } + .entity_moderation:hover ul, .entity_role:hover ul { -display:block; -width:110%; -padding:11px; -position:absolute; -z-index:1; -border-width:1px; -border-style:solid; - top: 20px; - right: 0px; - background-color: #fff; + display:block; + width:110%; + padding:11px; + position:absolute; + z-index:1; + border-width:1px; + border-style:solid; + top: 20px; + right: 0px; + background-color: #fff; } .entity_tags ul { -list-style-type:none; -display:inline; + list-style-type:none; + display:inline; } + .entity_tags li { -display:inline; -margin-right:7px; + display:inline; + margin-right:7px; } + .entity_tags li:before { -content:'\0009'; + content:'\0009'; } + .entity_tags p.error { -clear:both; + clear:both; } #filter_tags { @@ -1858,46 +1907,51 @@ clear:both; border-bottom: 1px solid #ccc; float: left; } + #filter_tags dt { -display:none; + display:none; } + #filter_tags ul { -list-style-type:none; + list-style-type:none; } + #filter_tags li { -float:left; -margin-left:7px; -padding-left:7px; -border-left-width: 1px; -border-left-style:solid; + float:left; + margin-left:7px; + padding-left:7px; + border-left-width: 1px; + border-left-style:solid; } + #filter_tags #filter_tags_all, #filter_tags #filter_tags_for { margin-left: 10px; -border-left:0; -padding-left:0; + border-left:0; + padding-left:0; } + #filter_tags_all a, #filter_tags_for a { -font-weight:bold; + font-weight:bold; margin-top: 4px; -float:left; + float:left; } #filter_tags_for a { -margin:0; + margin:0; } #filter_tags #form_filter_bymode .form_guide { -display:none; + display:none; } #filter_tags #form_filter_bymode .checkbox { -float:none; + float:none; } #filter_tags #form_filter_bymode legend { -display:none; + display:none; } #filter_tags_item label { @@ -1905,25 +1959,27 @@ display:none; margin-left: 7px; padding-top: 4px; } + #filter_tags_item label, #filter_tags_item select { -float:left; + float:left; } #filter_tags_item p { -float:left; -clear:both; -margin-left:38px; + float:left; + clear:both; + margin-left:38px; } + #filter_tags_item .submit { -position:relative; -top:3px; -left:3px; + position:relative; + top:3px; + left:3px; } .profile .entity_profile { -margin-bottom:10px; -min-height:60px; + margin-bottom:10px; + min-height:60px; } .profile .form_group_join legend, @@ -1932,23 +1988,23 @@ min-height:60px; .profile .form_user_unsubscribe legend, .form_user_add_peopletag legend, .form_user_remove_peopletag legend { -display:none; + display:none; } .profile .entity_profile .p-name, .profile .entity_profile .u-url[rel~=contact] { -margin-left:0; -display:inline; + margin-left:0; + display:inline; } .profile .entity_profile .note, .profile .entity_profile .u-url, .profile .entity_profile .entity_tags, .profile .entity_profile .form_subscription_edit { -margin-left:55px; -clear:none; -display:block; -width:auto; + margin-left:55px; + clear:none; + display:block; + width:auto; } .profile_block .group_aliases .group_alias { @@ -1958,141 +2014,148 @@ width:auto; } .profile_block .entity_tags dt { -display: inline; -margin-right: 3px; -font-weight: bold; + display: inline; + margin-right: 3px; + font-weight: bold; } .profile_block .entity_tags dd { -display: inline; + display: inline; } .profile .entity_profile .form_subscription_edit { -clear:left; + clear:left; } .peopletag { -min-height: 90px; -list-style: none; + min-height: 90px; + list-style: none; } .peopletag .e-content { -width:auto; + width:auto; } .peopletag .tagged-count a:after, .peopletag .subscriber-count a:after, .entity_tags dt:after { -content: ':'; + content: ':'; } .peopletag .updated { -display:none; + display:none; } + .peopletag .tag a{ -font-weight: bold; + font-weight: bold; } .peopletag .tag:before { /* raquo */ -content: "\00BB"; + content: "\00BB"; } .peopletag .entity_statistics { -font-size:80%; + font-size:80%; } .profile-lister li { -min-height:30px; -padding:5px; -clear:both; -border-top: 1px #eee solid; + min-height:30px; + padding:5px; + clear:both; + border-top: 1px #eee solid; } .profile-lister { -list-style-type:none; + list-style-type:none; } .profile_search_wrap h3 { -float:left; -font-weight:normal; -margin-right:10px; + float:left; + font-weight:normal; + margin-right:10px; } .profile-lister li .u-photo { -display:inline; -margin-right:7px; -margin-bottom:-5px; + display:inline; + margin-right:7px; + margin-bottom:-5px; } .profile-lister li .p-name { -font-weight:bold; + font-weight:bold; } .profile-lister li .entity_actions { -margin:0; + margin:0; } #profile_search_results { -display:block; -border-radius:4px; -max-height:800px; -margin:10px 0; -padding: 5px; -border:1px #ddd solid; -background:#f1f1f1; + display:block; + border-radius:4px; + max-height:800px; + margin:10px 0; + padding: 5px; + border:1px #ddd solid; + background:#f1f1f1; } #profile_search_results.empty { -display: none; + display: none; } .form_peopletag_edit_user_search legend, .form_peopletag_edit_user_search label, .form_peopletag_edit_user_search .form_guide { -display:none; + display:none; } .form_peopletag_edit_user_search #field { -height:30px; + height:30px; } + .form_peopletag_edit_user_search .submit { -width:60px; + width:60px; } + .form_user_remove_peopletag, .form_user_add_peopletag { -float:right; + float:right; } + .form_user_add_peopletag input.submit, .form_user_remove_peopletag input.submit { -width:100px; -padding-left:25px; -text-align:left; + width:100px; + padding-left:25px; + text-align:left; } .profile .entity_profile .form_subscription_edit label { -font-weight:normal; -margin-right:11px; + font-weight:normal; + margin-right:11px; } .applications { -margin-bottom:18px; -float:left; -width:100%; + margin-bottom:18px; + float:left; + width:100%; } + .applications li { -list-style-type:none; + list-style-type:none; } + .application img, #showapplication .entity_profile img, .form_data #application_icon img, #apioauthauthorize .form_data img { -max-width:96px; -max-height:96px; + max-width:96px; + max-height:96px; } + #apioauthauthorize .form_data img { -margin-right:18px; -float:left; + margin-right:18px; + float:left; } .oauth-desktop-mode #wrap { @@ -2116,30 +2179,36 @@ float:left; } #showapplication .entity_profile { -width:68%; + width:68%; } + #showapplication .entity_profile .entity_fn { -margin-left:0; + margin-left:0; } + #showapplication .entity_profile .p-name:before, #showapplication .entity_profile .p-name:after { -content:''; + content:''; } + #showapplication .entity_data { -clear:both; -margin-bottom:18px; + clear:both; + margin-bottom:18px; } + #showapplication .entity_data h2 { -display:none; + display:none; } + #showapplication .entity_data dd { -font-family:monospace; -font-size:1.3em; + font-family:monospace; + font-size:1.3em; margin-bottom: 10px; } + .form_data #application_types label.radio, .form_data #default_access_types label.radio { -width:14.5%; + width:14.5%; } .mark-top { @@ -2169,9 +2238,11 @@ width:14.5%; #realtime_play { background-position: 0 -2308px; } + #realtime_pause { background-position: 0 -2374px; } + #realtime_popup { background-position: 0 -1714px; } @@ -2299,177 +2370,220 @@ button.minimize, #realtime_popup, .peopletags_edit_button, .mode-private .privacy_mode { -background-image:url(../images/icons/icons-01.gif); -background-repeat:no-repeat; -background-color:transparent; + background-image:url(../images/icons/icons-01.gif); + background-repeat:no-repeat; + background-color:transparent; } button.close { -background-position:0 -1120px; + background-position:0 -1120px; } + button.minimize { -background-position:0 -1912px; + background-position:0 -1912px; } + #export_data li a.rss { -background-position:0 -130px; + background-position:0 -130px; } + #export_data li a.atom { -background-position:0 -64px; + background-position:0 -64px; } + #export_data li a.foaf { -background-position:0 1px; + background-position:0 1px; } #export_data li a.json { -background-image:url(../images/icons/activitystreams.png); -background-repeat:no-repeat; -background-color:transparent; + background-image:url(../images/icons/activitystreams.png); + background-repeat:no-repeat; + background-color:transparent; } .form_group_queue #approve { -background-position:2px -2174px; + background-position:2px -2174px; } + .form_group_queue #cancel { -background-position:2px -2240px; + background-position:2px -2240px; } .form_group_leave input.submit, .form_user_unsubscribe input.submit, .form_user_remove_peopletag input.submit, .form_peopletag_unsubscribe input.submit { -background-position:5px -1246px; + background-position:5px -1246px; } + .form_group_join input.submit, .form_user_subscribe input.submit, .form_remote_authorize input.submit, .form_user_add_peopletag input.submit, .form_peopletag_subscribe input.submit, .entity_subscribe a { -background-position:5px -1181px; + background-position:5px -1181px; } + .peopletags_edit_button { -background-position: 0 -724px; + background-position: 0 -724px; } .entity_edit a { -background-position: 5px -719px; + background-position: 5px -719px; } .entity_send-a-message a { -background-position: 5px -852px; + background-position: 5px -852px; } + .entity_nudge p, .form_user_nudge input.submit { -background-position: 5px -785px; + background-position: 5px -785px; } + .form_user_block input.submit, .form_user_unblock input.submit, .form_group_block input.submit, .form_group_unblock input.submit { -background-position: 5px -918px; + background-position: 5px -918px; } + .form_make_admin input.submit { -background-position: 5px -983px; + background-position: 5px -983px; } + .entity_moderation p { -background-position: 5px -1313px; + background-position: 5px -1313px; } + .entity_sandbox input.submit { -background-position: 5px -1380px; + background-position: 5px -1380px; } + .entity_silence input.submit { -background-position: 5px -1445px; + background-position: 5px -1445px; } + .entity_delete input.submit { -background-position: 5px -1511px; + background-position: 5px -1511px; } + .entity_sandbox .form_user_unsandbox input.submit { -background-position: 5px -2568px; + background-position: 5px -2568px; } + .entity_silence .form_user_unsilence input.submit { -background-position: 5px -2633px; + background-position: 5px -2633px; } + .entity_role p { -background-position: 5px -2436px; + background-position: 5px -2436px; } + .entity_role_administrator .form_user_grantrole input.submit { -background-position: 5px -983px; + background-position: 5px -983px; } + .entity_role_moderator .form_user_grantrole input.submit { -background-position: 5px -1313px; + background-position: 5px -1313px; } + .entity_role_administrator .form_user_revokerole input.submit { -background-position: 5px -2699px; + background-position: 5px -2699px; } + .entity_role_moderator .form_user_revokerole input.submit { -background-position: 5px -2501px; + background-position: 5px -2501px; } + .form_reset_key input.submit { -background-position: 5px -1973px; + background-position: 5px -1973px; } + .entity_clear input.submit { -background-position: 5px -2039px; + background-position: 5px -2039px; } + .entity_flag input.submit, .entity_flag p { -background-position: 5px -2105px; + background-position: 5px -2105px; } + .entity_approval input.approve, .entity_subscribe input.accept { -background-position: 5px -2171px; + background-position: 5px -2171px; } + .entity_approval input.cancel, .entity_subscribe input.reject { -background-position: 5px -2237px; + background-position: 5px -2237px; } + #realtime_play { -background-position: 0 -2308px; + background-position: 0 -2308px; } + #realtime_pause { -background-position: 0 -2374px; + background-position: 0 -2374px; } + #realtime_popup { -background-position: 0 -1714px; + background-position: 0 -1714px; } + .notice .attachment { -background-position:0 -394px; + background-position:0 -394px; } + .notice .attachment.more { -background-position:0 -2770px; + background-position:0 -2770px; } + #attachments .attachment { -background:none; + background:none; } + .notice-options .notice_reply { -background-position:0 -592px; + background-position:0 -592px; } + .notice-options form.form_favor input.submit { -background-position:0 -460px; + background-position:0 -460px; } + .notice-options form.form_disfavor input.submit { -background-position:0 -526px; + background-position:0 -526px; } + .notice-options .notice_delete { -background-position:0 -658px; + background-position:0 -658px; } + .notice-options .form_repeat.processing { -background-image:none; + background-image:none; } + .notice-options form.form_repeat input.submit { -background-position:0 -1582px; + background-position:0 -1582px; } + .notice-options .repeated { -background-position:0 -1648px; + background-position:0 -1648px; } + #new_group a { -background-position:0 -1054px; + background-position:0 -1054px; } + .form_notice label.notice_data-attach { background-position: 0 -328px; } + .form_notice label.notice_data-geo { background-position: 0 -1780px; } + .form_notice label.notice_data-geo.checked { background-position: 0 -1846px; } @@ -2479,6 +2593,7 @@ background-position:0 -1054px; padding-left: 25px; background-position:0 -187px; } + #pagination .nav_next a { padding-top: 9px; padding-right: 25px; @@ -2486,49 +2601,51 @@ background-position:0 -1054px; } #usergroups #new_group { -float: left; -margin-right: 2em; + float: left; + margin-right: 2em; } + #new_group, #group_search { -margin-bottom:18px; + margin-bottom:18px; } + #new_group a { -padding-left:20px; + padding-left:20px; } - - .entity_tags li.mode-private { -color: #829D25; + color: #829D25; } + .mode-private .privacy_mode { -background-position: 0px -1978px; + background-position: 0px -1978px; } /* tag autocomplete */ .ptag-ac-line { -font-weight: normal; -background-color: white; -min-height:30px; + font-weight: normal; + background-color: white; + min-height:30px; } + .ptag-ac-line:nth-child(odd) { -background-color: #fafafa; + background-color: #fafafa; } .ptag-ac-line-tag { -min-width: 150px; -display: inline-block; + min-width: 150px; + display: inline-block; } .ptag-ac-line .freq { -min-width: 50px; -text-align: right; -float:right; + min-width: 50px; + text-align: right; + float:right; } .ptag-ac-line.mode-public .privacy_mode { -display:none; + display:none; } #site_nav_local_views li.extended_menu a { @@ -2558,15 +2675,17 @@ p { orphans: 2; widows: 1; } .notice-options, #aside_primary, .form_subscription_edit .submit { -display:none; + display:none; } + .timestamp dt, .timestamp dd, .device dt, .device dd { -display:inline; + display:inline; } + .profiles li, .notices li { -margin-bottom:18px; + margin-bottom:18px; } }/*end of @media print*/ From 1e4063254b639e28ddb4b5c9672034e70b0147e9 Mon Sep 17 00:00:00 2001 From: brunoccast Date: Wed, 5 Jun 2019 01:44:20 +0100 Subject: [PATCH 3/3] [OpenID] Added synchronization button and corresponding action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UI: - "Delete" area is now "Actions" area - Updated themes to better reflect the changes Routes: - index.php?action=finishsyncopenid => finishsyncopenid Translations: - Updated OpenID translation files - Updated OpenID POT file Versioning: - Bump OpenID minor version - Bump GS patch version Why would have labeling the Synchronize button of Sync been of bad taste? - answered by XRevan86: In "synchronise" "ch" is a digraph meaning /k/ (actually /x/ turned into /k/ in English but whatever). So… not separate letters. It's like "ph" in "alphabet", or "sh" in "sheep", or "ch" in "chop" -- "ch" can mean a whole variety of sounds. --- lib/framework.php | 2 +- plugins/OpenID/OpenIDPlugin.php | 4 +- plugins/OpenID/actions/finishsyncopenid.php | 166 ++++ plugins/OpenID/actions/openidsettings.php | 70 +- plugins/OpenID/locale/OpenID.pot | 788 +++++++++--------- .../OpenID/locale/en_GB/LC_MESSAGES/OpenID.po | 54 +- .../OpenID/locale/pt/LC_MESSAGES/OpenID.po | 50 +- .../OpenID/locale/pt_BR/LC_MESSAGES/OpenID.po | 50 +- .../OpenID/locale/ru/LC_MESSAGES/OpenID.po | 50 +- theme/base/css/display.css | 10 +- 10 files changed, 824 insertions(+), 420 deletions(-) create mode 100644 plugins/OpenID/actions/finishsyncopenid.php diff --git a/lib/framework.php b/lib/framework.php index a9a003270b..4824c5d5d4 100644 --- a/lib/framework.php +++ b/lib/framework.php @@ -22,7 +22,7 @@ if (!defined('GNUSOCIAL')) { exit(1); } define('GNUSOCIAL_ENGINE', 'GNU social'); define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/'); -define('GNUSOCIAL_BASE_VERSION', '1.19.2'); +define('GNUSOCIAL_BASE_VERSION', '1.19.3'); define('GNUSOCIAL_LIFECYCLE', 'rc0'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE); diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index b8211166e7..34ee1ecccb 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -50,7 +50,7 @@ if (!defined('STATUSNET')) { */ class OpenIDPlugin extends Plugin { - const PLUGIN_VERSION = '2.0.0'; + const PLUGIN_VERSION = '2.1.0'; // Plugin parameter: set true to disallow non-OpenID logins // If set, overrides the setting in database or $config['site']['openidonly'] @@ -83,6 +83,8 @@ class OpenIDPlugin extends Plugin array('action' => 'finishopenidlogin')); $m->connect('index.php?action=finishaddopenid', array('action' => 'finishaddopenid')); + $m->connect('index.php?action=finishsyncopenid', + array('action' => 'finishsyncopenid')); $m->connect('main/openidserver', array('action' => 'openidserver')); $m->connect('panel/openid', array('action' => 'openidadminpanel')); diff --git a/plugins/OpenID/actions/finishsyncopenid.php b/plugins/OpenID/actions/finishsyncopenid.php new file mode 100644 index 0000000000..293237af5d --- /dev/null +++ b/plugins/OpenID/actions/finishsyncopenid.php @@ -0,0 +1,166 @@ +. + +/** + * OpenID Sync completion + * + * @package GNUsocial + * @author Bruno Casteleiro + * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org + * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later + */ + +defined('GNUSOCIAL') || die(); + +require_once(INSTALLDIR . '/plugins/OpenID/openid.php'); + +/** + * Action that handles OpenID Sync completion. + * + * @copyright 2019 Free Software Foundation, Inc http://www.fsf.org + * @license https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later + */ +class FinishsyncopenidAction extends Action +{ + public $msg = null; + + /** + * Handle the redirect back from OpenID confirmation + * + * Check to see if the user's logged in, and then try + * to use the OpenID login system. + * + * @param array $args $_REQUEST arguments + * + * @return void + */ + public function handle() + { + parent::handle(); + if (!common_logged_in()) { + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. + $this->clientError(_m('Not logged in.')); + } else { + $this->tryLogin(); + } + } + + /** + * Try to log in using OpenID + * + * Check the OpenID for validity; potentially store it. + * + * @return void + */ + public function tryLogin() + { + $consumer = oid_consumer(); + + $response = $consumer->complete(common_local_url('finishsyncopenid')); + + 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.')); + return; + } elseif ($response->status == Auth_OpenID_FAILURE) { + // TRANS: OpenID authentication failed; display the error message. + // TRANS: %s is the error message. + $this->message(sprintf( + _m('OpenID authentication failed: %s.'), + $response->message + )); + } elseif ($response->status == Auth_OpenID_SUCCESS) { + $display = $response->getDisplayIdentifier(); + $canonical = ($response->endpoint && $response->endpoint->canonicalID) ? + $response->endpoint->canonicalID : $display; + + $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($response); + + if ($sreg_resp) { + $sreg = $sreg_resp->contents(); + } + + // Launchpad teams extension + if (!oid_check_teams($response)) { + // TRANS: OpenID authentication error. + $this->message(_m('OpenID authentication aborted: You are not allowed to login to this site.')); + return; + } + + $cur = common_current_user(); + + // start a transaction + + $cur->query('BEGIN'); + + if (Event::handle('StartOpenIDUpdateUser', [$cur, $canonical, &$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.')); + return; + } + } + Event::handle('EndOpenIDUpdateUser', [$cur, $canonical, $sreg]); + + // success! + + $cur->query('COMMIT'); + + oid_set_last($display); + + common_redirect(common_local_url('openidsettings'), 303); + } + } + + /** + * Show a failure message + * + * Something went wrong. Save the message, and show the page. + * + * @param string $msg Error message to show + * + * @return void + */ + public function message($msg) + { + $this->message = $msg; + $this->showPage(); + } + + /** + * Title of the page + * + * @return string title + */ + public function title() + { + // TRANS: Title after getting the status of the OpenID authorisation request. + // TODO update after understanding the function ^ + return _m('OpenID Synchronization'); + } + + /** + * Show error message + * + * @return void + */ + public function showPageNotice() + { + if ($this->message) { + $this->element('p', 'error', $this->message); + } + } +} diff --git a/plugins/OpenID/actions/openidsettings.php b/plugins/OpenID/actions/openidsettings.php index fd35e0f96f..9349ad91d8 100644 --- a/plugins/OpenID/actions/openidsettings.php +++ b/plugins/OpenID/actions/openidsettings.php @@ -108,8 +108,9 @@ class OpenidsettingsAction extends SettingsAction $this->elementEnd('li'); $this->elementStart('li'); // TRANS: Field label. - $this->checkbox('openid-sync', _m('Sync Account'), false, - _m('Syncronize GNU social profile with this OpenID identity.')); + $this->checkbox('openid-sync', _m('Synchronize Account'), false, + // TRANS: Form guide. + _m('Synchronize GNU social profile with this OpenID identity.')); $this->elementEnd('li'); $this->elementEnd('ul'); // TRANS: Button text for adding an OpenID URL. @@ -125,40 +126,55 @@ class OpenidsettingsAction extends SettingsAction if ($cnt > 0) { // TRANS: Header on OpenID settings page. - $this->element('h2', null, _m('HEADER', 'Remove OpenID')); - + $this->element('h2', null, _m('HEADER', 'OpenID Actions')); + if ($cnt == 1 && !$this->scoped->hasPassword()) { $this->element('p', 'form_guide', // TRANS: Form guide. - _m('Removing your only OpenID '. - 'would make it impossible to log in! ' . - 'If you need to remove it, '. - 'add another OpenID first.')); + _m('You can\'t remove your main OpenID account ' . + 'without either adding a password to your ' . + 'GNU social account or another OpenID account. ' . + 'You can synchronize your profile with your ' . + 'OpenID by clicking the button labeled "Synchronize".')); if ($oid->fetch()) { - $this->elementStart('p'); + $this->elementStart('form', ['method' => 'POST', + 'id' => 'form_settings_openid_actions' . $idx, + 'class' => 'form_settings', + 'action' => common_local_url('openidsettings')]); + $this->elementStart('fieldset'); + $this->hidden('token', common_session_token()); $this->element('a', ['href' => $oid->canonical], $oid->display); - $this->elementEnd('p'); + $this->hidden("openid_url", $oid->canonical); + // TRANS: Button text to sync OpenID with the GS profile. + $this->submit("sync", _m('BUTTON', 'Synchronize'), 'submit sync'); + $this->elementEnd('fieldset'); + $this->elementEnd('form'); } } else { $this->element('p', 'form_guide', // TRANS: Form guide. - _m('You can remove an OpenID from your account '. - 'by clicking the button marked "Remove".')); + _m('You can remove an OpenID from your account ' . + 'by clicking the button labeled "Remove". ' . + 'You can synchronize your profile with an OpenID ' . + 'by clicking the button labeled "Synchronize".')); $idx = 0; while ($oid->fetch()) { $this->elementStart('form', ['method' => 'POST', - 'id' => 'form_settings_openid_delete' . $idx, + 'id' => 'form_settings_openid_actions' . $idx, 'class' => 'form_settings', - 'action' => - common_local_url('openidsettings')]); + 'action' => common_local_url('openidsettings')]); $this->elementStart('fieldset'); $this->hidden('token', common_session_token()); $this->element('a', ['href' => $oid->canonical], $oid->display); $this->hidden("openid_url{$idx}", $oid->canonical, 'openid_url'); + $this->elementStart('span', ['class' => 'element_actions']); + // TRANS: Button text to sync an OpenID with the GS profile. + $this->submit("sync{$idx}", _m('BUTTON', 'Synchronize'), 'submit', 'sync'); // TRANS: Button text to remove an OpenID. - $this->submit("remove{$idx}", _m('BUTTON', 'Remove'), 'submit remove', 'remove'); + $this->submit("remove{$idx}", _m('BUTTON', 'Remove'), 'submit', 'remove'); + $this->elementEnd('span'); $this->elementEnd('fieldset'); $this->elementEnd('form'); $idx++; @@ -243,6 +259,8 @@ class OpenidsettingsAction extends SettingsAction } } elseif ($this->arg('remove')) { return $this->removeOpenid(); + } elseif ($this->arg('sync')) { + return $this->syncOpenid(); } elseif ($this->arg('remove_trustroots')) { return $this->removeTrustroots(); } elseif ($this->arg('save_prefs')) { @@ -305,6 +323,26 @@ class OpenidsettingsAction extends SettingsAction return _m('OpenID removed.'); } + /** + * Handles a request to sync an OpenID to the user's profile + * + * @return void + */ + public function syncOpenid() + { + $oid = User_openid::getKV('canonical', $this->trimmed('openid_url')); + + if (!$oid instanceof User_openid) { + throw new ClientException(_m('No such OpenID.')); + } + + $result = oid_authenticate($this->trimmed('openid_url'), 'finishsyncopenid'); + if (is_string($result)) { // error message + throw new ServerException($result); + } + return _m('Synchronized OpenID.'); + } + /** * Handles a request to save preferences * diff --git a/plugins/OpenID/locale/OpenID.pot b/plugins/OpenID/locale/OpenID.pot index 72a225b588..3a407a3bb5 100644 --- a/plugins/OpenID/locale/OpenID.pot +++ b/plugins/OpenID/locale/OpenID.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-06-08 18:20+0100\n" +"POT-Creation-Date: 2019-06-09 16:58+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,257 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#. TRANS: Client error message trying to log on with OpenID while already logged on. -#: actions/openidlogin.php:33 actions/finishopenidlogin.php:37 -msgid "Already logged in." -msgstr "" - -#. 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%%)". -#: actions/openidlogin.php:74 -#, php-format -msgid "" -"For security reasons, please re-login with your [OpenID](%%doc.openid%%) " -"before changing your settings." -msgstr "" - -#. TRANS: OpenID plugin message. -#. TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)". -#: actions/openidlogin.php:80 -#, php-format -msgid "Login with an [OpenID](%%doc.openid%%) account." -msgstr "" - -#. TRANS: OpenID plugin message. Title. -#: actions/openidlogin.php:114 -msgctxt "TITLE" -msgid "OpenID Login" -msgstr "" - -#. TRANS: OpenID plugin logon form legend. -#: actions/openidlogin.php:132 OpenIDPlugin.php:632 -msgctxt "LEGEND" -msgid "OpenID login" -msgstr "" - -#. TRANS: Field label. -#: actions/openidlogin.php:140 -msgctxt "LABEL" -msgid "OpenID provider" -msgstr "" - -#. TRANS: Form guide. -#: actions/openidlogin.php:149 OpenIDPlugin.php:649 -msgid "Enter your username." -msgstr "" - -#. TRANS: Form guide. -#: actions/openidlogin.php:151 OpenIDPlugin.php:651 -msgid "You will be sent to the provider's site for authentication." -msgstr "" - -#. TRANS: OpenID plugin logon form field label. -#. TRANS: Field label. -#. TRANS: OpenID plugin logon form field label. -#: actions/openidlogin.php:155 actions/openidsettings.php:101 -#: OpenIDPlugin.php:655 -msgid "OpenID URL" -msgstr "" - -#. TRANS: OpenID plugin logon form field title. -#. TRANS: OpenID plugin logon form field instructions. -#: actions/openidlogin.php:158 OpenIDPlugin.php:658 -msgid "Your OpenID URL." -msgstr "" - -#. TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie. -#: actions/openidlogin.php:163 -msgid "Remember me" -msgstr "" - -#. TRANS: OpenID plugin logon form field title. -#: actions/openidlogin.php:165 -msgid "Automatically login in the future; not for shared computers!" -msgstr "" - -#. TRANS: OpenID plugin logon form button label to start logon with the data provided in the logon form. -#: actions/openidlogin.php:170 -msgctxt "BUTTON" -msgid "Login" -msgstr "" - -#. TRANS: Title of OpenID settings page for a user. -#: actions/openidsettings.php:55 -msgctxt "TITLE" -msgid "OpenID settings" -msgstr "" - -#. TRANS: Form instructions for OpenID settings. -#. TRANS: This message contains Markdown links in the form [description](link). -#: actions/openidsettings.php:67 -#, php-format -msgid "" -"[OpenID](%%doc.openid%%) lets you log into many sites with the same user " -"account. Manage your associated OpenIDs from here." -msgstr "" - -#. TRANS: Fieldset legend. -#: actions/openidsettings.php:96 -msgctxt "LEGEND" -msgid "Add OpenID" -msgstr "" - -#. TRANS: Form guide. -#: actions/openidsettings.php:103 -msgid "An OpenID URL which identifies you." -msgstr "" - -#. TRANS: Button text for adding an OpenID URL. -#: actions/openidsettings.php:108 -msgctxt "BUTTON" -msgid "Add" -msgstr "" - -#. TRANS: Header on OpenID settings page. -#: actions/openidsettings.php:120 -msgctxt "HEADER" -msgid "Remove OpenID" -msgstr "" - -#. TRANS: Form guide. -#: actions/openidsettings.php:126 -msgid "" -"Removing your only OpenID would make it impossible to log in! If you need to " -"remove it, add another OpenID first." -msgstr "" - -#. TRANS: Form guide. -#: actions/openidsettings.php:142 -msgid "" -"You can remove an OpenID from your account by clicking the button marked " -"\"Remove\"." -msgstr "" - -#. TRANS: Button text to remove an OpenID. -#. TRANS: Button text to remove an OpenID trustroot. -#: actions/openidsettings.php:159 actions/openidsettings.php:199 -msgctxt "BUTTON" -msgid "Remove" -msgstr "" - -#. TRANS: Fieldset legend. -#: actions/openidsettings.php:174 -msgid "OpenID Trusted Sites" -msgstr "" - -#. TRANS: Form guide. -#: actions/openidsettings.php:178 -msgid "" -"The following sites are allowed to access your identity and log you in. You " -"can remove a site from this list to deny it access to your OpenID." -msgstr "" - -#: actions/openidsettings.php:205 -msgctxt "LEGEND" -msgid "Preferences" -msgstr "" - -#. TRANS: Button text to save OpenID prefs -#. TRANS: Button text to save OpenID settings. -#: actions/openidsettings.php:209 actions/openidadminpanel.php:284 -msgctxt "BUTTON" -msgid "Save" -msgstr "" - -#. TRANS: Form validation error if no OpenID providers can be added. -#: actions/openidsettings.php:228 -msgid "Cannot add new providers." -msgstr "" - -#. TRANS: Unexpected form validation error. -#: actions/openidsettings.php:245 -msgid "No known action for POST." -msgstr "" - -#. TRANS: Form validation error when trying to remove a non-existing trustroot. -#: actions/openidsettings.php:266 -msgid "No such OpenID trustroot." -msgstr "" - -#. TRANS: Success message after removing trustroots. -#: actions/openidsettings.php:271 -msgid "Trustroots removed." -msgstr "" - -#. TRANS: Form validation error for a non-existing OpenID. -#: actions/openidsettings.php:288 -msgid "No such OpenID." -msgstr "" - -#. TRANS: Form validation error if OpenID is connected to another user. -#: actions/openidsettings.php:292 -msgid "That OpenID does not belong to you." -msgstr "" - -#. TRANS: Success message after removing an OpenID. -#: actions/openidsettings.php:296 -msgid "OpenID removed." -msgstr "" - -#: actions/openidsettings.php:328 -msgid "OpenID preferences saved." -msgstr "" - -#. TRANS: Error message displayed when trying to perform an action that requires a logged in user. -#: actions/finishaddopenid.php:66 -msgid "Not logged in." -msgstr "" - -#. TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled. -#: actions/finishaddopenid.php:87 actions/finishopenidlogin.php:243 -msgid "OpenID authentication cancelled." -msgstr "" - -#. TRANS: OpenID authentication failed; display the error message. -#. TRANS: %s is the error message. -#. TRANS: OpenID authentication failed; display the error message. %s is the error message. -#: actions/finishaddopenid.php:92 actions/finishopenidlogin.php:247 -#, php-format -msgid "OpenID authentication failed: %s." -msgstr "" - -#. TRANS: OpenID authentication error. -#. TRANS: Message displayed when OpenID authentication is aborted. -#: actions/finishaddopenid.php:109 actions/finishopenidlogin.php:268 -msgid "" -"OpenID authentication aborted: You are not allowed to login to this site." -msgstr "" - -#. TRANS: Message in case a user tries to add an OpenID that is already connected to them. -#: actions/finishaddopenid.php:120 -msgid "You already have this OpenID!" -msgstr "" - -#. TRANS: Message in case a user tries to add an OpenID that is already used by another user. -#: actions/finishaddopenid.php:123 -msgid "Someone else already has this OpenID." -msgstr "" - -#. TRANS: Message in case the OpenID object cannot be connected to the user. -#: actions/finishaddopenid.php:136 -msgid "Error connecting user." -msgstr "" - -#. TRANS: Message in case the user or the user profile cannot be saved in StatusNet. -#: actions/finishaddopenid.php:143 -msgid "Error updating profile." -msgstr "" - -#. TRANS: Title after getting the status of the OpenID authorisation request. -#: actions/finishaddopenid.php:183 -msgid "OpenID Login" -msgstr "" - #. TRANS: Title for identity verification page. #: actions/openidtrust.php:51 msgid "OpenID Identity Verification" @@ -289,7 +38,7 @@ msgstr "" #. TRANS: Button text to continue OpenID identity verification. #. TRANS: button label for OAuth authorization page when needing OpenID authentication first. -#: actions/openidtrust.php:136 OpenIDPlugin.php:615 +#: actions/openidtrust.php:136 OpenIDPlugin.php:617 msgctxt "BUTTON" msgid "Continue" msgstr "" @@ -300,6 +49,44 @@ msgctxt "BUTTON" msgid "Cancel" msgstr "" +#. TRANS: Error message displayed when trying to perform an action that requires a logged in user. +#: actions/finishsyncopenid.php:55 actions/finishaddopenid.php:66 +msgid "Not logged in." +msgstr "" + +#. TRANS: Status message in case the response from the OpenID provider is that the logon attempt was cancelled. +#: actions/finishsyncopenid.php:76 actions/finishopenidlogin.php:254 +#: actions/finishaddopenid.php:87 +msgid "OpenID authentication cancelled." +msgstr "" + +#. TRANS: OpenID authentication failed; display the error message. %s is the error message. +#: actions/finishsyncopenid.php:82 actions/finishopenidlogin.php:258 +#: actions/finishaddopenid.php:93 +#, php-format +msgid "OpenID authentication failed: %s." +msgstr "" + +#. TRANS: OpenID authentication error. +#. TRANS: Message displayed when OpenID authentication is aborted. +#. TRANS: OpenID authentication error. +#: actions/finishsyncopenid.php:99 actions/finishopenidlogin.php:279 +#: actions/finishaddopenid.php:110 +msgid "" +"OpenID authentication aborted: You are not allowed to login to this site." +msgstr "" + +#. TRANS: Message in case the user or the user profile cannot be saved in StatusNet. +#: actions/finishsyncopenid.php:112 actions/finishaddopenid.php:145 +msgid "Error updating profile." +msgstr "" + +#. TRANS: Title after getting the status of the OpenID authorisation request. +#. TODO update after understanding the function ^ +#: actions/finishsyncopenid.php:152 +msgid "OpenID Synchronization" +msgstr "" + #. TRANS: OpenID plugin client error given trying to add an unauthorised OpenID to a user (403). #. TRANS: %s is a request identity. #: actions/openidserver.php:113 @@ -312,6 +99,153 @@ msgstr "" msgid "Just an OpenID provider. Nothing to see here, move along..." msgstr "" +#. TRANS: Client error message trying to log on with OpenID while already logged on. +#: actions/finishopenidlogin.php:37 actions/openidlogin.php:33 +msgid "Already logged in." +msgstr "" + +#. TRANS: Message given when there is a problem with the user's session token. +#: actions/finishopenidlogin.php:42 +msgid "There was a problem with your session token. Try again, please." +msgstr "" + +#: actions/finishopenidlogin.php:49 +msgid "You cannot register if you do not agree to the license." +msgstr "" + +#: actions/finishopenidlogin.php:60 +msgid "An unknown error has occured." +msgstr "" + +#. TRANS: Instructions given after a first successful logon using OpenID. +#. TRANS: %s is the site name. +#: actions/finishopenidlogin.php:77 +#, php-format +msgid "" +"This is the first time you have 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." +msgstr "" + +#. TRANS: Title +#: actions/finishopenidlogin.php:84 +msgctxt "TITLE" +msgid "OpenID Account Setup" +msgstr "" + +#. TRANS: Fieldset legend. +#: actions/finishopenidlogin.php:122 +msgid "Create new account" +msgstr "" + +#. TRANS: Form guide. +#: actions/finishopenidlogin.php:125 +msgid "Create a new user with this nickname." +msgstr "" + +#: actions/finishopenidlogin.php:134 +msgid "New nickname" +msgstr "" + +#. TRANS: Field title. +#: actions/finishopenidlogin.php:137 +msgid "1-64 lowercase letters or numbers, no punctuation or spaces." +msgstr "" + +#. TRANS: Field label. +#: actions/finishopenidlogin.php:141 +msgid "Email" +msgstr "" + +#. TRANS: Field title. +#: actions/finishopenidlogin.php:144 +msgid "Used only for updates, announcements, and password recovery." +msgstr "" + +#. TRANS: OpenID plugin link text. +#. TRANS: %s is a link to a license with the license name as link text. +#: actions/finishopenidlogin.php:161 +#, php-format +msgid "" +"My text and files are available under %s except this private data: password, " +"email address, IM address, and phone number." +msgstr "" + +#. TRANS: Button label in form in which to create a new user on the site for an OpenID. +#: actions/finishopenidlogin.php:174 +msgctxt "BUTTON" +msgid "Create" +msgstr "" + +#. TRANS: Used as form legend for form in which to connect an OpenID to an existing user on the site. +#: actions/finishopenidlogin.php:188 +msgid "Connect existing account" +msgstr "" + +#. TRANS: User instructions for form in which to connect an OpenID to an existing user on the site. +#: actions/finishopenidlogin.php:191 +msgid "" +"If you already have an account, login with your username and password to " +"connect it to your OpenID." +msgstr "" + +#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site. +#: actions/finishopenidlogin.php:195 +msgid "Existing nickname" +msgstr "" + +#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site. +#: actions/finishopenidlogin.php:199 +msgid "Password" +msgstr "" + +#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site. +#: actions/finishopenidlogin.php:203 +msgid "Sync Account" +msgstr "" + +#: actions/finishopenidlogin.php:204 +msgid "Syncronize GNU social profile with this OpenID identity." +msgstr "" + +#. TRANS: Button text in form in which to connect an OpenID to an existing user on the site. +#: actions/finishopenidlogin.php:208 +msgctxt "BUTTON" +msgid "Connect" +msgstr "" + +#. TRANS: OpenID plugin message. No new user registration is allowed on the site. +#. TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and none was provided. +#: actions/finishopenidlogin.php:335 actions/finishopenidlogin.php:344 +msgid "Registration not allowed." +msgstr "" + +#. TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid. +#: actions/finishopenidlogin.php:351 +msgid "Not a valid invitation code." +msgstr "" + +#. TRANS: OpenID plugin server error. A stored OpenID cannot be retrieved. +#. TRANS: OpenID plugin server error. A stored OpenID cannot be found. +#: actions/finishopenidlogin.php:366 actions/finishopenidlogin.php:450 +msgid "Stored OpenID not found." +msgstr "" + +#. TRANS: OpenID plugin server error. +#: actions/finishopenidlogin.php:375 +msgid "Creating new account for OpenID that already has a user." +msgstr "" + +#. TRANS: OpenID plugin message. +#: actions/finishopenidlogin.php:438 +msgid "Invalid username or password." +msgstr "" + +#. TRANS: OpenID plugin server error. The user or user profile could not be saved. +#: actions/finishopenidlogin.php:457 +msgid "Error connecting user to OpenID." +msgstr "" + #. TRANS: Title for OpenID bridge administration page. #: actions/openidadminpanel.php:53 msgctxt "TITLE" @@ -399,184 +333,286 @@ msgid "" "authentication for all users!" msgstr "" +#. TRANS: Button text to save OpenID settings. +#. TRANS: Button text to save OpenID prefs +#: actions/openidadminpanel.php:284 actions/openidsettings.php:229 +msgctxt "BUTTON" +msgid "Save" +msgstr "" + #. TRANS: Button title to save OpenID settings. #: actions/openidadminpanel.php:286 msgid "Save OpenID settings." msgstr "" -#. TRANS: Message given when there is a problem with the user's session token. -#: actions/finishopenidlogin.php:42 -msgid "There was a problem with your session token. Try again, please." +#. TRANS: Title of OpenID settings page for a user. +#: actions/openidsettings.php:57 +msgctxt "TITLE" +msgid "OpenID settings" msgstr "" -#. TRANS: Message given if user does not agree with the site's license. -#: actions/finishopenidlogin.php:48 -msgid "You cannot register if you do not agree to the license." -msgstr "" - -#. TRANS: Messag given on an unknown error. -#: actions/finishopenidlogin.php:57 -msgid "An unknown error has occured." -msgstr "" - -#. TRANS: Instructions given after a first successful logon using OpenID. -#. TRANS: %s is the site name. -#: actions/finishopenidlogin.php:73 +#. TRANS: Form instructions for OpenID settings. +#. TRANS: This message contains Markdown links in the form [description](link). +#: actions/openidsettings.php:69 #, php-format msgid "" -"This is the first time you have 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." -msgstr "" - -#. TRANS: Title -#: actions/finishopenidlogin.php:80 -msgctxt "TITLE" -msgid "OpenID Account Setup" +"[OpenID](%%doc.openid%%) lets you log into many sites with the same user " +"account. Manage your associated OpenIDs from here." msgstr "" #. TRANS: Fieldset legend. -#: actions/finishopenidlogin.php:118 -msgid "Create new account" +#: actions/openidsettings.php:98 +msgctxt "LEGEND" +msgid "Add OpenID" +msgstr "" + +#. TRANS: Field label. +#. TRANS: OpenID plugin logon form field label. +#: actions/openidsettings.php:103 actions/openidlogin.php:155 +#: OpenIDPlugin.php:657 +msgid "OpenID URL" msgstr "" #. TRANS: Form guide. -#: actions/finishopenidlogin.php:121 -msgid "Create a new user with this nickname." +#: actions/openidsettings.php:105 +msgid "An OpenID URL which identifies you." msgstr "" #. TRANS: Field label. -#: actions/finishopenidlogin.php:129 -msgid "New nickname" +#: actions/openidsettings.php:111 +msgid "Synchronize Account" msgstr "" -#. TRANS: Field title. -#: actions/finishopenidlogin.php:132 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces." +#. TRANS: Form guide. +#: actions/openidsettings.php:113 +msgid "Synchronize GNU social profile with this OpenID identity." msgstr "" -#. TRANS: Field label. -#: actions/finishopenidlogin.php:136 -msgid "Email" +#. TRANS: Button text for adding an OpenID URL. +#: actions/openidsettings.php:117 +msgctxt "BUTTON" +msgid "Add" msgstr "" -#. TRANS: Field title. -#: actions/finishopenidlogin.php:138 -msgid "Used only for updates, announcements, and password recovery." +#. TRANS: Header on OpenID settings page. +#: actions/openidsettings.php:129 +msgctxt "HEADER" +msgid "OpenID Actions" msgstr "" -#. TRANS: OpenID plugin link text. -#. TRANS: %s is a link to a license with the license name as link text. -#: actions/finishopenidlogin.php:155 +#. TRANS: Form guide. +#: actions/openidsettings.php:134 +msgid "" +"You can't remove your main OpenID account without either adding a password " +"to your GNU social account or another OpenID account. You can synchronize " +"your profile with your OpenID by clicking the button labeled \"Synchronize\"." +msgstr "" + +#. TRANS: Button text to sync OpenID with the GS profile. +#. TRANS: Button text to sync an OpenID with the GS profile. +#: actions/openidsettings.php:150 actions/openidsettings.php:174 +msgctxt "BUTTON" +msgid "Synchronize" +msgstr "" + +#. TRANS: Form guide. +#: actions/openidsettings.php:157 +msgid "" +"You can remove an OpenID from your account by clicking the button labeled " +"\"Remove\". You can synchronize your profile with an OpenID by clicking the " +"button labeled \"Synchronize\"." +msgstr "" + +#. TRANS: Button text to remove an OpenID. +#. TRANS: Button text to remove an OpenID trustroot. +#: actions/openidsettings.php:176 actions/openidsettings.php:219 +msgctxt "BUTTON" +msgid "Remove" +msgstr "" + +#. TRANS: Fieldset legend. +#: actions/openidsettings.php:192 +msgid "OpenID Trusted Sites" +msgstr "" + +#. TRANS: Form guide. +#: actions/openidsettings.php:196 +msgid "" +"The following sites are allowed to access your identity and log you in. You " +"can remove a site from this list to deny it access to your OpenID." +msgstr "" + +#: actions/openidsettings.php:225 +msgctxt "LEGEND" +msgid "Preferences" +msgstr "" + +#. TRANS: Form validation error if no OpenID providers can be added. +#: actions/openidsettings.php:248 +msgid "Cannot add new providers." +msgstr "" + +#. TRANS: Unexpected form validation error. +#: actions/openidsettings.php:271 +msgid "No known action for POST." +msgstr "" + +#. TRANS: Form validation error when trying to remove a non-existing trustroot. +#: actions/openidsettings.php:293 +msgid "No such OpenID trustroot." +msgstr "" + +#. TRANS: Success message after removing trustroots. +#: actions/openidsettings.php:298 +msgid "Trustroots removed." +msgstr "" + +#. TRANS: Form validation error for a non-existing OpenID. +#: actions/openidsettings.php:315 actions/openidsettings.php:336 +msgid "No such OpenID." +msgstr "" + +#. TRANS: Form validation error if OpenID is connected to another user. +#: actions/openidsettings.php:319 +msgid "That OpenID does not belong to you." +msgstr "" + +#. TRANS: Success message after removing an OpenID. +#: actions/openidsettings.php:323 +msgid "OpenID removed." +msgstr "" + +#: actions/openidsettings.php:343 +msgid "Synchronized OpenID." +msgstr "" + +#: actions/openidsettings.php:375 +msgid "OpenID preferences saved." +msgstr "" + +#. 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%%)". +#: actions/openidlogin.php:74 #, php-format msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" - -#. TRANS: Button label in form in which to create a new user on the site for an OpenID. -#: actions/finishopenidlogin.php:168 -msgctxt "BUTTON" -msgid "Create" -msgstr "" - -#. TRANS: Used as form legend for form in which to connect an OpenID to an existing user on the site. -#: actions/finishopenidlogin.php:182 -msgid "Connect existing account" -msgstr "" - -#. TRANS: User instructions for form in which to connect an OpenID to an existing user on the site. -#: actions/finishopenidlogin.php:185 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your OpenID." -msgstr "" - -#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site. -#: actions/finishopenidlogin.php:189 -msgid "Existing nickname" -msgstr "" - -#. TRANS: Field label in form in which to connect an OpenID to an existing user on the site. -#: actions/finishopenidlogin.php:193 -msgid "Password" -msgstr "" - -#. TRANS: Button text in form in which to connect an OpenID to an existing user on the site. -#: actions/finishopenidlogin.php:197 -msgctxt "BUTTON" -msgid "Connect" -msgstr "" - -#. TRANS: OpenID plugin message. No new user registration is allowed on the site. -#. TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and none was provided. -#: actions/finishopenidlogin.php:324 actions/finishopenidlogin.php:333 -msgid "Registration not allowed." -msgstr "" - -#. TRANS: OpenID plugin message. No new user registration is allowed on the site without an invitation code, and the one provided was not valid. -#: actions/finishopenidlogin.php:340 -msgid "Not a valid invitation code." -msgstr "" - -#. TRANS: OpenID plugin server error. A stored OpenID cannot be retrieved. -#. TRANS: OpenID plugin server error. A stored OpenID cannot be found. -#: actions/finishopenidlogin.php:355 actions/finishopenidlogin.php:438 -msgid "Stored OpenID not found." -msgstr "" - -#. TRANS: OpenID plugin server error. -#: actions/finishopenidlogin.php:364 -msgid "Creating new account for OpenID that already has a user." +"For security reasons, please re-login with your [OpenID](%%doc.openid%%) " +"before changing your settings." msgstr "" #. TRANS: OpenID plugin message. -#: actions/finishopenidlogin.php:426 -msgid "Invalid username or password." +#. TRANS: "OpenID" is the display text for a link with URL "(%%doc.openid%%)". +#: actions/openidlogin.php:80 +#, php-format +msgid "Login with an [OpenID](%%doc.openid%%) account." msgstr "" -#. TRANS: OpenID plugin server error. The user or user profile could not be saved. -#: actions/finishopenidlogin.php:445 -msgid "Error connecting user to OpenID." +#. TRANS: OpenID plugin message. Title. +#: actions/openidlogin.php:114 +msgctxt "TITLE" +msgid "OpenID Login" +msgstr "" + +#. TRANS: OpenID plugin logon form legend. +#: actions/openidlogin.php:132 OpenIDPlugin.php:634 +msgctxt "LEGEND" +msgid "OpenID login" +msgstr "" + +#. TRANS: Field label. +#: actions/openidlogin.php:140 +msgctxt "LABEL" +msgid "OpenID provider" +msgstr "" + +#. TRANS: Form guide. +#: actions/openidlogin.php:149 OpenIDPlugin.php:651 +msgid "Enter your username." +msgstr "" + +#. TRANS: Form guide. +#: actions/openidlogin.php:151 OpenIDPlugin.php:653 +msgid "You will be sent to the provider's site for authentication." +msgstr "" + +#. TRANS: OpenID plugin logon form field title. +#. TRANS: OpenID plugin logon form field instructions. +#: actions/openidlogin.php:158 OpenIDPlugin.php:660 +msgid "Your OpenID URL." +msgstr "" + +#. TRANS: OpenID plugin logon form checkbox label for setting to put the OpenID information in a cookie. +#: actions/openidlogin.php:163 +msgid "Remember me" +msgstr "" + +#. TRANS: OpenID plugin logon form field title. +#: actions/openidlogin.php:165 +msgid "Automatically login in the future; not for shared computers!" +msgstr "" + +#. TRANS: OpenID plugin logon form button label to start logon with the data provided in the logon form. +#: actions/openidlogin.php:170 +msgctxt "BUTTON" +msgid "Login" +msgstr "" + +#. TRANS: Message in case a user tries to add an OpenID that is already connected to them. +#: actions/finishaddopenid.php:121 +msgid "You already have this OpenID!" +msgstr "" + +#. TRANS: Message in case a user tries to add an OpenID that is already used by another user. +#: actions/finishaddopenid.php:124 +msgid "Someone else already has this OpenID." +msgstr "" + +#. TRANS: Message in case the OpenID object cannot be connected to the user. +#: actions/finishaddopenid.php:137 +msgid "Error connecting user." +msgstr "" + +#. TRANS: Title after getting the status of the OpenID authorisation request. +#: actions/finishaddopenid.php:187 +msgid "OpenID Login" msgstr "" #. TRANS: Client exception thrown when an action is not available. -#: OpenIDPlugin.php:141 +#: OpenIDPlugin.php:143 msgid "Unavailable action." msgstr "" #. TRANS: Tooltip for main menu option "Login" -#: OpenIDPlugin.php:190 +#: OpenIDPlugin.php:192 msgctxt "TOOLTIP" msgid "Login to the site." msgstr "" #. TRANS: Main menu option when not logged in to log in -#: OpenIDPlugin.php:193 +#: OpenIDPlugin.php:195 msgctxt "MENU" msgid "Login" msgstr "" #. TRANS: Tooltip for main menu option "Help" -#: OpenIDPlugin.php:198 +#: OpenIDPlugin.php:200 msgctxt "TOOLTIP" msgid "Help me!" msgstr "" #. TRANS: Main menu option for help on the StatusNet site -#: OpenIDPlugin.php:201 +#: OpenIDPlugin.php:203 msgctxt "MENU" msgid "Help" msgstr "" #. TRANS: Tooltip for main menu option "Search" -#: OpenIDPlugin.php:207 +#: OpenIDPlugin.php:209 msgctxt "TOOLTIP" msgid "Search for people or text." msgstr "" #. TRANS: Main menu option when logged in or when the StatusNet instance is not private -#: OpenIDPlugin.php:210 +#: OpenIDPlugin.php:212 msgctxt "MENU" msgid "Search" msgstr "" @@ -584,25 +620,25 @@ msgstr "" #. TRANS: OpenID plugin menu item on site logon page. #. TRANS: OpenID plugin menu item on user settings page. #. TRANS: OpenID configuration menu item. -#: OpenIDPlugin.php:267 OpenIDPlugin.php:303 OpenIDPlugin.php:477 -#: OpenIDPlugin.php:557 +#: OpenIDPlugin.php:269 OpenIDPlugin.php:305 OpenIDPlugin.php:479 +#: OpenIDPlugin.php:559 msgctxt "MENU" msgid "OpenID" msgstr "" #. TRANS: OpenID plugin tooltip for logon menu item. -#: OpenIDPlugin.php:269 +#: OpenIDPlugin.php:271 msgid "Login or register with OpenID." msgstr "" #. TRANS: OpenID plugin tooltip for user settings menu item. -#: OpenIDPlugin.php:305 +#: OpenIDPlugin.php:307 msgid "Add or remove OpenIDs." msgstr "" #. TRANS: Page notice for logged in users to try and get them to add an OpenID account to their StatusNet account. #. TRANS: This message contains Markdown links in the form (description)[link]. -#: OpenIDPlugin.php:419 +#: OpenIDPlugin.php:421 #, php-format msgid "" "(Have an [OpenID](http://openid.net/)? [Add an OpenID to your account]" @@ -611,7 +647,7 @@ msgstr "" #. TRANS: Page notice for anonymous users to try and get them to register with an OpenID account. #. TRANS: This message contains Markdown links in the form (description)[link]. -#: OpenIDPlugin.php:424 +#: OpenIDPlugin.php:426 #, php-format msgid "" "(Have an [OpenID](http://openid.net/)? Try our [OpenID registration]" @@ -620,7 +656,7 @@ msgstr "" #. TRANS: Page notice on the login page to try and get them to log on with an OpenID account. #. TRANS: This message contains Markdown links in the form (description)[link]. -#: OpenIDPlugin.php:432 +#: OpenIDPlugin.php:434 #, php-format msgid "" "(Have an [OpenID](http://openid.net/)? Try our [OpenID login](%%action." @@ -628,17 +664,17 @@ msgid "" msgstr "" #. TRANS: Tooltip for OpenID configuration menu item. -#: OpenIDPlugin.php:559 +#: OpenIDPlugin.php:561 msgid "OpenID configuration." msgstr "" #. TRANS: Plugin description. -#: OpenIDPlugin.php:605 +#: OpenIDPlugin.php:607 msgid "Use OpenID to login to the site." msgstr "" #. TRANS: Field label. -#: OpenIDPlugin.php:640 +#: OpenIDPlugin.php:642 msgid "OpenID provider" msgstr "" diff --git a/plugins/OpenID/locale/en_GB/LC_MESSAGES/OpenID.po b/plugins/OpenID/locale/en_GB/LC_MESSAGES/OpenID.po index 35a4976338..ea2a829f98 100644 --- a/plugins/OpenID/locale/en_GB/LC_MESSAGES/OpenID.po +++ b/plugins/OpenID/locale/en_GB/LC_MESSAGES/OpenID.po @@ -4,13 +4,14 @@ # # Translators: # Luke Hollins , 2015 +# Bruno Casteleiro , 2019 msgid "" msgstr "" "Project-Id-Version: GNU social\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-02-02 17:47+0100\n" "PO-Revision-Date: 2015-03-09 11:46+0000\n" -"Last-Translator: Luke Hollins \n" +"Last-Translator: Bruno Casteleiro \n" "Language-Team: English (United Kingdom) (http://www.transifex.com/gnu-social/gnu-social/language/en_GB/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -198,28 +199,30 @@ msgid "Add" msgstr "Add" #. TRANS: Header on OpenID settings page. -#: actions/openidsettings.php:133 +#: actions/openidsettings.php:129 msgctxt "HEADER" -msgid "Remove OpenID" -msgstr "Remove OpenID" +msgid "OpenID Actions" +msgstr "OpenID Actions" #. TRANS: Form guide. -#: actions/openidsettings.php:139 +#: actions/openidsettings.php:134 msgid "" -"Removing your only OpenID would make it impossible to log in! If you need to" -" remove it, add another OpenID first." -msgstr "Removing your only OpenID would make it impossible to log in! If you need to remove it, add another OpenID first." +"You can't remove your main OpenID account without either adding a password " +"to your GNU social account or another OpenID account. You can synchronize " +"your profile with your OpenID by clicking the button labeled \"Synchronize\"." +msgstr "You can't remove your main OpenID account without either adding a password to your GNU social account or another OpenID account. You can synchronize your profile with your OpenID by clicking the button labeled \"Synchronize\"." #. TRANS: Form guide. -#: actions/openidsettings.php:155 +#: actions/openidsettings.php:157 msgid "" -"You can remove an OpenID from your account by clicking the button marked " -"\"Remove\"." -msgstr "You can remove an OpenID from your account by clicking the button marked \"Remove\"." +"You can remove an OpenID from your account by clicking the button labeled " +"\"Remove\". You can synchronize your profile with an OpenID by clicking " +"the button labeled \"Synchronize\"." +msgstr "You can remove an OpenID from your account by clicking the button labeled \"Remove\". You can synchronize your profile with an OpenID by clicking the button labeled \"Synchronize\"." #. TRANS: Button text to remove an OpenID. #. TRANS: Button text to remove an OpenID trustroot. -#: actions/openidsettings.php:179 actions/openidsettings.php:223 +#: actions/openidsettings.php:177 actions/openidsettings.php:223 msgctxt "BUTTON" msgid "Remove" msgstr "Remove" @@ -744,3 +747,28 @@ msgstr "Use OpenID to login to the site." #: OpenIDPlugin.php:687 msgid "OpenID provider" msgstr "OpenID provider" + +#. TRANS: Field label. +#: actions/openidsettings.php:111 +msgid "Synchronize Account" +msgstr "Synchronize Account" + +#. TRANS: Form guide +#: actions/openidsettings.php:113 +msgid "Synchronize GNU social profile with this OpenID identity." +msgstr "Synchronize GNU social profile with this OpenID identity." + +#. TRANS: Button text to sync OpenID with the GS profile. +#: actions/openidsettings.php:150 actions/openidsettings.php:174 +msgctxt "BUTTON" +msgid "Synchronize" +msgstr "Synchronize" + +#: actions/openidsettings.php:343 +msgid "Synchronized OpenID." +msgstr "Synchronized OpenID." + +#. TRANS: Title +#: actions/finishsyncopenid:152 +msgid "OpenID Synchronization" +msgstr "OpenID Synchronization" \ No newline at end of file diff --git a/plugins/OpenID/locale/pt/LC_MESSAGES/OpenID.po b/plugins/OpenID/locale/pt/LC_MESSAGES/OpenID.po index af12000fc2..c00f0a4ebd 100644 --- a/plugins/OpenID/locale/pt/LC_MESSAGES/OpenID.po +++ b/plugins/OpenID/locale/pt/LC_MESSAGES/OpenID.po @@ -3,13 +3,14 @@ # This file is under https://www.gnu.org/licenses/agpl v3 or later # # Translators: +# Bruno Casteleiro , 2019 msgid "" msgstr "" "Project-Id-Version: GNU social\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-02-02 17:47+0100\n" "PO-Revision-Date: 2015-02-05 16:23+0000\n" -"Last-Translator: FULL NAME \n" +"Last-Translator: Bruno Casteleiro \n" "Language-Team: Portuguese (http://www.transifex.com/gnu-social/gnu-social/language/pt/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -197,10 +198,10 @@ msgid "Add" msgstr "Adicionar" #. TRANS: Header on OpenID settings page. -#: actions/openidsettings.php:133 +#: actions/openidsettings.php:129 msgctxt "HEADER" -msgid "Remove OpenID" -msgstr "" +msgid "OpenID Actions" +msgstr "Opções OpenID" #. TRANS: Form guide. #: actions/openidsettings.php:139 @@ -743,3 +744,44 @@ msgstr "" #: OpenIDPlugin.php:687 msgid "OpenID provider" msgstr "" + +#. TRANS: Field label. +#: actions/openidsettings.php:111 +msgid "Synchronize Account" +msgstr "Sincronizar Conta" + +#. TRANS: Form guide. +#: actions/openidsettings.php:113 +msgid "Synchronize GNU social profile with this OpenID identity." +msgstr "Sincronizar perfil do GNU social com esta identidade OpenID." + +#. TRANS: Form guide. +#: actions/openidsettings.php:134 +msgid "" +"You can't remove your main OpenID account without either adding a password " +"to your GNU social account or another OpenID account. You can synchronize " +"your profile with your OpenID by clicking the button labeled \"Synchronize\"." +msgstr "Não podes remover a tua única conta OpenID sem primeiro adicionares uma palavra-passe à tua conta do GNU social ou adicionar outra identidade OpenID. Podes sincronizar o teu perfil com o teu OpenID clicando no botão \"Sincronizar\"." + +#. TRANS: Button text to sync OpenID with the GS profile. +#: actions/openidsettings.php:150 actions/openidsettings.php:174 +msgctxt "BUTTON" +msgid "Sincronizar" +msgstr "Sincronizar" + +#. TRANS: Form guide. +#: actions/openidsettings.php:157 +msgid "" +"You can remove an OpenID from your account by clicking the button labeled " +"\"Remove\". You can synchronize your profile with an OpenID by clicking " +"the button labeled \"Synchronize\"." +msgstr "Podes remover uma das tuas contas OpenID clicando no botão \"Remover\". Podes sincronizar o teu perfil com uma conta OpenID clicando no botão \"Sincronizar\"." + +#: actions/openidsettings.php:343 +msgid "Synchronized OpenID." +msgstr "OpenID sincronizado." + +#. TRANS: Title +#: actions/finishsyncopenid:152 +msgid "OpenID Synchronization" +msgstr "Sincronização OpenID" \ No newline at end of file diff --git a/plugins/OpenID/locale/pt_BR/LC_MESSAGES/OpenID.po b/plugins/OpenID/locale/pt_BR/LC_MESSAGES/OpenID.po index e2002118ca..97679742cf 100644 --- a/plugins/OpenID/locale/pt_BR/LC_MESSAGES/OpenID.po +++ b/plugins/OpenID/locale/pt_BR/LC_MESSAGES/OpenID.po @@ -3,13 +3,14 @@ # This file is under https://www.gnu.org/licenses/agpl v3 or later # # Translators: +# Phablulo Joel msgid "" msgstr "" "Project-Id-Version: GNU social\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-02-02 17:47+0100\n" "PO-Revision-Date: 2015-04-29 02:53+0000\n" -"Last-Translator: digitaldreamer \n" +"Last-Translator: Phablulo Joel\n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/gnu-social/gnu-social/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -197,10 +198,10 @@ msgid "Add" msgstr "Adicionar" #. TRANS: Header on OpenID settings page. -#: actions/openidsettings.php:133 +#: actions/openidsettings.php:129 msgctxt "HEADER" -msgid "Remove OpenID" -msgstr "" +msgid "OpenID Actions" +msgstr "Opções OpenID" #. TRANS: Form guide. #: actions/openidsettings.php:139 @@ -743,3 +744,44 @@ msgstr "" #: OpenIDPlugin.php:687 msgid "OpenID provider" msgstr "" + +#. TRANS: Field label. +#: actions/openidsettings.php:111 +msgid "Synchronize Account" +msgstr "Sincronizar Conta" + +#. TRANS: Form guide. +#: actions/openidsettings.php:113 +msgid "Synchronize GNU social profile with this OpenID identity." +msgstr "Sincronizar perfil do GNU social com esta conta OpenID" + +#. TRANS: Form guide. +#: actions/openidsettings.php:134 +msgid "" +"You can't remove your main OpenID account without either adding a password " +"to your GNU social account or another OpenID account. You can synchronize " +"your profile with your OpenID by clicking the button labeled \"Synchronize\"." +msgstr "Você não pode remover sua única conta OpenID sem primeiro adicionar uma senha à sua conta do GNU Social ou adicionar outra conta OpenID. Para sincronizar seu perfil, clique no botão \"Sincronizar\"." + +#. TRANS: Button text to sync OpenID with the GS profile. +#: actions/openidsettings.php:150 actions/openidsettings.php:174 +msgctxt "BUTTON" +msgid "Sincronizar" +msgstr "Sincronizar" + +#. TRANS: Form guide. +#: actions/openidsettings.php:157 +msgid "" +"You can remove an OpenID from your account by clicking the button labeled " +"\"Remove\". You can synchronize your profile with an OpenID by clicking " +"the button labeled \"Synchronize\"." +msgstr "Você pode remover uma de suas contas OpenID clicando no botão \"Remover\" ou sincronizar seu perfil com uma conta OpenID clicando no botão \"Sincronizar\"." + +#: actions/openidsettings.php:343 +msgid "Synchronized OpenID." +msgstr "OpenID sincronizado." + +#. TRANS: Title +#: actions/finishsyncopenid:152 +msgid "OpenID Synchronization" +msgstr "Sincronização OpenID" \ No newline at end of file diff --git a/plugins/OpenID/locale/ru/LC_MESSAGES/OpenID.po b/plugins/OpenID/locale/ru/LC_MESSAGES/OpenID.po index 963994af05..7f12f4d892 100644 --- a/plugins/OpenID/locale/ru/LC_MESSAGES/OpenID.po +++ b/plugins/OpenID/locale/ru/LC_MESSAGES/OpenID.po @@ -3,13 +3,14 @@ # This file is under https://www.gnu.org/licenses/agpl v3 or later # # Translators: +# Alexei Sorokin , 2019 msgid "" msgstr "" "Project-Id-Version: GNU social\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-02-02 17:47+0100\n" "PO-Revision-Date: 2015-02-05 16:23+0000\n" -"Last-Translator: FULL NAME \n" +"Last-Translator: Alexei Sorokin \n" "Language-Team: Russian (http://www.transifex.com/gnu-social/gnu-social/language/ru/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -197,10 +198,10 @@ msgid "Add" msgstr "Добавить" #. TRANS: Header on OpenID settings page. -#: actions/openidsettings.php:133 +#: actions/openidsettings.php:129 msgctxt "HEADER" -msgid "Remove OpenID" -msgstr "" +msgid "OpenID Actions" +msgstr "Действия с OpenID" #. TRANS: Form guide. #: actions/openidsettings.php:139 @@ -743,3 +744,44 @@ msgstr "" #: OpenIDPlugin.php:687 msgid "OpenID provider" msgstr "" + +#. TRANS: Field label. +#: actions/openidsettings.php:111 +msgid "Synchronize Account" +msgstr "Синхронизировать аккаунт" + +#. TRANS: Form guide. +#: actions/openidsettings.php:113 +msgid "Synchronize GNU social profile with this OpenID identity." +msgstr "Синхронизировать профиль GNU social с этим идентификатором OpenID" + +#. TRANS: Form guide. +#: actions/openidsettings.php:134 +msgid "" +"You can't remove your main OpenID account without either adding a password " +"to your GNU social account or another OpenID account. You can synchronize " +"your profile with your OpenID by clicking the button labeled \"Synchronize\"." +msgstr "Вы не можете удалить ваш основной аккаунт OpenID без добавления к вашему аккаунту GNU social либо пароля, либо иного аккаунта OpenID. Вы можете синхронизировать ваш профиль с OpenID нажатием на кнопку \"Синхронизировать\"." + +#. TRANS: Button text to sync OpenID with the GS profile. +#: actions/openidsettings.php:150 actions/openidsettings.php:174 +msgctxt "BUTTON" +msgid "Sincronizar" +msgstr "синхронизировать" + +#. TRANS: Form guide. +#: actions/openidsettings.php:157 +msgid "" +"You can remove an OpenID from your account by clicking the button labeled " +"\"Remove\". You can synchronize your profile with an OpenID by clicking " +"the button labeled \"Synchronize\"." +msgstr "Вы можете удалить OpenID с вашего аккаунта нажатием на кнопку \"Удалить\". Вы можете синхронизировать ваш профиль с OpenID нажатием на кнопку \"Синхронизировать\"." + +#: actions/openidsettings.php:343 +msgid "Synchronized OpenID." +msgstr "Синхронизированный OpenID." + +#. TRANS: Title +#: actions/finishsyncopenid:152 +msgid "OpenID Synchronization" +msgstr "Синхронизация OpenID" \ No newline at end of file diff --git a/theme/base/css/display.css b/theme/base/css/display.css index cfb7720e63..9fee33c895 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -1359,8 +1359,16 @@ form label.submit { font-weight: normal; } +.form_settings input.sync { + margin-left: 11px; +} + .form_settings input.remove { - margin-left:11px; + margin-left: 11px; +} + +.form_settings .element_actions { + margin-left: 11px; } .form_settings .form_data li {