56 $prev = $e->getPrevious();
catch(AuthenticationException|LoginException $e) if(elgg_is_xhr()) $output
if(empty($username)||empty($password)) $user
Thrown by the AuthenticationService.
getRedirectUrl()
Get preferred redirect URL.
Generic parent class for login exceptions.
const ELGG_HTTP_UNAUTHORIZED
const ELGG_SHOW_DISABLED_ENTITIES
const ELGG_HTTP_BAD_REQUEST
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page.
if($item instanceof \ElggEntity) elseif($item instanceof \ElggRiverItem) elseif($item instanceof \ElggRelationship) elseif(is_callable([ $item, 'getType']))
elgg_register_error_message(string|array $options)
Registers a error system message.
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.
elgg_get_current_language()
Get the current system/user language or 'en'.
elgg_echo(string $message_key, array $args=[], string $language='')
Elgg language module Functions to manage language and translations.
elgg_is_xhr()
Checks whether the request was requested via ajax.
elgg_ok_response($content='', string|array $message='', ?string $forward_url=null, int $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
elgg_error_response(string|array $message='', string $forward_url=REFERRER, int $status_code=ELGG_HTTP_BAD_REQUEST)
Prepare an error response to be returned by a page or an action handler.
elgg_pam_authenticate(string $policy, array $authentication_params=[])
Start an authentication process.
elgg_get_session()
Gets Elgg's session object.
elgg_login(\ElggUser $user, bool $persistent=false)
Log in a user.
elgg_get_login_forward_url(\ElggUser $user)
Determine which URL the user should be forwarded to upon successful login.