Formatting MARC data | |
PEAR Manual | |
require_once 'File/Passwd.php'; |
mixed File_Passwd::staticAuth (
string $type
, string $file
, string $user
, string $pass
, mixed $opt = ''
)
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:
Unix, Cvs, Smb, Authbasic or Authdigest
path to passwd file
the user to authenticate
the plaintext password
Returns TRUE if authenticated, FALSE if not, or PEAR_Error on failure.
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) |
This function should be called statically.
Formatting MARC data | |
PEAR Manual | |