cvs: pear /Auth package.xml /Auth/Container MDB.php MDB2.php

From: Date: Wed, 22 Feb 2006 00:14:51 +0000
Subject: cvs: pear /Auth package.xml /Auth/Container MDB.php MDB2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38480@lists.php.net to get a copy of this message
aashley Wed Feb 22 00:14:51 2006 UTC Modified files: /pear/Auth/Container MDB2.php MDB.php /pear/Auth package.xml Log: Whenever running commands against the database make sure the DB object is created before attempting to use it's quote features http://cvs.php.net/viewcvs.cgi/pear/Auth/Container/MDB2.php?r1=1.6&r2=1.7&diff_format=u Index: pear/Auth/Container/MDB2.php diff -u pear/Auth/Container/MDB2.php:1.6 pear/Auth/Container/MDB2.php:1.7 --- pear/Auth/Container/MDB2.php:1.6 Sun Jan 8 11:54:33 2006 +++ pear/Auth/Container/MDB2.php Wed Feb 22 00:14:51 2006 @@ -16,7 +16,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.6 2006/01/08 11:54:33 lsmith Exp $ +// $Id: MDB2.php,v 1.7 2006/02/22 00:14:51 aashley Exp $ // require_once 'Auth/Container.php'; @@ -30,7 +30,7 @@ * * @author Lorenzo Alberton <l.alberton@quipo.it> * @package Auth - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ */ class Auth_Container_MDB2 extends Auth_Container { @@ -341,6 +341,12 @@ function addUser($username, $password, $additional = "") { + // Prepare for a database query + $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'])) { @@ -392,6 +398,12 @@ */ function removeUser($username) { + // Prepare for a database query + $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'], @@ -417,6 +429,12 @@ */ function changePassword($username, $password) { + // Prepare for a database query + $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'])) { @@ -474,4 +492,4 @@ // }}} } -?> \ No newline at end of file +?> http://cvs.php.net/viewcvs.cgi/pear/Auth/Container/MDB.php?r1=1.20&r2=1.21&diff_format=u Index: pear/Auth/Container/MDB.php diff -u pear/Auth/Container/MDB.php:1.20 pear/Auth/Container/MDB.php:1.21 --- pear/Auth/Container/MDB.php:1.20 Sun Jan 8 11:54:11 2006 +++ pear/Auth/Container/MDB.php Wed Feb 22 00:14:51 2006 @@ -16,7 +16,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: MDB.php,v 1.20 2006/01/08 11:54:11 lsmith Exp $ +// $Id: MDB.php,v 1.21 2006/02/22 00:14:51 aashley Exp $ // require_once 'Auth/Container.php'; @@ -30,7 +30,7 @@ * * @author Lorenzo Alberton <l.alberton@quipo.it> * @package Auth - * @version $Revision: 1.20 $ + * @version $Revision: 1.21 $ */ class Auth_Container_MDB extends Auth_Container { @@ -343,6 +343,10 @@ */ function addUser($username, $password, $additional = "") { + $err = $this->_prepare(); + if ($err !== true) { + return PEAR::raiseError($err->getMessage(), $err->getCode()); + } if (isset($this->options['cryptType']) && $this->options['cryptType'] == 'none') { $cryptFunction = 'strval'; @@ -395,6 +399,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'], @@ -420,6 +429,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'])) { @@ -477,4 +491,4 @@ // }}} } -?> \ No newline at end of file +?> http://cvs.php.net/viewcvs.cgi/pear/Auth/package.xml?r1=1.73&r2=1.74&diff_format=u Index: pear/Auth/package.xml diff -u pear/Auth/package.xml:1.73 pear/Auth/package.xml:1.74 --- pear/Auth/package.xml:1.73 Tue Feb 21 23:49:31 2006 +++ pear/Auth/package.xml Wed Feb 22 00:14:51 2006 @@ -55,6 +55,8 @@ <![CDATA[ This is hopefully the final release candidate before 1.3.0. Please test. + * MDB & MDB2 Backends: Start DB object before using quoting features in all + functions. * Fixed Bug #6851: Double quotes caused by incorrect use of DB::quoteSmart() and developer being asleep at his computer. ]]>

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