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 = "") : voidConstructor Function
| Name | Type | Description |
|---|---|---|
| $table | string | The table to use as information source |

deleteUserProperty(string $type, string $name) : voiddeleteUserProperty($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") : arraygetAvailableUsers() Returns all users available in the system
| Name | Type | Description |
|---|---|---|
| $sort |
| Type | Description |
|---|---|
| array | Array with id and name entries |

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

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

getField(string $field) : mixedgetField($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) : arraygetGroupIDsByUserID() Returns the groups a user is in
| Name | Type | Description |
|---|---|---|
| $userid |
| Type | Description |
|---|---|
| array | ids of groups |

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

getRealname( $userid, $bAllowFallbackOnUsername = false) : stringgetRealname() 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) : stringgetRealnameByUserName() 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) : arraygetSystemAdmins() 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) : arraygetUserPropertiesByType($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) : stringgetUserProperty($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) : stringgetUsername() Returns the username of the given userid
| Name | Type | Description |
|---|---|---|
| $userid |
| Type | Description |
|---|---|
| string | Username if found, or emptry string if not. |

loadUserByUserID( $userID) : boolloadUserByUserID($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) : boolloadUserByUsername($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) : voidsetField($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) : voidsetUserProperty($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 = "") : voidConstructor Function
| Name | Type | Description |
|---|---|---|
| $table | string | The table to use as information source |

create(string $username) : intcreate ($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) : booldeleteUserByID ($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) : booldeleteUserByUsername ($username) Removes the specified user from the database
| Name | Type | Description |
|---|---|---|
| $username |
| Type | Description |
|---|---|
| bool | True if the delete was successful |