File_Passwd

File_Passwd --  provides functions for manage passwd-style files

passwd-style files

passwd-style means, the file has a format like this:
user:password

The temporary file

File_Passwd reads the existing password file, copies the content into a temporary file. All changes, you do with the provided functions only influence this copy. First, when you call close() the copy will renamed to the password file.

File_Passwd::File_Passwd

void File_Passwd::File_Passwd ([string $file boolean $lock string $lockfile]])

Requires the name of the password 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 of the lockfile, not of the passwd file! (Swapping $lock and $lockfile would breaks bc to v1.3 and smaller).

Parameter

File_Passwd::addUser

mixed File_Passwd::addUser ([string $user string $pass string $cvsuser])

Adds a user to the file

Parameter

Returns

File_Passwd::modUser

mixed File_Passwd::modUser ([string $user string $pass string $cvsuser])

Modify a user in the file

Parameter

Returns

File_Passwd::delUser

mixed File_Passwd::delUser (string $user)

Deletes a user in the file

Parameter

Returns

File_Passwd::verifyPassword

boolean File_Passwd::verifyPassword (string $user string $pass)

Verifies a user's password

Parameter

Returns

File_Passwd::close

void File_Passwd::close ()

Writes changes to passwd file and unlocks it.