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

User Class Reference

Inheritance diagram for User:

Inheritance graph
[legend]
Collaboration diagram for User:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 User ($id)
 _RefreshGroupsRoles ()
_GetGroupsRoles ()
 GetId ()
 GetLogin ()
 IsPassword ($password)
GetGlobalGroup ()
GetGlobalRole ()
 _GetGGId ()
 _GetGRId ()
 SetLogin ($name)
 SetPassword ($password)
 SetGlobalGroup ($gg)
 SetGlobalRole ($gr)
 Commit ()
 GetGroups ()
GetModules ()
GetRoles ()
GetRole ($idG)
GetActiveRole ()
 AddToGroup ($idG, $idR)
 SetRole ($idG, $idR)
 RemoveFromGroup ($idG)
 HasPermission ($name)
Create ($login, $pass, $globalgroup, $globalrole)
 Remove ($idU)
 GetAllUsersId ()

Public Attributes

 $data
 Stores all DB fields in an array.

 $roles
 Stores the roles and groups of the user.


Detailed Description

Class that deals with the users of the system.

Definition at line 16 of file User.class.php.


Constructor & Destructor Documentation

User::User id  ) 
 

Class constructor. It creates a new User object given an idU.

Parameters:
id The id or the login name of the user.

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

Referenced by Create().


Member Function Documentation

User::_GetGGId  ) 
 

Gets the id of the global group.

Returns:
integer

Definition at line 170 of file User.class.php.

User::_GetGRId  ) 
 

Gets the id of the global role.

Returns:
integer

Definition at line 179 of file User.class.php.

& User::_GetGroupsRoles  ) 
 

Gets a DBJames with the groups the user belongs to.

Returns:
DBJames

Definition at line 100 of file User.class.php.

User::_RefreshGroupsRoles  ) 
 

Refreshes the information about groups and roles in the user

Definition at line 85 of file User.class.php.

User::AddToGroup idG,
idR
 

Adds the user to an existent group in the system with the specified role.

Parameters:
idG The id of the group
idR The id of the role

Definition at line 365 of file User.class.php.

References JUgrSystem::GetInstance(), JSystem::IsError(), and JBaseObject::RaiseError().

User::Commit  ) 
 

Commits all changes into the DB

Definition at line 232 of file User.class.php.

& User::Create login,
pass,
globalgroup,
globalrole
 

Static method that adds a new user in the DB.

Parameters:
login The login of the user.
pass The user password.
globalgroup The id of the global group of the user
globalrole The id of the global role of the user
Returns:
User.

Definition at line 474 of file User.class.php.

References JUgrSystem::GetInstance(), JSystem::GetLastError(), JSystem::IsError(), JBaseObject::RaiseError(), and User().

Referenced by JUgrSystem::AddUser().

& User::GetActiveRole  ) 
 

Gets the role of the user in the active group

Returns:
Role

Definition at line 353 of file User.class.php.

References JContext::GetInstance().

User::GetAllUsersId  ) 
 

Static method that retrieves all users in the system.

Returns:
DBJames object

Definition at line 547 of file User.class.php.

Referenced by JUgrSystem::GetAllUsers().

& User::GetGlobalGroup  ) 
 

Gets the global group of the user.

Returns:
Group

Definition at line 148 of file User.class.php.

References JUgrSystem::GetInstance().

& User::GetGlobalRole  ) 
 

Gets the global role of the user.

Returns:
Role

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

References JUgrSystem::GetInstance().

User::GetGroups  ) 
 

Gets an array with the groups the user belongs to.

Returns:
Array of Group

Definition at line 250 of file User.class.php.

References JUgrSystem::GetInstance(), and JBaseObject::RaiseError().

User::GetId  ) 
 

Gets the Id of the user

Returns:
integer The id of the user.

Definition at line 119 of file User.class.php.

User::GetLogin  ) 
 

Gets the login of the user

Returns:
string The user login.

Definition at line 128 of file User.class.php.

& User::GetModules  ) 
 

Gets an array with all the allowed Modules for this user.

Returns:
Array of Module.

Definition at line 277 of file User.class.php.

References Modules::GetInstance(), and JBaseObject::RaiseError().

& User::GetRole idG  ) 
 

Gets the role of the user in the group idG.

Parameters:
idG The id of the group.
Returns:
Role

Definition at line 336 of file User.class.php.

References JUgrSystem::GetInstance(), and JBaseObject::RaiseError().

& User::GetRoles  ) 
 

Gets an array with the roles of the user indexed by idG.

Returns:
Array of Role

Definition at line 310 of file User.class.php.

References JUgrSystem::GetInstance(), and JBaseObject::RaiseError().

User::HasPermission name  ) 
 

Checks if the user has permission to do an action in the active group and module.

Parameters:
name The name of the permission.
Returns:
boolean

Definition at line 459 of file User.class.php.

References $module, and JSystem::GetCurrentModule().

User::IsPassword password  ) 
 

Checks if it is the user password

Todo:
This has to be changed.
Parameters:
password The password is going to be checked
Returns:
boolean

Definition at line 139 of file User.class.php.

User::Remove idU  ) 
 

Static method that removes an user from the DB.

Parameters:
idU The id of the user.

Definition at line 518 of file User.class.php.

References JUgrSystem::GetInstance(), JSystem::IsError(), and JBaseObject::RaiseError().

Referenced by JUgrSystem::RemoveUser().

User::RemoveFromGroup idG  ) 
 

Removes the user from a group.

Parameters:
idG The id of the group.

Definition at line 434 of file User.class.php.

References JUgrSystem::GetInstance(), JSystem::IsError(), and JBaseObject::RaiseError().

User::SetGlobalGroup gg  ) 
 

Sets the global group of the user.

Parameters:
gg The new global group (a Group object).
Returns:
JError if there was any error

Definition at line 208 of file User.class.php.

References JBaseObject::RaiseError().

User::SetGlobalRole gr  ) 
 

Sets the global role of the user.

Parameters:
gr The new global role (a Role object).

Definition at line 221 of file User.class.php.

User::SetLogin name  ) 
 

Sets the login of the user.

Parameters:
name The new login name.

Definition at line 188 of file User.class.php.

User::SetPassword password  ) 
 

Sets the password of the user.

Todo:
This function should be changed.
Parameters:
password The new user password.

Definition at line 198 of file User.class.php.

User::SetRole idG,
idR
 

Sets the role the user has in a group.

Parameters:
idG The group whose role is going to be changed.
idR The new role.

Definition at line 400 of file User.class.php.

References JUgrSystem::GetInstance(), JSystem::IsError(), and JBaseObject::RaiseError().


Member Data Documentation

User::$data
 

Stores all DB fields in an array.

Definition at line 18 of file User.class.php.

User::$roles
 

Stores the roles and groups of the user.

Definition at line 19 of file User.class.php.


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