PEAR Manual
Prev |  | Next

# File_Passwd_Authbasic::addUser()

File_Passwd_Authbasic::addUser() -- Add an user

## Synopsis

``mixed File_Passwd_Authbasic::addUser` (string $user, string $pass)`

## Description

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

## Parameter

string `$user`

  username

string `$pass`

  plaintext password

## Return value

Returns `TRUE` on success, PEAR_Error on failure.

Table 37-1. Possible PEAR_Error values

Error Code | Summary
--- | ---
FILE_PASSWD_E_EXISTS_ALREADY | the user to add already exists
FILE_PASSWD_E_INVALID_CHARS | the username to add contains illegal characters

## Note

This function can not be called statically.

Prev | Home | Next
File_Passwd_Authbasic::save() | Up | File_Passwd_Authbasic::changePasswd()