diff options
Diffstat (limited to 'src/controllers/UsersController.php')
-rw-r--r-- | src/controllers/UsersController.php | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/src/controllers/UsersController.php b/src/controllers/UsersController.php index 3db2c095..6a380d1f 100644 --- a/src/controllers/UsersController.php +++ b/src/controllers/UsersController.php @@ -272,11 +272,8 @@ $this->action=isset($_REQUEST['cancel'])?'cancel':$this->action; $this->printTrail('user'); $this->printTitle($this->lang['strchangepassword'], 'pg.user.alter'); $this->printMsg($msg); - $this->coalesceArr($_POST, 'password', ''); - $this->coalesceArr($_POST, 'confirm', ''); - echo '<form action="' . \containerInstance()->subFolder . '/users" method="post">' . \PHP_EOL; echo '<table>' . \PHP_EOL; echo \sprintf( @@ -305,24 +302,21 @@ $this->action=isset($_REQUEST['cancel'])?'cancel':$this->action; $this->lang['strcancel'] ) . \PHP_EOL; echo '</p></form>' . \PHP_EOL; + } elseif (\mb_strlen($_POST['password']) < $this->conf['min_password_length']) { + $this->doChangePassword(true, $this->lang['strpasswordshort']); + } elseif ($_POST['password'] !== $_POST['confirm']) { + // Check that password matches confirmation password + $this->doChangePassword(true, $this->lang['strpasswordconfirm']); } else { - // Check that password is minimum length - if (\mb_strlen($_POST['password']) < $this->conf['min_password_length']) { - $this->doChangePassword(true, $this->lang['strpasswordshort']); - } elseif ($_POST['password'] !== $_POST['confirm']) { - // Check that password matches confirmation password - $this->doChangePassword(true, $this->lang['strpasswordconfirm']); - } else { - $status = $data->changePassword( - $server_info['username'], - $_POST['password'] - ); + $status = $data->changePassword( + $server_info['username'], + $_POST['password'] + ); - if (0 === $status) { - $this->doAccount($this->lang['strpasswordchanged']); - } else { - $this->doAccount($this->lang['strpasswordchangedbad']); - } + if (0 === $status) { + $this->doAccount($this->lang['strpasswordchanged']); + } else { + $this->doAccount($this->lang['strpasswordchangedbad']); } } } |