mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-08 07:48:02 +08:00
Added Exception when trying to use mysql-crypt in PostgreSQL
This commit is contained in:
parent
09cdc285ab
commit
9336b5bcb7
1 changed files with 10 additions and 6 deletions
|
@ -317,14 +317,18 @@ class ChangePasswordPostfixAdminDriver implements \RainLoop\Providers\ChangePass
|
|||
break;
|
||||
|
||||
case 'mysql_encrypt':
|
||||
$oStmt = $oPdo->prepare('SELECT ENCRYPT(?) AS encpass');
|
||||
if ($oStmt->execute(array($sPassword)))
|
||||
{
|
||||
$aFetchResult = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetchResult) && isset($aFetchResult[0]['encpass']))
|
||||
if($this->sEngine == 'MySQL'){
|
||||
$oStmt = $oPdo->prepare('SELECT ENCRYPT(?) AS encpass');
|
||||
if ($oStmt->execute(array($sPassword)))
|
||||
{
|
||||
$sResult = $aFetchResult[0]['encpass'];
|
||||
$aFetchResult = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetchResult) && isset($aFetchResult[0]['encpass']))
|
||||
{
|
||||
$sResult = $aFetchResult[0]['encpass'];
|
||||
}
|
||||
}
|
||||
}else{
|
||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CouldNotSaveNewPassword);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue