Elgg  Version 2.3
Functions | Variables
session.js File Reference

Go to the source code of this file.

Functions

elgg provide ('elgg.session')
 Provides session methods. More...
 
 if (elgg.session.user)
 

Variables

elgg session cookie
 Helper function for setting cookies. More...
 
elgg get_logged_in_user_entity
 Returns the object of the user logged in. More...
 
elgg get_logged_in_user_guid
 Returns the GUID of the logged in user or 0. More...
 
elgg is_logged_in
 Returns if a user is logged in. More...
 
elgg is_admin_logged_in
 Returns if the currently logged in user is an admin. More...
 

Function Documentation

if ( elgg.session.  user)

Definition at line 127 of file session.js.

elgg provide ( 'elgg.session'  )

Provides session methods.

Variable Documentation

jQuery cookie

Helper function for setting cookies.

Parameters
{string}name
{string}value
{Object}options

{number|Date} options[expires] {string} options[path] {string} options[domain] {boolean} options[secure]

Returns
{string|undefined} The value of the cookie, if only name is specified. Undefined if no value set

Definition at line 19 of file session.js.

elgg get_logged_in_user_entity
Initial value:
= function() {
return elgg.session.user;
}
elgg
Definition: install.js:23

Returns the object of the user logged in.

Returns
{ElggUser} The logged in user

Definition at line 87 of file session.js.

elgg get_logged_in_user_guid
Initial value:
= function() {
var user = elgg.get_logged_in_user_entity();
return user ? user.guid : 0;
}
elgg
Definition: install.js:23
elgg menu user
Definition: admin.css.php:192

Returns the GUID of the logged in user or 0.

Returns
{number} The GUID of the logged in user

Definition at line 96 of file session.js.

elgg is_admin_logged_in
Initial value:
= function() {
var user = elgg.get_logged_in_user_entity();
return (user instanceof elgg.ElggUser) && user.isAdmin();
}
elgg
Definition: install.js:23
elgg menu user
Definition: admin.css.php:192

Returns if the currently logged in user is an admin.

Returns
{boolean} Whether there is an admin logged in

Definition at line 115 of file session.js.

elgg is_logged_in
Initial value:
= function() {
return (elgg.get_logged_in_user_entity() instanceof elgg.ElggUser);
}
elgg
Definition: install.js:23

Returns if a user is logged in.

Returns
{boolean} Whether there is a user logged in

Definition at line 106 of file session.js.