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

deleteUserProperty($type, $name) 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

getAvailableUsers() Returns all users available in the system

getAvailableUsers($sort) : array

Parameters

$sort

Returns

arrayArray with id and name entries

getClientAdmins() Returns all system admins available in the system

getClientAdmins($client) : array

Parameters

$client

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

string- current users permissions

getField($field) Gets the value of a specific field

getField(string $field) : mixed

Parameters

$field

string

Specifies the field to retrieve

Returns

mixedValue of the field

getGroupIDsByUserID() Returns the groups a user is in

getGroupIDsByUserID($userid) : array

Parameters

$userid

Returns

arrayids of groups

getGroupsByUserID() Returns the groups a user is in

getGroupsByUserID($userid) : array

Parameters

$userid

Returns

arrayReal names of groups

getRealname() Returns the realname of the given userid

getRealname($userid, $bAllowFallbackOnUsername) : string

Parameters

$userid

$bAllowFallbackOnUsername

Returns

stringRealname if found, or emptry string if not.

getRealnameByUserName() Returns the realname of the given username

getRealnameByUserName($username) : string

Parameters

$username

Returns

stringRealname if found, or emptry string if not.

getSystemAdmins() Returns all system admins available in the system

getSystemAdmins(boolean $forceActive) : array

Parameters

$forceActive

boolean

forceActive Is forceActive true return only activ Sysadmins

Returns

arrayArray with id and name entries

getUserProperties() Retrieves all available properties of the user

getUserProperties() 

getUserPropertiesByType($type) 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

getUserProperty($type, $name) 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

getUsername() Returns the username of the given userid

getUsername($userid) : string

Parameters

$userid

Returns

stringUsername if found, or emptry string if not.

loadUserByUserID($userID) Loads a user from the database by its userID

loadUserByUserID($userID) : bool

Parameters

$userID

Returns

boolTrue if the load was successful

loadUserByUsername($username) 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

setField($field, $value) 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

setUserProperty($type, $name, $value) 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

store() Stores the modified user object to the database

store() 

 Properties

 

$db : object
access private
 

$modifiedValues : array
access private
 

$table : string
access private
 

$values : array
access private