contenido\classes\class.user.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

Description: Contenido User classes

Requirements:

Author
Timo A. Hummel  
Con_php_req
5.0  
Copyright
four for business AG  
License
http://www.contenido.org/license/LIZENZ.txt  
Link
http://www.4fb.de  
Link
http://www.contenido.org  
Package
Contenido Backend classes  
Since
file available since contenido release <= 4.6 {@internal created unknown modified 2008-06-30, Dominik Ziegler, add security fix modified 2009-05-18, Andreas Lindner, add method getGroupIDsByUserID to class User modified 2009-12-17, Dominik Ziegler, added support for username fallback modified 2010-05-20, Oliver Lohkemper, add param forceActive in User::getSystemAdmins() $Id: class.user.php 1153 2010-05-20 06:49:53Z OliverL $: }}  
Version
1.0.2  

\User

Package: Default
Class User Class for user information and management
Author
Timo A. Hummel  
Copyright
four for business 2003  
Version
1.0  

Properties

>VPropertypublicobject $db
DB_Contenido instance
Details
Type
object
Access
private  
>VPropertypublicarray $modifiedValues
Storage of the fields which were modified
Details
Type
array
Access
private  
>VPropertypublicstring $table
Storage of the source table to use for the user informations
Details
Type
string
Access
private  
>VPropertypublicarray $values
Storage of the source table to use for the user informations
Details
Type
array
Access
private  

Methods

methodpublicUser(string $table = "") : void

Constructor Function

Parameters
NameTypeDescription
$tablestring

The table to use as information source

methodpublicdeleteUserProperty(string $type, string $name) : void

deleteUserProperty($type, $name) Deletes a user property from the table

Parameters
NameTypeDescription
$typestring

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

$namestring

name Specifies the name of the property to retrieve

methodpublicgetAvailableUsers( $sort = "ORDER BY realname ASC") : array

getAvailableUsers() Returns all users available in the system

Parameters
NameTypeDescription
$sort
Returns
TypeDescription
arrayArray with id and name entries
methodpublicgetClientAdmins( $client) : array

getClientAdmins() Returns all system admins available in the system

Parameters
NameTypeDescription
$client
Returns
TypeDescription
arrayArray with id and name entries
methodpublicgetEffectiveUserPerms() : string

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

Returns
TypeDescription
string- current users permissions
Details
Author
Timo Trautmann  
methodpublicgetField(string $field) : mixed

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

Parameters
NameTypeDescription
$fieldstring

Specifies the field to retrieve

Returns
TypeDescription
mixedValue of the field
methodpublicgetGroupIDsByUserID( $userid) : array

getGroupIDsByUserID() Returns the groups a user is in

Parameters
NameTypeDescription
$userid
Returns
TypeDescription
arrayids of groups
methodpublicgetGroupsByUserID( $userid) : array

getGroupsByUserID() Returns the groups a user is in

Parameters
NameTypeDescription
$userid
Returns
TypeDescription
arrayReal names of groups
methodpublicgetRealname( $userid,  $bAllowFallbackOnUsername = false) : string

getRealname() Returns the realname of the given userid

Parameters
NameTypeDescription
$userid
$bAllowFallbackOnUsername
Returns
TypeDescription
stringRealname if found, or emptry string if not.
methodpublicgetRealnameByUserName( $username) : string

getRealnameByUserName() Returns the realname of the given username

Parameters
NameTypeDescription
$username
Returns
TypeDescription
stringRealname if found, or emptry string if not.
methodpublicgetSystemAdmins(boolean $forceActive = false) : array

getSystemAdmins() Returns all system admins available in the system

Parameters
NameTypeDescription
$forceActiveboolean

forceActive Is forceActive true return only activ Sysadmins

Returns
TypeDescription
arrayArray with id and name entries
methodpublicgetUserProperties() : void

getUserProperties() Retrieves all available properties of the user

methodpublicgetUserPropertiesByType(string $sType, boolean $bGroup = false) : array

getUserPropertiesByType($type) Stores the modified user object to the database

Parameters
NameTypeDescription
$sTypestring

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

$bGroupboolean

bGroup Specifies if this function should recursively search in groups

Returns
TypeDescription
arrayThe value of the retrieved property
methodpublicgetUserProperty(string $type, string $name, boolean $group = false) : string

getUserProperty($type, $name) Stores the modified user object to the database

Parameters
NameTypeDescription
$typestring

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

$namestring

name Specifies the name of the property to retrieve

$groupboolean

group Specifies if this function should recursively search in groups

Returns
TypeDescription
stringThe value of the retrieved property
methodpublicgetUsername( $userid) : string

getUsername() Returns the username of the given userid

Parameters
NameTypeDescription
$userid
Returns
TypeDescription
stringUsername if found, or emptry string if not.
methodpublicloadUserByUserID( $userID) : bool

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

Parameters
NameTypeDescription
$userID
Returns
TypeDescription
boolTrue if the load was successful
methodpublicloadUserByUsername(string $username) : bool

loadUserByUsername($username) Loads a user from the database by its username

Parameters
NameTypeDescription
$usernamestring

Specifies the username

Returns
TypeDescription
boolTrue if the load was successful
methodpublicsetField(string $field, string $value) : void

setField($field, $value) Sets the value of a specific field

Parameters
NameTypeDescription
$fieldstring

Specifies the field to set

$valuestring

Specifies the value to set

methodpublicsetUserProperty(string $type, string $name, string $value) : void

setUserProperty($type, $name, $value) Stores a property to the database

Parameters
NameTypeDescription
$typestring

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

$namestring

name Specifies the name of the property to retrieve

$valuestring

value Specifies the value to insert

methodpublicstore() : void

store() Stores the modified user object to the database

\Users

Package: Default

Properties

>VPropertypublicobject $db
DB_Contenido instance
Details
Type
object
Access
private  
>VPropertypublicstring $table
Storage of the source table to use for the user informations
Details
Type
string
Access
private  

Methods

methodpublicUsers(string $table = "") : void

Constructor Function

Parameters
NameTypeDescription
$tablestring

The table to use as information source

methodpubliccreate(string $username) : int

create ($username) creates a new user by specifying its username

Parameters
NameTypeDescription
$usernamestring

Specifies the username

Returns
TypeDescription
intuserid of created user
methodpublicdeleteUserByID(string $userid) : bool

deleteUserByID ($userid) Removes the specified user from the database

Parameters
NameTypeDescription
$useridstring

Specifies the user ID

Returns
TypeDescription
boolTrue if the delete was successful
methodpublicdeleteUserByUsername( $username) : bool

deleteUserByUsername ($username) Removes the specified user from the database

Parameters
NameTypeDescription
$username
Returns
TypeDescription
boolTrue if the delete was successful
methodpublicgetAccessibleUsers( $perms,  $includeAdmins = false) : array

getAccessibleUsers Returns all users which are accessible by the current user

Parameters
NameTypeDescription
$perms
$includeAdmins
Returns
TypeDescription
arrayArray of user objects
Documentation was generated by phpDocumentor 2.0.0a12.