Public Member Functions | |
JContext () | |
& | GetInstance () |
_UpdateSession () | |
IsLogged () | |
SetLogged ($logged) | |
GetActiveUserId () | |
SetActiveUserId ($uid) | |
GetActiveGroupId () | |
SetActiveGroupId ($gid) | |
GetActiveModuleId () | |
PushActiveModule ($mid, $rmgId=0) | |
PopActiveModule () | |
GetActiveRmgId () | |
GetActiveRoleId () | |
SetActiveRoleId ($rid) | |
IsAnonymous () | |
SetAnonymous ($anon) | |
IsGlobalGroup () | |
Public Attributes | |
$logged | |
Indicates if an user has been logged in or not. | |
$uid | |
The current user id. | |
$gid | |
The current group id. | |
$moduleStack | |
$roleId | |
The current role id. | |
$anonymous | |
Indicates if the current user is anonymous. |
There are two ways of implementing this:
We choose the first one.
Definition at line 24 of file JContext.class.php.
|
Constructs an object of this class with the default values for all attributes. This constructor should not be used directly. To get an instance of this class use the static method GetInstance, instead. Definition at line 42 of file JContext.class.php. Referenced by GetInstance(). |
|
Re-stores the object in the session. Definition at line 88 of file JContext.class.php. References JSession::SetVar(). Referenced by GetInstance(). |
|
Gets the id of the active group.
Definition at line 141 of file JContext.class.php. |
|
Gets the id of the active module.
Definition at line 159 of file JContext.class.php. |
|
Gets the id of the active rmg.
Definition at line 204 of file JContext.class.php. |
|
Gets the id of the active role.
Definition at line 222 of file JContext.class.php. |
|
Gets the id of the active user.
Definition at line 123 of file JContext.class.php. |
|
Static method that returns the JContext object stored in session. If there isn't any, it will construct a new one with the current active user in the system. This method makes use of the PHP register_shutdown_function that is used to store the changes made in the object into the session when its execution finishes.
Definition at line 59 of file JContext.class.php. References _UpdateSession(), JSession::ExistsVar(), JSession::GetVar(), and JContext(). Referenced by JSystem::AnonLogin(), User::GetActiveRole(), JSystem::GetCurrentGroup(), JSystem::GetCurrentModule(), JSystem::GetCurrentUser(), JSystem::InitModule(), JSystem::IsAnonymous(), JSystem::IsGlobalGroup(), JSystem::IsLogged(), JSystem::JSystem(), JSystem::LoadModule(), JSystem::LoadModuleGlobalGroup(), JSystem::LoadModuleGroup(), JSystem::Login(), JSystem::Logout(), ThrowEvent(), and JSystem::UnloadModule(). |
|
Checks if the user is the anonymous user.
Definition at line 240 of file JContext.class.php. |
|
Gets if the current group is the global group for this user
Definition at line 258 of file JContext.class.php. |
|
Gets if an user has been logged in the system.
Definition at line 97 of file JContext.class.php. |
|
Pop a module from the active module stack.
Definition at line 190 of file JContext.class.php. |
|
Push a module in top of the ctive module stack.
Definition at line 178 of file JContext.class.php. |
|
Sets the id of the active group.
Definition at line 150 of file JContext.class.php. References $gid. |
|
Sets the id of the active role.
Definition at line 231 of file JContext.class.php. |
|
Sets the id of the active user.
Definition at line 132 of file JContext.class.php. References $uid. |
|
Sets the anonymous status.
Definition at line 249 of file JContext.class.php. |
|
Sets the logged status of the system.
Definition at line 106 of file JContext.class.php. References $logged. |
|
Indicates if the current user is anonymous.
Definition at line 33 of file JContext.class.php. |
|
The current group id.
Definition at line 28 of file JContext.class.php. Referenced by SetActiveGroupId(). |
|
Indicates if an user has been logged in or not.
Definition at line 26 of file JContext.class.php. Referenced by SetLogged(). |
|
The current module stack. In fact is a bidimensional array like: moduleStack[]["mid"], moduleStack[]["rmgid"] Definition at line 29 of file JContext.class.php. |
|
The current role id.
Definition at line 32 of file JContext.class.php. |
|
The current user id.
Definition at line 27 of file JContext.class.php. Referenced by SetActiveUserId(). |