File_Passwd_Unix::addUser()

File_Passwd_Unix::addUser() -- Add an user

Synopsis

mixed File_Passwd_Unix::addUser (string $user, string $pass [, array $extra = array()])

Описание

The username must start with an alphabetical character and must NOT contain any other characters than alphanumerics, the underline and dash.

If you use the 'name map' you should also use these naming in the supplied extra array, because your values would get mixed up if they are in the wrong order, which is always true if you DON'T use the 'name map'!

So be warned and USE the 'name map'!

If the passwd file is shadowed, the user will be added though, but with an 'x' as password, and a PEAR_Error will be returned, too.

Параметр

string $user

the name of the user to add

string $pass

the password of the user to add

array $extra

extra properties of user to add

Возвращаемое значение

Возвращает TRUE при удаче и PEAR_Error в обратном случае.

Таблица 38-1. Возможные значения PEAR_Error

Error CodeSummary
FILE_PASSWD_E_ALREADY_EXISTSuser already exists
FILE_PASSWD_E_INVALID_CHARSusername contains illegal characters
FILE_PASSWD_E_INVALID_CHARSany of the extra proporties contains a colon
FILE_PASSWD_E_INVALID_ENC_MODEactual encryption mode is not supported
FILE_PASSWD_E_UNDEFINEDif passwd file is shadowed

Заметка

Эта функция не должна вызываться статически.


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ