Bugfix: Undefined variable oAccount

https://github.com/the-djmaze/snappymail/issues/51#issuecomment-790419644
This commit is contained in:
djmaze 2021-03-04 12:20:06 +01:00
parent ab3313faf6
commit 72988972a7

View file

@ -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'));
}