Changeset View
Changeset View
Standalone View
Standalone View
src/app/Auth/LDAPUserProvider.php
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | class LDAPUserProvider extends EloquentUserProvider implements UserProvider | ||||
* @param array $credentials The credentials. | * @param array $credentials The credentials. | ||||
* | * | ||||
* @return bool | * @return bool | ||||
*/ | */ | ||||
public function validateCredentials(Authenticatable $user, array $credentials): bool | public function validateCredentials(Authenticatable $user, array $credentials): bool | ||||
{ | { | ||||
$authenticated = false; | $authenticated = false; | ||||
if ($user->email === \strtolower($credentials['email'])) { | if ($user->email === \strtolower($credentials['email']) && !$user->isDraft()) { | ||||
if (!empty($user->password)) { | if (!empty($user->password)) { | ||||
if (Hash::check($credentials['password'], $user->password)) { | if (Hash::check($credentials['password'], $user->password)) { | ||||
$authenticated = true; | $authenticated = true; | ||||
} | } | ||||
} elseif (!empty($user->password_ldap)) { | } elseif (!empty($user->password_ldap)) { | ||||
if (substr($user->password_ldap, 0, 6) == "{SSHA}") { | if (substr($user->password_ldap, 0, 6) == "{SSHA}") { | ||||
$salt = substr(base64_decode(substr($user->password_ldap, 6)), 20); | $salt = substr(base64_decode(substr($user->password_ldap, 6)), 20); | ||||
Show All 39 Lines |