Fix password settings
This commit is contained in:
parent
f761031d0a
commit
e37e9c2084
@ -84,7 +84,7 @@ class PasswordsettingsAction extends AccountSettingsAction
|
|||||||
'id' => 'form_password',
|
'id' => 'form_password',
|
||||||
'class' => 'form_settings',
|
'class' => 'form_settings',
|
||||||
'action' =>
|
'action' =>
|
||||||
common_local_url('profilesettings')));
|
common_local_url('passwordsettings')));
|
||||||
$this->elementStart('fieldset');
|
$this->elementStart('fieldset');
|
||||||
$this->element('legend', null, _('Password change'));
|
$this->element('legend', null, _('Password change'));
|
||||||
$this->hidden('token', common_session_token());
|
$this->hidden('token', common_session_token());
|
||||||
@ -141,7 +141,12 @@ class PasswordsettingsAction extends AccountSettingsAction
|
|||||||
$newpassword = $this->arg('newpassword');
|
$newpassword = $this->arg('newpassword');
|
||||||
$confirm = $this->arg('confirm');
|
$confirm = $this->arg('confirm');
|
||||||
|
|
||||||
if (0 != strcmp($newpassword, $confirm)) {
|
# Some validation
|
||||||
|
|
||||||
|
if (strlen($newpassword) < 6) {
|
||||||
|
$this->showForm(_('Password must be 6 or more characters.'));
|
||||||
|
return;
|
||||||
|
} else if (0 != strcmp($newpassword, $confirm)) {
|
||||||
$this->showForm(_('Passwords don\'t match.'));
|
$this->showForm(_('Passwords don\'t match.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user