UNB Components Code Reference

UnbUser::Create method

Creates a new user instance.

public static function UnbUser::Create ($displayName = null, $loginName = null, $loginPassword = null, $newId = null, $copyDefaultSettings = false);

Parameters

displayName  –  optional, default: null
(string) New user's display name or null (max. 255 characters)
loginName  –  optional, default: null
(string) New user's login name or null (max. 255 characters)
loginPassword  –  optional, default: null
(string) New user's login password or null (used with loginName)
newId  –  optional, default: null
(int) Use this ID for the new user instead of automatically generating one. This is meant to be used for setup and maintenance only!
copyDefaultSettings  –  optional, default: false
(bool) Copy the default user settings to the newly created user

Return value

the newly created UnbUser object

Remarks

The newly created user instance is also stored in the database.

If a user ID is automatically generated, a random number of KeyLength decimal digits is generated. If the new ID is not unique, it will be retried 50 times before the process fails.

Exceptions thrown

InvalidArgumentException No description available.
LengthException No description available.
UnbSecurityException If the display or login name are already assigned.
UnbDatabaseException No description available.

Uses data

UnbUser::KeyLength

Member of class: UnbUser

Implementation file: user.class.php, line 124

© 2010 Yves Goergen. UNB Components Homepage. Reference generated on 2010-03-07.