Fixes on fields for show errors properly

This commit is contained in:
Antonio de la Rosa 2015-08-27 17:25:07 +02:00
parent f0860b413a
commit f3b4b4e454
5 changed files with 35 additions and 8 deletions

View file

@ -35,9 +35,13 @@ class PasswordField extends CharField {
}
/*
$token_pass=Utils::generate_random_password();
$hash_password=$token_pass.'_'.sha1($token_pass.'_'.$value);
*/
$hash_password=password_hash($value, PASSWORD_DEFAULT);
return $hash_password;
@ -50,8 +54,8 @@ class PasswordField extends CharField {
//If pass have _ check if work fine...
$token_pass=preg_replace('/(.*)[_].*/', '$1', $hash_password_check);
//$token_pass=preg_replace('/(.*)[_].*/', '$1', $hash_password_check);
/*
$hash_password=$token_pass.'_'.sha1($token_pass.'_'.$value);
if($hash_password==$hash_password_check)
@ -59,6 +63,13 @@ class PasswordField extends CharField {
return true;
}*/
if(password_verify($value, $hash_password_check))
{
return true;
}
return false;