Source for file File.php
Documentation is available at File.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Stefan Ekman <stekman@sedata.org> |
// | Martin Jansen <mj@php.net> |
// | Mika Tuupola <tuupola@appelsiini.net> |
// +----------------------------------------------------------------------+
// $Id: File.php,v 1.16 2004/07/03 17:39:22 yavo Exp $
require_once "File/Passwd.php";
require_once "Auth/Container.php";
* Storage driver for fetching login data from an encrypted password file.
* This storage container can handle CVS pserver style passwd files.
* @author Stefan Ekman <stekman@sedata.org>
* @author Michael Wallner <mike@php.net>
* @version $Revision: 1.16 $
* Constructor of the container class
* @param string $filename path to passwd file
* @return object Auth_Container_File new Auth_Container_File object
// Only file is a valid option here
$filename = $filename['file'];
* @return mixed boolean|PEAR_Error
return File_Passwd ::staticAuth ('Cvs', $this->pwfile, $user, $pass);
* List all available users
$pw_obj = &$this->_load ();
if (PEAR ::isError ($pw_obj)) {
$users = $pw_obj->listUser ();
foreach ($users as $key => $value) {
$retVal[] = array ("username" => $key,
"password" => $value['passwd'],
"cvsuser" => $value['system']);
* Add a new user to the storage container
* @param mixed CVS username
function addUser($user, $pass, $additional= '')
$cvs = (string) (is_array($additional) && isset ($additional['cvsuser'])) ?
$additional['cvsuser'] : $additional;
$pw_obj = &$this->_load ();
if (PEAR ::isError ($pw_obj)) {
$res = $pw_obj->addUser ($user, $pass, $cvs);
if (PEAR ::isError ($res)) {
if (PEAR ::isError ($res)) {
* Remove user from the storage container
$pw_obj = &$this->_load ();
if (PEAR ::isError ($pw_obj)) {
$res = $pw_obj->delUser ($user);
if (PEAR ::isError ($res)) {
if (PEAR ::isError ($res)) {
* Change password for user in the storage container
* @param string The new password
$pw_obj = &$this->_load ();
if (PEAR ::isError ($pw_obj)) {
$res = $pw_obj->changePasswd ($user, $pass);
if (PEAR ::isError ($res)) {
if (PEAR ::isError ($res)) {
* Load and initialize the File_Passwd object
* @return object File_Passwd_Cvs|PEAR_Error
$pw_obj = File_Passwd ::factory ('Cvs');
if (PEAR ::isError ($pw_obj)) {
$pw_obj->setFile ($this->pwfile);
if (PEAR ::isError ($res)) {
Documentation generated on Mon, 11 Mar 2019 13:52:32 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|