UNB Components Code Reference

UnbUser class

The user class represents a single user in the UNB system and provides methods to find and manipulate user instances.

It depends on the UnbDatabase class for a database connection.

Extends class

UnbEntity

Public methods

   AddAdditionalKey

Assigns an additional key to this user.

S Create

Creates a new user instance.

   Delete

Deletes this instance of the user with all its references.

S Find

Finds all non-system user accounts.

S FindByDisplayName

Finds a user instance by its display name.

S FindByLoginName

Finds a user instance by its login name.

S FindByUserId

Finds a user instance by its user ID.

   GetAdditionalKeys

Gets all additional keys assigned to this user.

   GetCreatedTime

Gets the time when the user was created.

   GetDisplayName

Gets the display name.

   GetDisplayNameOrId

Gets the display name, if set, or the user ID.

   GetLastLoginTime

Gets the time when the user has last logged in.

   GetLoginName

Gets the login name.

   GetLoginPassword

Gets the login password hash.

   GetMessagesRating

Gets the overall rating of all messages from this user.

S GetNonListKeys

Gets an array of keys that must not be added to a key list.

   GetSettings

Gets all or the selected configuration entries for this user.

   GetSingleSetting

Gets one single configuration entry for this user.

   GetUserId

Gets the user ID.

   GetVcardEntries

Gets all or the selected vcard entries for this user.

   IsAdministrator

Gets a value indicating whether this user is an administrator.

   IsModerator

Gets a value indicating whether this user is a moderator.

S IsSecurePassword

Validates a password against the secure password policy.

   IsTrusted

Gets a value indicating whether this user is called "trusted".

S PrepDisplayName

Prepares the specified display name for use in a uniqueness test or for sorting.

   RemoveAdditionalKey

Divests an additional key from this user.

   RemoveSetting

Removes a configuration setting for this user.

   RemoveVcardEntry

Removes a vcard entry for this user.

   SetAdditionalKeys

Sets all additional keys for this user. This removes any keys set before.

   SetDisplayName

Sets the display name and stores it in the database.

   SetLoginName

Sets the login name and stores it in the database.

   SetLoginPassword

Sets the login password and stores it in the database.

   SetSetting

Sets one or multiple configuration entries for this user.

   SetVcardEntry

Sets a vcard entry for this user.

   UpdateLastLoginTime

Sets the last login time to now.

Protected methods

S FromRecord

Creates a UnbUser object from a database record array.

Private methods

   Class constructor No description available.
S AddToCache

Adds the user to the internal cache.

S ClearCache

Clears the internal cache.

S GetFromCache

Gets an item from the internal cache.

Private fields

additionalKeys  –  default: null

Cached additional keys list

createdTime  –  default: 0

Time when this user was created (UNIX timestamp)

db

Cached UnbDatabase instance

displayName  –  default: ''

Display name, used to identify user keys

displayNameCache  –  default: array()

Cached user objects by their requested display name, if set

idCache  –  default: array()

Cached user objects by their requested user ID

lastLoginTime  –  default: ''

Time when this user has last logged in

loginName  –  default: ''

Login name

loginPassword  –  default: ''

Login password

userId  –  default: 0

User ID, also called "key"

Constants

KeyLength 5

Length of new user ID numbers (decimal digits). This must be in the range of 2...9. The key length is used to generate new user IDs. Any length of user IDs is compatible, so the key length can be changed at any time. When you're running out of keys, increasing the key length is recommended. Longer keys have no worse performance than shorter keys, they just... "look longer".

File: user.class.php, line 55
RequireSecurePassword false

Determines whether a secure password is required for users.

File: user.class.php, line 58

Implementation file: user.class.php, line 48

© 2011 Yves Goergen. UNB Components Homepage. Reference generated on 2011-02-22.