Elgg  Version 4.x
Functions
sessions.php File Reference

Go to the source code of this file.

Functions

 elgg_get_session ()
 Gets Elgg's session object. More...
 
 elgg_get_logged_in_user_entity ()
 Return the current logged in user, or null if no user is logged in. More...
 
 elgg_get_logged_in_user_guid ()
 Return the current logged in user by guid. More...
 
 elgg_is_logged_in ()
 Returns whether or not the user is currently logged in. More...
 
 elgg_is_admin_logged_in ()
 Returns whether or not the viewer is currently logged in and an admin user. More...
 
 log_login_failure ($user_guid)
 Log a failed login for $user_guid. More...
 
 reset_login_failure_count ($user_guid)
 Resets the fail login count for $user_guid. More...
 
 check_rate_limit_exceeded ($user_guid)
 Checks if the rate limit of failed logins has been exceeded for $user_guid. More...
 
 elgg_set_cookie (\ElggCookie $cookie)
 Set a cookie, but allow plugins to customize it first. More...
 
 login (\ElggUser $user, $persistent=false)
 Logs in a specified . More...
 
 logout ()
 Log the current user out. More...
 
 _elgg_get_login_forward_url (\Elgg\Request $request,\ElggUser $user)
 Determine which URL the user should be forwarded to upon successful login. More...
 

Function Documentation

_elgg_get_login_forward_url ( \Elgg\Request  $request,
\ElggUser  $user 
)

Determine which URL the user should be forwarded to upon successful login.

Parameters
\Elgg\Request$requestRequest object
\ElggUser$userLogged in user
Returns
string

Definition at line 263 of file sessions.php.

check_rate_limit_exceeded (   $user_guid)

Checks if the rate limit of failed logins has been exceeded for $user_guid.

Parameters
int$user_guidUser GUID
Returns
bool on exceeded limit.

Definition at line 125 of file sessions.php.

elgg_get_logged_in_user_entity ( )

Return the current logged in user, or null if no user is logged in.

Returns
|null
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 26 of file sessions.php.

elgg_get_logged_in_user_guid ( )

Return the current logged in user by guid.

See also
elgg_get_logged_in_user_entity()
Returns
int

Definition at line 36 of file sessions.php.

elgg_get_session ( )

Gets Elgg's session object.

Returns
Since
1.9

Definition at line 17 of file sessions.php.

elgg_is_admin_logged_in ( )

Returns whether or not the viewer is currently logged in and an admin user.

Returns
bool

Definition at line 54 of file sessions.php.

elgg_is_logged_in ( )

Returns whether or not the user is currently logged in.

Returns
bool

Definition at line 45 of file sessions.php.

elgg_set_cookie ( \ElggCookie  $cookie)

Set a cookie, but allow plugins to customize it first.

To customize all cookies, register for the 'init:cookie', 'all' event.

Parameters
\ElggCookie$cookieThe cookie that is being set
Returns
bool
Since
1.9

Definition at line 164 of file sessions.php.

log_login_failure (   $user_guid)

Log a failed login for $user_guid.

Parameters
int$user_guidUser GUID
Returns
bool

Definition at line 65 of file sessions.php.

login ( \ElggUser  $user,
  $persistent = false 
)

Logs in a specified .

For standard registration, use in conjunction with elgg_pam_authenticate.

See also
elgg_pam_authenticate()
Parameters
\ElggUser$userA valid Elgg user object
boolean$persistentShould this be a persistent login?
Returns
true or throws exception
Exceptions
LoginException

Definition at line 180 of file sessions.php.

logout ( )

Log the current user out.

Returns
bool

Definition at line 231 of file sessions.php.

reset_login_failure_count (   $user_guid)

Resets the fail login count for $user_guid.

Parameters
int$user_guidUser GUID
Returns
bool true on success (success = user has no logged failed attempts)

Definition at line 91 of file sessions.php.