비밀번호 체크관련 코드 수정

This commit is contained in:
chicpro
2015-05-13 16:39:13 +09:00
parent 9cb8f73738
commit b6d84674f6
16 changed files with 42 additions and 18 deletions

View File

@ -2824,4 +2824,24 @@ function insert_popular($field, $str)
sql_query($sql, FALSE);
}
}
// 문자열 암호화
function get_encrypt_string($str)
{
if(defined('G5_STRING_ENCRYPT_FUNCTION') && G5_STRING_ENCRYPT_FUNCTION) {
$encrypt = call_user_func(G5_STRING_ENCRYPT_FUNCTION, $str);
} else {
$encrypt = sql_password($str);
}
return $encrypt;
}
// 비밀번호 비교
function check_password($pass, $hash)
{
$password = get_encrypt_string($pass);
return ($password === $hash);
}
?>