diff --git a/plugins/change-password/index.php b/plugins/change-password/index.php index 3251c177c..330c8f470 100644 --- a/plugins/change-password/index.php +++ b/plugins/change-password/index.php @@ -97,6 +97,9 @@ class ChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin public function ChangePassword() { + $oActions = $this->Manager()->Actions(); + $oAccount = $oActions->GetAccount(); + if (!$oAccount->Email()) { throw new ClientException(static::CouldNotSaveNewPassword); } @@ -104,9 +107,6 @@ class ChangePasswordPlugin extends \RainLoop\Plugins\AbstractPlugin $sPrevPassword = $this->jsonParam('PrevPassword'); $sNewPassword = $this->jsonParam('NewPassword'); - $oActions = $this->Manager()->Actions(); - $oAccount = $oActions->GetAccount(); - if ($sPrevPassword !== $oAccount->Password()) { throw new ClientException(static::CurrentPasswordIncorrect, null, $oActions->StaticI18N('NOTIFICATIONS/CURRENT_PASSWORD_INCORRECT')); }