Class User Class for user information and management

author Timo A. Hummel <Timo.Hummel@4fb.de>
version 1.0
copyright four for business 2003

 Methods

Constructor Function.

User(string $table) 

Parameters

$table

string

The table to use as information source

Deletes a user property from the table

deleteUserProperty(string $type, string $name) 

Parameters

$type

string

type Specifies the type (class, category etc) for the property to retrieve

$name

string

name Specifies the name of the property to retrieve

Returns all users available in the system

getAvailableUsers(string $sort) : array

Parameters

$sort

string

SQL sort part

Returns

arrayArray with id and name entries

Returns all system admins available in the system

getClientAdmins(int $client) : array

Parameters

$client

int

Returns

arrayArray with id and name entries

Function returns effective perms for user including group rights as perm string.

getEffectiveUserPerms() : string

author Timo Trautmann

Returns

stringCurrent users permissions

Gets the value of a specific field.

getField(string $field) : mixed

Parameters

$field

string

Specifies the field to retrieve

Returns

mixedValue of the field

Returns the groups a user is in

getGroupIDsByUserID(int $userid) : array

Parameters

$userid

int

Returns

arrayIds of groups

Returns the groups a user is in

getGroupsByUserID(int $userid) : array

Parameters

$userid

int

Returns

arrayReal names of groups

Returns the realname of the given userid

getRealname(int $userid, bool $bAllowFallbackOnUsername) : string

Parameters

$userid

int

$bAllowFallbackOnUsername

bool

Returns

stringRealname if found, or emptry string if not.

Returns the realname of the given username

getRealnameByUserName(string $username) : string

Parameters

$username

string

Returns

stringRealname if found, or emptry string if not.

Returns all system admins available in the system

getSystemAdmins(boolean $forceActive) : array

Parameters

$forceActive

boolean

Is forceActive true return only activ Sysadmins

Returns

arrayArray with id and name entries

Retrieves all available properties of the user

getUserProperties() : array

Returns

arrayAssoziative properties list as follows: - $arr[iduserprop][name] - $arr[iduserprop][type] - $arr[iduserprop][value]

Stores the modified user object to the database

getUserPropertiesByType(string $sType, boolean $bGroup) : array

Parameters

$sType

string

sType Specifies the type (class, category etc) for the property to retrieve

$bGroup

boolean

bGroup Specifies if this function should recursively search in groups

Returns

arrayThe value of the retrieved property

Stores the modified user object to the database

getUserProperty(string $type, string $name, boolean $group) : string

Parameters

$type

string

type Specifies the type (class, category etc) for the property to retrieve

$name

string

name Specifies the name of the property to retrieve

$group

boolean

group Specifies if this function should recursively search in groups

Returns

stringThe value of the retrieved property

Returns the username of the given userid

getUsername(int $userid) : string

Parameters

$userid

int

Returns

stringUsername if found, or emptry string if not.

Loads a user from the database by its userID.

loadUserByUserID($userID) : bool

Parameters

$userID

Returns

boolTrue if the load was successful

Loads a user from the database by its username.

loadUserByUsername(string $username) : bool

Parameters

$username

string

Specifies the username

Returns

boolTrue if the load was successful

Sets the value of a specific field.

setField(string $field, string $value) 

Parameters

$field

string

Specifies the field to set

$value

string

Specifies the value to set

Stores a property to the database

setUserProperty(string $type, string $name, string $value) 

Parameters

$type

string

type Specifies the type (class, category etc) for the property to retrieve

$name

string

name Specifies the name of the property to retrieve

$value

string

value Specifies the value to insert

Stores the modified user object to the database

store() : bool

Returns

bool

 Properties

 

DB_Contenido instance

$db : object

access private
 

Storage of the fields which were modified

$modifiedValues : array

access private
 

Storage of the source table to use for the user informations

$table : string

access private
 

Storage of the source table to use for the user informations

$values : array

access private