56 $prev = $e->getPrevious();
61 }
elseif ($e instanceof LoginException) {
elgg_get_current_language()
Get the current system/user language or 'en'.
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
Generic parent class for login exceptions.
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_get_user_by_username(string $username, bool $try_email=false)
Get a user by username.
catch(AuthenticationException|LoginException $e) if(elgg_is_xhr()) $message
Thrown by the AuthenticationService.
elgg_get_session()
Gets Elgg's session object.
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
const ELGG_HTTP_UNAUTHORIZED
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
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.
const REFERRER
Used in calls to forward() to specify the browser should be redirected to the referring page...
const ELGG_SHOW_DISABLED_ENTITIES
elgg_get_login_forward_url(\ElggUser $user)
Determine which URL the user should be forwarded to upon successful login.
elgg_pam_authenticate(string $policy, array $authentication_params=[])
Start an authentication process.
elgg_register_error_message(string|array $options)
Registers a error system message.
const ELGG_HTTP_BAD_REQUEST
elgg_login(\ElggUser $user, bool $persistent=false)
Log in a user.
if(empty($username)||empty($password)) $user
elgg_generate_url(string $name, array $parameters=[])
Generate a URL for named route.
elgg_is_xhr()
Checks whether the request was requested via ajax.
Login as the specified user.
getRedirectUrl()
Get preferred redirect URL.
catch(AuthenticationException|LoginException $e) if(elgg_is_xhr()) $output