Select right random number generator on windows

Update translations
This commit is contained in:
nuxsmin
2013-10-25 01:44:37 +02:00
parent 9522c39fb7
commit 77eb7385ca
3 changed files with 7 additions and 3 deletions

View File

@@ -358,12 +358,12 @@ class SP_Account {
// No escribir en el log ni enviar correos si la actualización es
// por cambio de clave maestra...
if ( ! $isMassive ){
$accountInfo = array('customer_name');
$accountInfo = array('customer_name','account_name');
$this->getAccountInfoById($accountInfo);
$message['action'] = _('Modificar Clave');
$message['text'][] = _('Cliente').": ".$this->cacheParams['customer_name'];
$message['text'][] = _('Cuenta').": $this->accountName ($this->accountId)";
$message['text'][] = _('Cuenta').": ".$this->cacheParams['account_name']." ($this->accountId)";
SP_Common::wrLogInfo($message);
SP_Common::sendEmail($message);

View File

@@ -38,7 +38,11 @@ class SP_Crypt {
*/
private static function createIV() {
$resEncDes = mcrypt_module_open('rijndael-256', '', 'cbc', '');
$cryptIV = mcrypt_create_iv(mcrypt_enc_get_iv_size($resEncDes), MCRYPT_DEV_URANDOM);
if ( SP_Util::runningOnWindows() && (! defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) ){
$cryptIV = mcrypt_create_iv(mcrypt_enc_get_iv_size($resEncDes), MCRYPT_RAND);
} else {
$cryptIV = mcrypt_create_iv(mcrypt_enc_get_iv_size($resEncDes), MCRYPT_DEV_URANDOM);
}
mcrypt_module_close($resEncDes);
return $cryptIV;