Re: Patches for Class: File_Passwd

From: Date: Wed, 11 Apr 2001 21:23:56 +0000
Subject: Re: Patches for Class: File_Passwd
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-209@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 P.S. I think the default lock status in the constructor should be true: 32c32 < function File_Passwd($file,$lock=1) { - --- > function File_Passwd($file,$lock=0) { The logic in addUser expects a lock file ($this->locked) regardless if the user asked for one: function addUser($user,$pass,$cvsuser) { if(!isset($this->users[$user]) && $this->locked) { $this->users[$user] = crypt($pass); $this->cvs[$user] = $cvsuser; return true; } else { return false; } } However, the class variable locked ($this->locked) will only get set if the second constructor parameter is true (set to false by default). My point: If unsuspecting users do not pass the second constructor parameter because it is optional, but the class will never add new users because the $this->locked variable will not be set. My 0.02 Jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjrUy3AACgkQt0J81Q+7BCBIgwCgrKzX/zpkHtqjwDwJHCjiA8CA S6wAnjsBKdWvdycbv0uM8QMzwXXR18CB =ziY0 -----END PGP SIGNATURE-----

« previous php.pear.dev (#209) next »