cvs: pear /Auth/Container DB.php
| From: | Adam AShley | Date: | Tue, 21 Feb 2006 06:22:39 +0000 |
| Subject: | cvs: pear /Auth/Container DB.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38434@lists.php.net to get a copy of this message | ||
aashley Tue Feb 21 06:22:39 2006 UTC
Modified files:
/pear/Auth/Container DB.php
Log:
Whenever Auth_Container_DB attempts to change the database make sure the connection/DB object
exist and are correct before attempting to use the DB quoting features
http://cvs.php.net/viewcvs.cgi/pear/Auth/Container/DB.php?r1=1.55&r2=1.56&diff_format=u
Index: pear/Auth/Container/DB.php
diff -u pear/Auth/Container/DB.php:1.55 pear/Auth/Container/DB.php:1.56
--- pear/Auth/Container/DB.php:1.55 Tue Feb 21 01:00:19 2006
+++ pear/Auth/Container/DB.php Tue Feb 21 06:22:38 2006
@@ -16,7 +16,7 @@
// | Authors: Martin Jansen <mj@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: DB.php,v 1.55 2006/02/21 01:00:19 aashley Exp $
+// $Id: DB.php,v 1.56 2006/02/21 06:22:38 aashley Exp $
//
require_once 'Auth/Container.php';
@@ -30,7 +30,7 @@
*
* @author Martin Jansen <mj@php.net>
* @package Auth
- * @version $Revision: 1.55 $
+ * @version $Revision: 1.56 $
*/
class Auth_Container_DB extends Auth_Container
{
@@ -396,6 +396,11 @@
*/
function removeUser($username)
{
+ $err = $this->_prepare();
+ if ($err !== true) {
+ return PEAR::raiseError($err->getMessage(), $err->getCode());
+ }
+
$query = sprintf("DELETE FROM %s WHERE %s = '%s'",
$this->options['table'],
$this->options['usernamecol'],
@@ -419,6 +424,11 @@
*/
function changePassword($username, $password)
{
+ $err = $this->_prepare();
+ if ($err !== true) {
+ return PEAR::raiseError($err->getMessage(), $err->getCode());
+ }
+
if (isset($this->options['cryptType']) &&
$this->options['cryptType'] == 'none') {
$cryptFunction = 'strval';
} elseif (isset($this->options['cryptType']) &&
function_exists($this->options['cryptType'])) {