With basic template trying to create user model, but the password always invalid, in the logs de debug the posted password is right. What I noticed that the password hash is not the same:
bad password
password: sysadmin
password hash:$2y$13$tJZ7JQOiY4c2HHoy1x6f7e8kONvzaKHOyTv6K/UBNPE0yoPzpjaW.
the crypt
$2y$13$tJZ7JQOiY4c2HHoy1x6f7ePpgokA7em5W8gE4fkAIe6Y05I/aCECa
The password hash is right, same one in the DB, but crypt is giving different hash !
The user is created with fuction
public function actionAddUser() {
if (empty ( $model )) {
$user = new User ();
$user->username = 'sysadmin';
$user->email = 'sysadmin@site.com';
$user->mobile = '12345678';
$user->setPassword ( 'sysadmin' );
$user->generateAuthKey ();
if ($user->save ()) {
echo 'User created!';
} else {
print_r ( $user->getErrors () );
}
}
}