File_Passwd_Authdigest::staticAuth()

File_Passwd_Authdigest::staticAuth() -- Fast authentication

Synopsis

require_once 'File/Passwd/Authdigest.php';

mixed File_Passwd_Authdigest::staticAuth (string $file, string $user, string $pass, string $realm)

Description

Static user authentication.

Parameter

string $file

path to passwd file

string $user

user to authenticate

string $pass

plaintext password

string $realm

the realm the user should be in

Return value

Returns TRUE if authenticated, FALSE if not or PEAR_Error on failure.

Table 37-1. Possible PEAR_Error values

Error CodeSummary
FILE_PASSWD_E_NOT_EXISTSpasswd file doesn't exist
FILE_PASSWD_E_FILE_NOT_OPENEDpasswd file couldn't be opened in read mode
FILE_PASSWD_E_FILE_NOT_LOCKEDpasswd file couldn't be locked shared
FILE_PASSWD_E_FILE_NOT_UNLOCKEDpasswd file couldn't be unlocked (only if auth fails)
FILE_PASSWD_E_FILE_NOT_CLOSEDpasswd file couldn't be closed (only if auth fails)

Note

This function should be called statically.