Do not override the passwd string. First it prevents the md5 working if the crypt() check fails and also is useless to override it since the parameter is passed by value and not by reference.

This commit is contained in:
Ermal LUÇI 2015-01-12 11:43:21 +01:00
parent 21165e6455
commit 545c4435ef

View File

@ -302,15 +302,13 @@ function local_backed($username, $passwd) {
if ($user['password'])
{
$passwd = crypt($passwd, $user['password']);
if ($passwd == $user['password'])
if (crypt($passwd, $user['password']) == $user['password'])
return true;
}
if ($user['md5-hash'])
{
$passwd = md5($passwd);
if ($passwd == $user['md5-hash'])
if (md5($passwd) == $user['md5-hash'])
return true;
}