Constructor
Requires the name of the passwd file. This functions opens the file and read it. Changes to this file will written first in the lock file, so it is still possible to access the passwd file by another programs. The lock parameter controls the locking oft the lockfile, not of the passwd file! (Swapping $lock and $lockfile would break BC). Don't forget to call close() to save changes!
File_Passwd
File_Passwd
($file $file, $lock $lock, [$lockfile $lockfile = ""])
-
$file
$file: name of the passwd file
-
$lock
$lock: if 'true' $lockfile will be locked
-
$lockfile
$lockfile: name of the temp file, where changes are saved
Adds a user
mixed
addUser
($user $user, $pass $pass, [$cvs $cvsuser = ""])
-
$user
$user: new user id
-
$pass
$pass: password for new user
-
$cvs
$cvsuser: cvs user id (needed for pserver passwd files)
Writes changes to passwd file and unlocks it
void
close
()
Deletes a user
mixed
delUser
($user $user)
Factory for new extensions
- Unix for standard Unix passwd files
- CVS for CVS pserver passwd files
- Authbasic for AuthUserFiles
- Authdigest for AuthDigestFiles
Returns a PEAR_Error if the desired class/file couldn't be loaded
object File_Passwd_$class
&factory
(string $class)
-
string
$class: the desired subclass of File_Passwd
Get the CVS username
string
getCvsUser
(string $user)
Determine if lockfile is locked
boolean
isLocked
()
Return all users from passwd file
array
listUsers
()
Lock the lockfile
void
lock
()
Modifies a user
mixed
modUser
($user $user, $pass $pass, [$cvs $cvsuser = ""])
-
$user
$user: user id
-
$pass
$pass: new password for user
-
$cvs
$cvsuser: cvs user id (needed for pserver passwd files)
Unlock the lockfile
void
unlock
()
Verifies a user's password
boolean
verifyPassword
($user $user, $pass $pass)
-
$user
$user: user id
-
$pass
$pass: password for user