mixed addUser(
string
$user, string
$pass, [array
$extra = array()])
|
|
Add an user
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.
Returns a PEAR_Error if:
- user already exists
- user contains illegal characters
- encryption mode is not supported
- passwords are shadowed in another file
- any element of the $extra array contains a colon (':')
Parameters:
mixed modUser(
string
$user, [array
$properties = array()])
|
|
Modify properties of a certain user
- DON'T MODIFY THE PASSWORD WITH THIS METHOD!
You should use this method only if the 'name map' is used, too.
Returns a PEAR_Error if:
- user doesn't exist
- any property contains a colon (':')
Parameters:
Parse the Unix password file
Returns a PEAR_Error if passwd file has invalid format.
Overrides
File_Passwd_Common::parse() (Parse the content of the file)
mixed setMap(
[
$map = array()])
|
|
Set the 'name map' to use with the extra properties of the user
This map is used for naming the associative array of the extra properties.
Returns a PEAR_Error if $map was not of type array.
Parameters:
boolean useMap(
[boolean
$bool = null])
|
|
Whether to use the 'name map' of the extra properties or not
Default Unix passwd files look like:
user:password:user_id:group_id:gecos:home_dir:shell
The default 'name map' for properties except user and password looks like:
If you want to change the naming of the standard map use File_Passwd_Unix::setMap(array()).
Parameters: