cvs: pear /File_Passwd/Passwd Authdigest.php

From: Date: Wed, 24 Sep 2003 10:02:47 +0000
Subject: cvs: pear /File_Passwd/Passwd Authdigest.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-13038@lists.php.net to get a copy of this message
mike Wed Sep 24 06:02:47 2003 EDT Modified files: /pear/File_Passwd/Passwd Authdigest.php Log: typo fixing, fixed a bug in listUserInRealm() Index: pear/File_Passwd/Passwd/Authdigest.php diff -u pear/File_Passwd/Passwd/Authdigest.php:1.3 pear/File_Passwd/Passwd/Authdigest.php:1.4 --- pear/File_Passwd/Passwd/Authdigest.php:1.3 Tue Sep 23 12:08:18 2003 +++ pear/File_Passwd/Passwd/Authdigest.php Wed Sep 24 06:02:46 2003 @@ -15,7 +15,7 @@ // | Author: Michael Wallner <mike@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Authdigest.php,v 1.3 2003/09/23 16:08:18 mike Exp $ +// $Id: Authdigest.php,v 1.4 2003/09/24 10:02:46 mike Exp $ /** * Manipulate AuthDigestFiles as used for HTTP Digest Authentication. @@ -57,7 +57,7 @@ * * @author Michael Wallner <mike@php.net> * @package File_Passwd -* @version $Revision: 1.3 $ +* @version $Revision: 1.4 $ * @access public */ class File_Passwd_Authdigest extends File_Passwd_Common { @@ -135,7 +135,7 @@ FILE_PASSWD_E_INVALID_CHARS ); } - if (!preg_match($this->_pcr, $realm)) { + if (!preg_match($this->_pcre, $realm)) { return PEAR::raiseError( sprintf(FILE_PASSWD_E_INVALID_CHARS_STR, 'Realm ', $realm), FILE_PASSWD_E_INVALID_CHARS @@ -152,22 +152,22 @@ * o associative array of users of ONE realm if $inRealm was supplied * <pre> * realm1 - * + user1 - * + user2 - * + user3 + * + user1 => pass + * + user2 => pass + * + user3 => pass * </pre> * o associative array of all realms with all users * <pre> * array * + realm1 => array - * + user1 - * + user2 - * + user3 + * + user1 => pass + * + user2 => pass + * + user3 => pass * + realm2 => array - * + user3 + * + user3 => pass * + realm3 => array - * + user1 - * + user2 + * + user1 => pass + * + user2 => pass * </pre> * * @access public @@ -177,7 +177,7 @@ */ function listUserInRealm($inRealm = ''){ $result = array(); - foreach ($this->_user as $user => $realms){ + foreach ($this->_users as $user => $realms){ foreach ($realms as $realm => $pass){ if (!empty($inRealm) && ($inRealm !== $realm)) { continue; @@ -185,7 +185,7 @@ if (!isset($result[$realm])) { $result[$realm] = array(); } - array_push($result[$realm], $user); + $result[$realm][$user] = $pass; } } return $result; @@ -285,7 +285,7 @@ function parse() { $this->_users = array(); foreach ($this->_contents as $line) { - $user = explode(':', $entry); + $user = explode(':', $line); if (count($user) != 3) { return PEAR::raiseError( FILE_PASSWD_E_INVALID_FORMAT_STR,

« previous php.pear.cvs (#13038) next »