mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 16:07:03 +03: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
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $sUsercol = 'usercol';
|
private $sUsercol = 'username';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $sPasscol = 'passcol';
|
private $sPasscol = 'password';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
|
|
@ -207,6 +207,8 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
||||||
$this->oLogger->Write('Postfix: Try to change password for '.$oAccount->Email());
|
$this->oLogger->Write('Postfix: Try to change password for '.$oAccount->Email());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unset($sPrevPassword);
|
||||||
|
|
||||||
$bResult = false;
|
$bResult = false;
|
||||||
|
|
||||||
if (0 < \strlen($sNewPassword))
|
if (0 < \strlen($sNewPassword))
|
||||||
|
|
@ -221,14 +223,14 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
||||||
$sUpdatePassword = $this->cryptPassword($sNewPassword, $oPdo);
|
$sUpdatePassword = $this->cryptPassword($sNewPassword, $oPdo);
|
||||||
if (0 < \strlen($sUpdatePassword))
|
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()));
|
$bResult = (bool) $oStmt->execute(array($sUpdatePassword, $oAccount->Email()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($this->oLogger)
|
if ($this->oLogger)
|
||||||
{
|
{
|
||||||
$this->oLogger->Write('Postfix: Encyted password is ematy',
|
$this->oLogger->Write('Postfix: Encrypted password is empty',
|
||||||
\MailSo\Log\Enumerations\Type::ERROR);
|
\MailSo\Log\Enumerations\Type::ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -259,6 +261,7 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
||||||
switch ($this->sEncrypt)
|
switch ($this->sEncrypt)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
|
case 'plain':
|
||||||
case 'cleartext':
|
case 'cleartext':
|
||||||
$sResult = $sPassword;
|
$sResult = $sPassword;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue