Class File_Passwd_Cvs

Description

Manipulate CVS pserver passwd files.

A line of a CVS pserver passwd file consists of 2 to 3 colums:

   user1:1HCoDDWxK9tbM:sys_user1
   user2:0O0DYYdzjCVxs
   user3:MIW9UUoifhqRo:sys_user2
 

If the third column is specified, the CVS user named in the first column is mapped to the corresponding system user named in the third column. That doesn't really affect us - just for your interest :)

Output of listUser()

      array
       + user =>  array
                   + passwd => crypted_passwd
                   + system => system_user
       + user =>  array
                   + passwd => crypted_passwd
                   + system => system_user
 

Located in Program_Root/Passwd/Cvs.php (line 56)

File_Passwd_Common
   |
   --File_Passwd_Cvs
Method Summary
 File_Passwd_Cvs File_Passwd_Cvs ([mixed $file = 'passwd'])
 mixed addUser (string $user, string $pass, [string $system_user = ''])
 mixed changePasswd (mixed $user, mixed $pass)
 mixed changeSysUser (mixed $user, mixed $system)
 mixed parse ()
 mixed save ()
 mixed verifyPasswd (string $user, string $pass)
 string _genPass (string $pass, [string $salt = null])
Variables
Methods
Constructor File_Passwd_Cvs (line 63)

Constructor

  • access: public
File_Passwd_Cvs File_Passwd_Cvs ([mixed $file = 'passwd'])
addUser (line 130)

Add an user

The username must start with an alphabetical character and must NOT contain any other characters than alphanumerics, the underline and dash.

Returns a PEAR_Error if:

  • user already exists
  • user or system_user contains illegal characters

  • return: true on success or PEAR_Error
  • access: public
  • throws: PEAR_Error
mixed addUser (string $user, string $pass, [string $system_user = ''])
  • string $user: the name of the user to add
  • string $pass: the password of the user tot add
  • string $system_user: the systemuser this user maps to
changePasswd (line 176)

Change the password of a certain user

Returns a PEAR_Error if user doesn't exist.

  • return: true on success or PEAR_Error
  • access: public
  • throws: PEAR_Error
mixed changePasswd (mixed $user, mixed $pass)
changeSysUser (line 195)

Change the corresponding system user of a certain cvs user

Returns a PEAR_Error if:

  • user doesn't exist
  • system user contains illegal characters

  • return: true on success or PEAR_Error
  • access: public
  • throws: PEAR_Error
mixed changeSysUser (mixed $user, mixed $system)
parse (line 98)

Parse the CVS passwd file

Returns a PEAR_Error if passwd file has invalid format.

  • return: true on success or PEAR_Error
  • access: public
  • throws: PEAR_Error
mixed parse ()

Redefinition of:
File_Passwd_Common::parse()
Parse the content of the file
save (line 81)

Apply changes and rewrite CVS passwd file

Returns a PEAR_Error if:

  • directory in which the file should reside couldn't be created
  • file couldn't be opened in write mode
  • file couldn't be locked exclusively
  • file couldn't be unlocked
  • file couldn't be closed

  • return: true on success or PEAR_Error
  • access: public
  • throws: PEAR_Error
mixed save ()

Redefinition of:
File_Passwd_Common::save()
Apply changes and rewrite passwd file
verifyPasswd (line 159)

Verify the password of a certain user

Returns a PEAR_Error if the user doesn't exist.

  • return: true if passwords equal, false ifthe don't or PEAR_Error
  • access: public
  • throws: PEAR_Error
mixed verifyPasswd (string $user, string $pass)
  • string $user: user whose password should be verified
  • string $pass: the plaintext password that should be verified
_genPass (line 217)

Generate crypted password

  • return: the crypted password
  • access: public
  • throws: PEAR_Error
string _genPass (string $pass, [string $salt = null])
  • string $pass: new plaintext password
  • string $salt: new crypted password from which to gain the salt

Inherited Methods

Inherited From File_Passwd_Common

File_Passwd_Common::delUser()
File_Passwd_Common::getFile()
File_Passwd_Common::listUser()
File_Passwd_Common::load()
File_Passwd_Common::parse()
File_Passwd_Common::save()
File_Passwd_Common::setFile()
File_Passwd_Common::userExists()
File_Passwd_Common::_close()
File_Passwd_Common::_open()
File_Passwd_Common::_save()
File_Passwd_Common::__clone()
File_Passwd_Common::__construct()

Documention generated on Sat, 20 Sep 2003 16:14:42 +0200 by phpDocumentor 1.2.1