Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Namespaces | Functions | Variables
sessions.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

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=array())
 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_session_boot ()
 Initializes the session and checks for the remember me cookie. More...
 

Variables

global $SESSION
 Elgg magic session. More...
 

Function Documentation

_elgg_session_boot ( )

Initializes the session and checks for the remember me cookie.

Returns
bool private

Definition at line 408 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 263 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 private

Definition at line 136 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

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

elgg_get_session ( )

Gets Elgg's session object.

Returns
Since
1.9

Definition at line 23 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 60 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 74 of file sessions.php.

elgg_is_logged_in ( )

Returns whether or not the user is currently logged in.

Returns
bool

Definition at line 51 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 300 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 209 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 320 of file sessions.php.

logout ( )

Log the current user out.

Returns
bool

Definition at line 372 of file sessions.php.

pam_auth_userpass ( array  $credentials = array())

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
LoginExceptionprivate

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

Variable Documentation

global $SESSION

Elgg magic session.

Definition at line 15 of file sessions.php.