Static user autentication.
Though this approach should be reasonable fast, it is NOT with APR compatible MD5 encryption used for htpasswd style password files encrypted in MD5.
Generating one MD5 password takes about 0.25 seconds!
Depending on $type, $opt should be:
Smb:
encryption method (NT or LM) |
Unix:
encryption method (des or md5) |
Authbasic:
encryption method (des, sha or md5) |
Authdigest:
the realm the user is in |
Cvs:
n/a (empty) |
Custom:
array of 2 elements: encryption function and delimiter |
Unix, Cvs, Smb, Authbasic or Authdigest
path to passwd file
the user to authenticate
the plaintext password
Smb:
nt | lm |
Unix:
des | md5 |
Authbasic:
des | sha | md5 |
Authdigest:
the realm the user is in |
Cvs:
n/a (empty) |
Custom:
array of 2 elements: encryption function and delimiter |
Returns TRUE if authenticated, FALSE if not, or PEAR_Error on failure.
Table 37-1. Possible PEAR_Error values
Error Code | Summary |
---|---|
FILE_PASSWD_E_NOT_EXISTS | passwd file doesn't exist |
FILE_PASSWD_E_FILE_NOT_OPENED | passwd file couldn't be opened in read mode |
FILE_PASSWD_E_FILE_NOT_LOCKED | passwd file couldn't be locked shared |
FILE_PASSWD_E_FILE_NOT_UNLOCKED | passwd file couldn't be unlocked (only if auth fails) |
FILE_PASSWD_E_FILE_NOT_CLOSED | passwd file couldn't be closed /only if auth fails) |
FILE_PASSWD_E_UNDEFINED | if class/file couldn't be loaded |
FILE_PASSWD_E_INVALID_ENC_MODE | supplied encryption mode is not supported |
FILE_PASSWD_E_USER_NOT_IN_REALM | user doesn't exist in this realm (only File_Passwd_Authdigest) |