auth verifyPassword suggestion

From: Date: Sun, 10 Aug 2003 22:41:48 +0000
Subject: auth verifyPassword suggestion
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19533@lists.php.net to get a copy of this message
The actual method verifyPassword of the Auth_Container Class uses the follow code to verify the existence of a crypt function: . . . default : if (function_exists($cryptType)) { return ($cryptType($password1) == $password2); } else { return false; } break; . . . I think it should check for a method too, cause I use an Class that extends Auth_Container as the container, and use a $cryptType = "mysql_encode_decode" that needs others parameters from the user. Should be something like this: default : if (method_exists($this,$cryptType)) { // check for a method first return ($this->$cryptType($password1) == $password2); } elseif (function_exists($cryptType)) { return ($cryptType($password1) == $password2); } else { return false; } break; the same goes for the addUser method. what about this?

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