Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

JContext Class Reference

Inheritance diagram for JContext:

Inheritance graph
[legend]
Collaboration diagram for JContext:

Collaboration graph
[legend]
List of all members.

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.


Detailed Description

Class that manages the context of the system.

There are two ways of implementing this:

We choose the first one.

Definition at line 24 of file JContext.class.php.


Constructor & Destructor Documentation

JContext::JContext  ) 
 

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().


Member Function Documentation

JContext::_UpdateSession  ) 
 

Re-stores the object in the session.

Definition at line 88 of file JContext.class.php.

References JSession::SetVar().

Referenced by GetInstance().

JContext::GetActiveGroupId  ) 
 

Gets the id of the active group.

Returns:
gid or GLOBAL_GROUP

Definition at line 141 of file JContext.class.php.

JContext::GetActiveModuleId  ) 
 

Gets the id of the active module.

Returns:
mid

Definition at line 159 of file JContext.class.php.

JContext::GetActiveRmgId  ) 
 

Gets the id of the active rmg.

Returns:
rmgid

Definition at line 204 of file JContext.class.php.

JContext::GetActiveRoleId  ) 
 

Gets the id of the active role.

Returns:
rid

Definition at line 222 of file JContext.class.php.

JContext::GetActiveUserId  ) 
 

Gets the id of the active user.

Returns:
uid

Definition at line 123 of file JContext.class.php.

& JContext::GetInstance  ) 
 

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.

Returns:
JContext

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().

JContext::IsAnonymous  ) 
 

Checks if the user is the anonymous user.

Returns:
boolean

Definition at line 240 of file JContext.class.php.

JContext::IsGlobalGroup  ) 
 

Gets if the current group is the global group for this user

Returns:
boolean

Definition at line 258 of file JContext.class.php.

JContext::IsLogged  ) 
 

Gets if an user has been logged in the system.

Returns:
boolean

Definition at line 97 of file JContext.class.php.

JContext::PopActiveModule  ) 
 

Pop a module from the active module stack.

Returns:
moduleId

Definition at line 190 of file JContext.class.php.

JContext::PushActiveModule mid,
rmgId = 0
 

Push a module in top of the ctive module stack.

Parameters:
mid 
rmgId The id of the module in the current group

Definition at line 178 of file JContext.class.php.

JContext::SetActiveGroupId gid  ) 
 

Sets the id of the active group.

Parameters:
gid or GLOBAL_GROUP

Definition at line 150 of file JContext.class.php.

References $gid.

JContext::SetActiveRoleId rid  ) 
 

Sets the id of the active role.

Parameters:
rid 

Definition at line 231 of file JContext.class.php.

JContext::SetActiveUserId uid  ) 
 

Sets the id of the active user.

Parameters:
uid 

Definition at line 132 of file JContext.class.php.

References $uid.

JContext::SetAnonymous anon  ) 
 

Sets the anonymous status.

Parameters:
anon 

Definition at line 249 of file JContext.class.php.

JContext::SetLogged logged  ) 
 

Sets the logged status of the system.

Parameters:
logged 

Definition at line 106 of file JContext.class.php.

References $logged.


Member Data Documentation

JContext::$anonymous
 

Indicates if the current user is anonymous.

Definition at line 33 of file JContext.class.php.

JContext::$gid
 

The current group id.

Definition at line 28 of file JContext.class.php.

Referenced by SetActiveGroupId().

JContext::$logged
 

Indicates if an user has been logged in or not.

Definition at line 26 of file JContext.class.php.

Referenced by SetLogged().

JContext::$moduleStack
 

The current module stack. In fact is a bidimensional array like: moduleStack[]["mid"], moduleStack[]["rmgid"]

Definition at line 29 of file JContext.class.php.

JContext::$roleId
 

The current role id.

Definition at line 32 of file JContext.class.php.

JContext::$uid
 

The current user id.

Definition at line 27 of file JContext.class.php.

Referenced by SetActiveUserId().


The documentation for this class was generated from the following file:
Generated on Wed Nov 19 20:29:40 2003 for James by doxygen 1.3.4