Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2010-06-27 08:47:40 +0400
committerrobocoder <anthon.pang@gmail.com>2010-06-27 08:47:40 +0400
commit41d0347c1b63667b723682bfa6f0474f55266d1b (patch)
tree0a2f109f6241bbb512032b7c7ffabf9c1be8241f /libs/Zend/Auth
parentd5e8e34ad81b18614a45dfe1edc9922015c73b72 (diff)
fixes #1449
git-svn-id: http://dev.piwik.org/svn/trunk@2386 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'libs/Zend/Auth')
-rw-r--r--libs/Zend/Auth/Adapter/DbTable.php36
1 files changed, 31 insertions, 5 deletions
diff --git a/libs/Zend/Auth/Adapter/DbTable.php b/libs/Zend/Auth/Adapter/DbTable.php
index 30bbd2478d..efad58f29b 100644
--- a/libs/Zend/Auth/Adapter/DbTable.php
+++ b/libs/Zend/Auth/Adapter/DbTable.php
@@ -17,7 +17,7 @@
* @subpackage Adapter
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: DbTable.php 20096 2010-01-06 02:05:09Z bkarwin $
+ * @version $Id: DbTable.php 22458 2010-06-18 22:47:46Z ralph $
*/
@@ -118,17 +118,17 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
/**
* __construct() - Sets configuration options
*
- * @param Zend_Db_Adapter_Abstract $zendDb
+ * @param Zend_Db_Adapter_Abstract $zendDb If null, default database adapter assumed
* @param string $tableName
* @param string $identityColumn
* @param string $credentialColumn
* @param string $credentialTreatment
* @return void
*/
- public function __construct(Zend_Db_Adapter_Abstract $zendDb, $tableName = null, $identityColumn = null,
+ public function __construct(Zend_Db_Adapter_Abstract $zendDb = null, $tableName = null, $identityColumn = null,
$credentialColumn = null, $credentialTreatment = null)
{
- $this->_zendDb = $zendDb;
+ $this->_setDbAdapter($zendDb);
if (null !== $tableName) {
$this->setTableName($tableName);
@@ -148,6 +148,32 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
}
/**
+ * _setDbAdapter() - set the database adapter to be used for quering
+ *
+ * @param Zend_Db_Adapter_Abstract
+ * @throws Zend_Auth_Adapter_Exception
+ * @return Zend_Auth_Adapter_DbTable
+ */
+ protected function _setDbAdapter(Zend_Db_Adapter_Abstract $zendDb = null)
+ {
+ $this->_zendDb = $zendDb;
+
+ /**
+ * If no adapter is specified, fetch default database adapter.
+ */
+ if(null === $this->_zendDb) {
+ // require_once 'Zend/Db/Table/Abstract.php';
+ $this->_zendDb = Zend_Db_Table_Abstract::getDefaultAdapter();
+ if (null === $this->_zendDb) {
+ // require_once 'Zend/Auth/Adapter/Exception.php';
+ throw new Zend_Auth_Adapter_Exception('No database adapter present');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
* setTableName() - set the table name to be used in the select query
*
* @param string $tableName
@@ -305,7 +331,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
$dbSelect = $this->_authenticateCreateSelect();
$resultIdentities = $this->_authenticateQuerySelect($dbSelect);
- if ( ($authResult = $this->_authenticateValidateResultset($resultIdentities)) instanceof Zend_Auth_Result) {
+ if ( ($authResult = $this->_authenticateValidateResultSet($resultIdentities)) instanceof Zend_Auth_Result) {
return $authResult;
}