contenido\classes\class.user.php
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
- Author
- Timo A. Hummel
- Copyright
- four for business 2003
- Version
- 1.0
Properties


string $table
- Type
- string
- Access
- private
Methods


User(string $table = "") : void
Constructor Function
Name | Type | Description |
---|---|---|
$table | string | The table to use as information source |


deleteUserProperty(string $type, string $name) : void
deleteUserProperty($type, $name) Deletes a user property from the table
Name | Type | Description |
---|---|---|
$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( $sort = "ORDER BY realname ASC") : array
getAvailableUsers() Returns all users available in the system
Name | Type | Description |
---|---|---|
$sort |
Type | Description |
---|---|
array | Array with id and name entries |


getClientAdmins( $client) : array
getClientAdmins() Returns all system admins available in the system
Name | Type | Description |
---|---|---|
$client |
Type | Description |
---|---|
array | Array with id and name entries |


getEffectiveUserPerms() : string
Function returns effective perms for user including group rights as perm string
Type | Description |
---|---|
string | - current users permissions |
- Author
- Timo Trautmann


getField(string $field) : mixed
getField($field) Gets the value of a specific field
Name | Type | Description |
---|---|---|
$field | string | Specifies the field to retrieve |
Type | Description |
---|---|
mixed | Value of the field |


getGroupIDsByUserID( $userid) : array
getGroupIDsByUserID() Returns the groups a user is in
Name | Type | Description |
---|---|---|
$userid |
Type | Description |
---|---|
array | ids of groups |


getGroupsByUserID( $userid) : array
getGroupsByUserID() Returns the groups a user is in
Name | Type | Description |
---|---|---|
$userid |
Type | Description |
---|---|
array | Real names of groups |


getRealname( $userid, $bAllowFallbackOnUsername = false) : string
getRealname() Returns the realname of the given userid
Name | Type | Description |
---|---|---|
$userid | ||
$bAllowFallbackOnUsername |
Type | Description |
---|---|
string | Realname if found, or emptry string if not. |


getRealnameByUserName( $username) : string
getRealnameByUserName() Returns the realname of the given username
Name | Type | Description |
---|---|---|
$username |
Type | Description |
---|---|
string | Realname if found, or emptry string if not. |


getSystemAdmins(boolean $forceActive = false) : array
getSystemAdmins() Returns all system admins available in the system
Name | Type | Description |
---|---|---|
$forceActive | boolean | forceActive Is forceActive true return only activ Sysadmins |
Type | Description |
---|---|
array | Array with id and name entries |


getUserPropertiesByType(string $sType, boolean $bGroup = false) : array
getUserPropertiesByType($type) Stores the modified user object to the database
Name | Type | Description |
---|---|---|
$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 |
Type | Description |
---|---|
array | The value of the retrieved property |


getUserProperty(string $type, string $name, boolean $group = false) : string
getUserProperty($type, $name) Stores the modified user object to the database
Name | Type | Description |
---|---|---|
$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 |
Type | Description |
---|---|
string | The value of the retrieved property |


getUsername( $userid) : string
getUsername() Returns the username of the given userid
Name | Type | Description |
---|---|---|
$userid |
Type | Description |
---|---|
string | Username if found, or emptry string if not. |


loadUserByUserID( $userID) : bool
loadUserByUserID($userID) Loads a user from the database by its userID
Name | Type | Description |
---|---|---|
$userID |
Type | Description |
---|---|
bool | True if the load was successful |


loadUserByUsername(string $username) : bool
loadUserByUsername($username) Loads a user from the database by its username
Name | Type | Description |
---|---|---|
$username | string | Specifies the username |
Type | Description |
---|---|
bool | True if the load was successful |


setField(string $field, string $value) : void
setField($field, $value) Sets the value of a specific field
Name | Type | Description |
---|---|---|
$field | string | Specifies the field to set |
$value | string | Specifies the value to set |


setUserProperty(string $type, string $name, string $value) : void
setUserProperty($type, $name, $value) Stores a property to the database
Name | Type | Description |
---|---|---|
$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 |
\Users
Properties
Methods


Users(string $table = "") : void
Constructor Function
Name | Type | Description |
---|---|---|
$table | string | The table to use as information source |


create(string $username) : int
create ($username) creates a new user by specifying its username
Name | Type | Description |
---|---|---|
$username | string | Specifies the username |
Type | Description |
---|---|
int | userid of created user |


deleteUserByID(string $userid) : bool
deleteUserByID ($userid) Removes the specified user from the database
Name | Type | Description |
---|---|---|
$userid | string | Specifies the user ID |
Type | Description |
---|---|
bool | True if the delete was successful |


deleteUserByUsername( $username) : bool
deleteUserByUsername ($username) Removes the specified user from the database
Name | Type | Description |
---|---|---|
$username |
Type | Description |
---|---|
bool | True if the delete was successful |