Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
EC_User Class Reference
Inheritance diagram for EC_User:
iUser TariqaUser

Public Member Functions

 __construct ($user_id, $fetch_ldap=true, $groups=null)
 getUserId ()
 getAttributeList ()
 isMemberOf ($groups, $binary_and=false)
 __get ($attributeName)
 __set ($attributeName, $value)
 __isset ($attributeName)
 __unset ($attributeName)
 get_preference ($name)
 get_access_level ()
 set_preference ($name, $value, $db=null)

Static Public Member Functions

static fetchLDAP ($user_id)

Data Fields

 $user_id = false
 $ldap_attributes = null
const ACCESS_NG = 'NG'
const ACCESS_MS = 'MS'
const ACCESS_EC = 'EC'
const ACCESS_RX = 'RX'

Protected Attributes

 $user_preferences = array()

Constructor & Destructor Documentation

__construct ( user_id,
fetch_ldap = true,
groups = null 
)

Constructor

Parameters:
string$user_idUserID
bool$fetch_ldapIf set to true, tries to retrieve LDAP Attributes for the user
array$groupsA list of groups (if the attributes are not fetched through LDAP, the list of groups can be specified here)

Member Function Documentation

__get ( attributeName)

Accessor, quickly access the user's preferences

Returns:
string

Implements iUser.

__isset ( attributeName)

Accessor, quickly access the user's attributes using object style syntax

Returns:
bool

Implements iUser.

__set ( attributeName,
value 
)

Accessor, quickly access the user's preferences

Implements iUser.

__unset ( attributeName)

Accessor, quickly access the user's attributes using object style syntax

Returns:
bool

Implements iUser.

static fetchLDAP ( user_id) [static]

Get user attributes from the LDAP database

Parameters:
string$user_idId of the user in the LDAP database
Returns:
array An array of attributes

public

Gets the user access level public

Returns:
int

Implements iUser.

get_preference ( name)

Gets an user preference. Returns null if the preference is not set

Parameters:
string$nameThe name of the preference public
Returns:
mixed

Implements iUser.

Returns an array of valid attributes associated with

Returns:
array

Implements iUser.

getUserId ( )

Returns the UserId of the user

Returns:
string

Implements iUser.

isMemberOf ( groups,
binary_and = false 
)

Check the group membership of an user

Parameters:
string | array$groupsEither the name of a group or an array of group names against which to check the membership of the user
bool$binary_andIf set to true, the user must be a member of ALL the groups in the list, otherwise it must belong to at least one of the groups
Returns:
bool

Implements iUser.

set_preference ( name,
value,
db = null 
)

Sets an user preference. To delete a preference from the database, just set the null value for it and set the $db to an instance of mMysql. If you want to delete an array from the database, just put a "%" instead of the index value. For example, to delete the "general/countries" array: $user->set_preference("general/countries/%", null);

Parameters:
string$nameThe preference
mixed$valueThe value
mMysql$dbA database connection (used for saving the preference to the database) [OPTIONAL] public
Returns:
void

Implements iUser.


Field Documentation

$ldap_attributes = null
$user_id = false
$user_preferences = array() [protected]
const ACCESS_EC = 'EC'
const ACCESS_MS = 'MS'
const ACCESS_NG = 'NG'
const ACCESS_RX = 'RX'

The documentation for this class was generated from the following file: