mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08:00
Small corrections in PostfixAdminChangePassword plugin (#797)
This commit is contained in:
parent
fd20f10f21
commit
86d763420d
1 changed files with 7 additions and 4 deletions
|
@ -25,12 +25,12 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sUsercol = 'usercol';
|
||||
private $sUsercol = 'username';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $sPasscol = 'passcol';
|
||||
private $sPasscol = 'password';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
|
@ -207,6 +207,8 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
|||
$this->oLogger->Write('Postfix: Try to change password for '.$oAccount->Email());
|
||||
}
|
||||
|
||||
unset($sPrevPassword);
|
||||
|
||||
$bResult = false;
|
||||
|
||||
if (0 < \strlen($sNewPassword))
|
||||
|
@ -221,14 +223,14 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
|||
$sUpdatePassword = $this->cryptPassword($sNewPassword, $oPdo);
|
||||
if (0 < \strlen($sUpdatePassword))
|
||||
{
|
||||
$oStmt = $oPdo->prepare("UPDATE $this->sTable SET $this->sPasscol = ? WHERE $this->sUsercol = ?");
|
||||
$oStmt = $oPdo->prepare("UPDATE {$this->sTable} SET {$this->sPasscol} = ? WHERE {$this->sUsercol} = ?");
|
||||
$bResult = (bool) $oStmt->execute(array($sUpdatePassword, $oAccount->Email()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->oLogger)
|
||||
{
|
||||
$this->oLogger->Write('Postfix: Encyted password is ematy',
|
||||
$this->oLogger->Write('Postfix: Encrypted password is empty',
|
||||
\MailSo\Log\Enumerations\Type::ERROR);
|
||||
}
|
||||
}
|
||||
|
@ -259,6 +261,7 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
|||
switch ($this->sEncrypt)
|
||||
{
|
||||
default:
|
||||
case 'plain':
|
||||
case 'cleartext':
|
||||
$sResult = $sPassword;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue