<?php
/**
* password_compat functions
*
* @package functions
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Wed Feb 19 15:57:35 2014 +0000 New in v1.5.3 $
*/
if (! defined('PASSWORD_DEFAULT')) {
define('PASSWORD_DEFAULT', PASSWORD_BCRYPT
);
function password_hash($password, $algo = null)
{
return zen_encrypt_password_new($password);
}
}
function password_verify($plain, $encrypted)
{
if (zen_not_null($plain) && zen_not_null($encrypted)) {
return false;
if (zcPassword::getInstance(PHP_VERSION)->validatePasswordOldMd5($plain, $encrypted) === true) {
return true;
} elseif (zcPassword::getInstance(PHP_VERSION)->validatePasswordCompatSha256($plain, $encrypted) === true) {
return true;
}
}
return false;
}
}
function password_needs_rehash($hash, $algo = null)
{
return true;
} else {
return false;
}
}
}
}