Fix user validation con REST services - refs #8366

remotes/angel/1.11.x
Angel Fernando Quiroz Campos 8 years ago
parent 7aac10be65
commit 47fa15c138
  1. 9
      main/inc/lib/webservices/WebService.class.php

@ -45,17 +45,14 @@ abstract class WebService
}
/** @var \Chamilo\UserBundle\Entity\User $user */
$user = UserManager::getRepository()->findOneBy([
'username' => $username
]);
$user = UserManager::getRepository()
->findOneBy(['username' => $username]);
if (empty($user)) {
return false;
}
$passwordEncoded = UserManager::encryptPassword($password, $user);
return UserManager::isPasswordValid($passwordEncoded, $password, $user->getSalt());
return UserManager::isPasswordValid($user->getPassword(), $password, $user->getSalt());
}
}

Loading…
Cancel
Save