* @var array
*/
var $users ;
-
+
/**
* hash list of csv-users
* @var array
*/
var $cvs ;
-
+
/**
* filehandle for lockfile
* @var int
*/
var $fplock ;
-
+
/**
* locking state
* @var boolean
*/
var $locked ;
-
+
/**
* name of the lockfile
- * @var string
- */
+ * @var string
+ */
var $lockfile = './passwd.lock';
/**
* oft the lockfile, not of the passwd file! ( Swapping $lock and $lockfile would
* breaks bc to v1.3 and smaller).
* Don't forget to call close() to save changes!
- *
+ *
* @param $file name of the passwd file
* @param $lock if 'true' $lockfile will be locked
* @param $lockfile name of the temp file, where changes are saved
*
* @access public
- * @see close()
+ * @see close()
*/
function File_Passwd($file, $lock = 0, $lockfile = "") {
flock($this->fplock, LOCK_EX);
$this->locked = true;
}
-
+
$fp = fopen($file,'r') ;
if( !$fp ) {
return new PEAR_Error( "Couldn't open '$file'!", 1, PEAR_ERROR_RETURN) ;
if (empty($array[1])) $array[1]='';
$this->users[$user] = trim($array[1]);
if (count($array) >= 3)
- $this->cvs[$user] = trim($array[2]);
+ $this->cvs[$user] = trim($array[2]);
}
}
fclose($fp);
* @param $user user id
*
* @return mixed returns PEAR_Error, if the user doesn't exists
- * @access public
+ * @access public
*/
-
+
function delUser($user) {
if (isset($this->users[$user]) && $this->locked) {
unset($this->users[$user]);
unset($this->cvs[$user]);
} else {
- return new PEAR_Error( "Couldn't delete user '$user', because the user doesn't exists!", 3, PEAR_ERROR_RETURN) ;
+ return new PEAR_Error( "Couldn't delete user '$user', because the user doesn't exists!", 3, PEAR_ERROR_RETURN) ;
}
} // end func delUser()
* @param $pass password for user
*
* @return boolean true if password is ok
- * @access public
+ * @access public
*/
function verifyPassword($user, $pass) {
//if ($this->users[$user] == crypt($pass, substr($this->users[$user], 0, 2)))