Merge branch 'master' of https://github.com/palmtown/user_sql into palmtown-master

# Conflicts:
#	lib/Backend/UserBackend.php
This commit is contained in:
Marcin Łojewski
2020-04-13 11:47:47 +02:00
10 changed files with 75 additions and 40 deletions

View File

@@ -301,15 +301,15 @@ final class UserBackend extends ABackend implements
* Check if the user's password is correct then return its ID or
* FALSE on failure.
*
* @param string $uid The user ID.
* @param string $username The username.
* @param string $password The password.
*
* @return string|bool The user ID on success, false otherwise.
*/
public function checkPassword(string $uid, string $password)
public function checkPassword(string $username, string $password)
{
$this->logger->debug(
"Entering checkPassword($uid, *)", ["app" => $this->appName]
"Entering checkPassword($username, *)", ["app" => $this->appName]
);
$passwordAlgorithm = $this->getPasswordAlgorithm();
@@ -320,9 +320,9 @@ final class UserBackend extends ABackend implements
$caseSensitive = empty($this->properties[Opt::CASE_INSENSITIVE_USERNAME]);
$emailLogin = !empty($this->properties[Opt::EMAIL_LOGIN]);
if ($emailLogin) {
$user = $this->userRepository->findByUidOrEmail($uid, $caseSensitive);
$user = $this->userRepository->findByUsernameOrEmail($username, $caseSensitive);
} else {
$user = $this->userRepository->findByUid($uid, $caseSensitive);
$user = $this->userRepository->findByUsername($username, $caseSensitive);
}
if (!($user instanceof User)) {