パスワードを暗号化させない

http://www.maruhisa.org/2011/11/30/cakephp2-0using_plainpassword/
http://www.matomater.com/687/

[php]
/lib/Cake/Utility/Security.php 107行目あたり

public static function hash($string, $type = null, $salt = false) {

return $string;
/*if (empty($type)) {
$type = self::$hashType;
}
$type = strtolower($type);

if ($type === ‘blowfish’) {
return self::_crypt($string, $salt);
}
if ($salt) {
if (!is_string($salt)) {
$salt = Configure::read(‘Security.salt’);
}
$string = $salt . $string;
}

if (!$type || $type === ‘sha1’) {
if (function_exists(‘sha1’)) {
return sha1($string);
}
$type = ‘sha256’;
}

if ($type === ‘sha256’ && function_exists(‘mhash’)) {
return bin2hex(mhash(MHASH_SHA256, $string));
}

if (function_exists(‘hash’)) {
return hash($type, $string);
}
return md5($string);*/
}
[/php]

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です