24 public function __invoke(array $credentials): bool {
25 if (!isset($credentials[
'username']) || !isset($credentials[
'password'])) {
36 $password = (string) $credentials[
'password'];
37 $hash = (string)
$user->password_hash;
43 if (!$password_svc->verify(
$password, $hash)) {
49 if ($password_svc->needsRehash($hash)) {
Generic parent class for login exceptions.
PAM handler to authenticate a user based on username/password Used for the 'user' policy.
__invoke(array $credentials)
Authenticate a user.
const ELGG_SHOW_DISABLED_ENTITIES
_elgg_services()
Get the global service provider.
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags.
elgg_get_user_by_username(string $username, bool $try_email=false)
Get a user by username.
if(! $user||! $user->canEdit()) $password
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.
elgg_is_authentication_failure_limit_reached(\ElggUser $user, ?int $limit=null, ?int $lifetime=null)
Checks if the authentication failure limit has been reached.
elgg_register_authentication_failure(\ElggUser $user)
Registers an authentication failure for a user.