X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpasswordsettings.php;h=db36b612a29becfa806733c885e57ff955504f48;hb=c00491cd7a29a9ef16d6e6bfa54505d4c9a522fe;hp=46d95efcbe0596940b031543880d0f5af566816f;hpb=e98e443605cff0266dcf9b412641b42c82e45824;p=quix0rs-gnu-social.git diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 46d95efcbe..db36b612a2 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -32,7 +32,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/accountsettingsaction.php'; + /** * Change password @@ -45,7 +45,7 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php'; * @link http://status.net/ */ -class PasswordsettingsAction extends AccountSettingsAction +class PasswordsettingsAction extends SettingsAction { /** * Title of the page @@ -55,7 +55,8 @@ class PasswordsettingsAction extends AccountSettingsAction function title() { - return _('Change password'); + // TRANS: Title for page where to change password. + return _m('TITLE','Change password'); } /** @@ -66,6 +67,7 @@ class PasswordsettingsAction extends AccountSettingsAction function getInstructions() { + // TRANS: Instructions for page where to change password. return _('Change your password.'); } @@ -93,6 +95,7 @@ class PasswordsettingsAction extends AccountSettingsAction 'action' => common_local_url('passwordsettings'))); $this->elementStart('fieldset'); + // TRANS: Fieldset legend on page where to change password. $this->element('legend', null, _('Password change')); $this->hidden('token', common_session_token()); @@ -101,20 +104,26 @@ class PasswordsettingsAction extends AccountSettingsAction // Users who logged in with OpenID won't have a pwd if ($user->password) { $this->elementStart('li'); + // TRANS: Field label on page where to change password. $this->password('oldpassword', _('Old password')); $this->elementEnd('li'); } $this->elementStart('li'); + // TRANS: Field label on page where to change password. $this->password('newpassword', _('New password'), + // TRANS: Field title on page where to change password. _('6 or more characters.')); $this->elementEnd('li'); $this->elementStart('li'); - $this->password('confirm', _('Confirm'), + // TRANS: Field label on page where to change password. In this field the new password should be typed a second time. + $this->password('confirm', _m('LABEL','Confirm'), + // TRANS: Field title on page where to change password. _('Same as password above.')); $this->elementEnd('li'); $this->elementEnd('ul'); - $this->submit('changepass', _('Change')); + // TRANS: Button text on page where to change password. + $this->submit('changepass', _m('BUTTON','Change')); $this->elementEnd('fieldset'); $this->elementEnd('form'); @@ -134,6 +143,7 @@ class PasswordsettingsAction extends AccountSettingsAction $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { + // TRANS: Client error displayed when the session token does not match or is not given. $this->showForm(_('There was a problem with your session token. '. 'Try again, please.')); return; @@ -147,13 +157,15 @@ class PasswordsettingsAction extends AccountSettingsAction $newpassword = $this->arg('newpassword'); $confirm = $this->arg('confirm'); - # Some validation + // Some validation if (strlen($newpassword) < 6) { + // TRANS: Form validation error on page where to change password. $this->showForm(_('Password must be 6 or more characters.')); return; } else if (0 != strcmp($newpassword, $confirm)) { - $this->showForm(_('Passwords don\'t match.')); + // TRANS: Form validation error on password change when password confirmation does not match. + $this->showForm(_('Passwords do not match.')); return; } @@ -161,7 +173,8 @@ class PasswordsettingsAction extends AccountSettingsAction $oldpassword = $this->arg('oldpassword'); if (!common_check_user($user->nickname, $oldpassword)) { - $this->showForm(_('Incorrect old password')); + // TRANS: Form validation error on page where to change password. + $this->showForm(_('Incorrect old password.')); return; } }else{ @@ -177,17 +190,20 @@ class PasswordsettingsAction extends AccountSettingsAction $val = $user->validate(); if ($val !== true) { + // TRANS: Form validation error on page where to change password. $this->showForm(_('Error saving user; invalid.')); return; } if (!$user->update($original)) { + // TRANS: Server error displayed on page where to change password when password change + // TRANS: could not be made because of a server error. $this->serverError(_('Cannot save new password.')); - return; } Event::handle('EndChangePassword', array($user)); } + // TRANS: Form validation notice on page where to change password. $this->showForm(_('Password saved.'), true); } }