From 72988972a728c50137f92a4587c1a155020f1659 Mon Sep 17 00:00:00 2001 From: djmaze Date: Thu, 4 Mar 2021 12:20:06 +0100 Subject: [PATCH] Bugfix: Undefined variable oAccount https://github.com/the-djmaze/snappymail/issues/51#issuecomment-790419644 --- plugins/change-password/index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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')); }