File_Passwd
[ class tree: File_Passwd ] [ index: File_Passwd ] [ all elements ]

Class: File_Passwd_Cvs

Source Location: /File_Passwd-1.1.7/Passwd/Cvs.php

Class Overview

File_Passwd_Common
   |
   --File_Passwd_Cvs

Manipulate CVS pserver passwd files.


Author(s):

Version:

  • $Revision: 1.14 $

Methods


Inherited Variables

Inherited Methods

Class: File_Passwd_Common

File_Passwd_Common::__construct()
Constructor (ZE2)
File_Passwd_Common::delUser()
Delete a certain user
File_Passwd_Common::getFile()
Get path of passwd file
File_Passwd_Common::listUser()
List user
File_Passwd_Common::load()
Loads the file
File_Passwd_Common::parse()
Parse the content of the file
File_Passwd_Common::save()
Apply changes and rewrite passwd file
File_Passwd_Common::setFile()
Set path to passwd file
File_Passwd_Common::userExists()
Check if a certain user already exists
File_Passwd_Common::_auth()
Base method for File_Passwd::staticAuth()
File_Passwd_Common::_close()
Closes a prior opened and locked file handle
File_Passwd_Common::_open()
Opens a file, locks it exclusively and returns the filehandle
File_Passwd_Common::_save()
Save the modified content to the passwd file

Class Details

[line 61]
Manipulate CVS pserver passwd files.

<u> A line of a CVS pserver passwd file consists of 2 to 3 colums: </u>

   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 :)

<u>Output of listUser()</u>

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

  • Author: Michael Wallner <mike@php.net>
  • Version: $Revision: 1.14 $
  • Access: public


[ Top ]


Method Detail

File_Passwd_Cvs (Constructor)   [line 68]

File_Passwd_Cvs File_Passwd_Cvs( [ $file = 'passwd'])

Constructor
  • Access: public

Parameters:

   $file   — 

[ Top ]

addUser   [line 174]

mixed addUser( string $user, string $pass, [string $system_user = ''])

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
  • Throws: PEAR_Error
  • Access: public

Parameters:

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

[ Top ]

changePasswd   [line 236]

mixed changePasswd( $user, $pass)

Change the password of a certain user

Returns a PEAR_Error if user doesn't exist.

  • Return: true on success or PEAR_Error
  • Throws: PEAR_Error
  • Access: public

Parameters:

   $user   — 
   $pass   — 

[ Top ]

changeSysUser   [line 259]

mixed changeSysUser( $user, $system)

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
  • Throws: PEAR_Error
  • Access: public

Parameters:

   $user   — 
   $system   — 

[ Top ]

generatePasswd   [line 290]

string generatePasswd( string $pass, [string $salt = null])

Generate crypted password
  • Return: the crypted password
  • Access: public

Parameters:

string   $pass   —  new plaintext password
string   $salt   —  new crypted password from which to gain the salt

[ Top ]

parse   [line 136]

mixed parse( )

Parse the CVS passwd file

Returns a PEAR_Error if passwd file has invalid format.

  • Return: true on success or PEAR_Error
  • Throws: PEAR_Error
  • Access: public

Overrides File_Passwd_Common::parse() (Parse the content of the file)
[ Top ]

save   [line 114]

mixed save( )

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
  • Throws: PEAR_Error
  • Access: public

Overrides File_Passwd_Common::save() (Apply changes and rewrite passwd file)
[ Top ]

staticAuth   [line 90]

mixed staticAuth( string $file, string $user, string $pass)

Fast authentication of a certain user

Returns a PEAR_Error if:

  • file doesn't exist
  • file couldn't be opened in read mode
  • file couldn't be locked exclusively
  • file couldn't be unlocked (only if auth fails)
  • file couldn't be closed (only if auth fails)

  • Return: true if authenticated, false if not or PEAR_Error
  • Access: public

Parameters:

string   $file   —  path to passwd file
string   $user   —  user to authenticate
string   $pass   —  plaintext password

[ Top ]

verifyPasswd   [line 215]

mixed verifyPasswd( string $user, string $pass)

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
  • Throws: PEAR_Error
  • Access: public

Parameters:

string   $user   —  user whose password should be verified
string   $pass   —  the plaintext password that should be verified

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:28:09 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.