Elgg  Version 3.0
Namespaces | Functions | Variables
sessions.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

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...
 
 elgg_is_admin_user ($user_guid)
 Check if the given user has full access. More...
 
 elgg_authenticate ($username, $password)
 Perform user authentication with a given username and password. More...
 
 pam_auth_userpass (array $credentials=[])
 Hook into the PAM system which accepts a username and password and attempts to authenticate it against a known 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...
 
 _elgg_session_cleanup_persistent_login (\Elgg\Hook $hook)
 Cleanup expired persistent login tokens from the database. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

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 345 of file sessions.php.

_elgg_session_cleanup_persistent_login ( \Elgg\Hook  $hook)

Cleanup expired persistent login tokens from the database.

Parameters
\Elgg\Hook$hook'cron', 'daily'
Returns
void
Since
3.0

Definition at line 380 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 218 of file sessions.php.

elgg_authenticate (   $username,
  $password 
)

Perform user authentication with a given username and password.

Warning
This returns an error message on failure. Use the identical operator to check for access: if (true === elgg_authenticate()) { ... }.
See also
login()
Parameters
string$usernameThe username
string$passwordThe password
Returns
true|string True or an error message on failure

Definition at line 98 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 29 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 39 of file sessions.php.

elgg_get_session ( )

Gets Elgg's session object.

Returns
Since
1.9

Definition at line 20 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 57 of file sessions.php.

elgg_is_admin_user (   $user_guid)

Check if the given user has full access.

Parameters
int$user_guidThe user to check
Returns
bool
Since
1.7.1

Definition at line 71 of file sessions.php.

elgg_is_logged_in ( )

Returns whether or not the user is currently logged in.

Returns
bool

Definition at line 48 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 257 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 158 of file sessions.php.

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

Logs in a specified .

For standard registration, use in conjunction with elgg_authenticate.

See also
elgg_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 273 of file sessions.php.

logout ( )

Log the current user out.

Returns
bool

Definition at line 313 of file sessions.php.

pam_auth_userpass ( array  $credentials = [])

Hook into the PAM system which accepts a username and password and attempts to authenticate it against a known user.

Parameters
array$credentialsAssociated array of credentials passed to Elgg's PAM system. This function expects 'username' and 'password' (cleartext).
Returns
bool
Exceptions
LoginException

Definition at line 120 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 184 of file sessions.php.

Variable Documentation

See also
::loadCore Do not do work here. Just register for events.

Definition at line 436 of file sessions.php.