CVS update: /cowiki/includes/cowiki/class/auth/

[email protected] 4 Jun 2005 13:38:51 -0000
Newsgroups gmane.comp.php.cowiki.cvs
Message-ID <[email protected]>
User: dgorski 
Date: 2005/06/04 06:38:51

Modified:
   cowiki/includes/cowiki/class/auth/class.AuthMySQL.php

Log:
 Fix error with Storage initialization

File Changes:

Directory: /cowiki/includes/cowiki/class/auth/
==============================================

File [changed]: class.AuthMySQL.php
Url: http://cowiki.tigris.org/source/browse/cowiki/includes/cowiki/class/auth/class.AuthMySQL.php?r1=1.15&r2=1.16
Delta lines:  +10 -6
--------------------
--- class.AuthMySQL.php	12 May 2005 18:40:21 -0000	1.15
+++ class.AuthMySQL.php	4 Jun 2005 13:38:49 -0000	1.16
@@ -2,7 +2,7 @@
 
 /**
  *
- * $Id: class.AuthMySQL.php,v 1.15 2005/05/12 18:40:21 dgorski Exp $
+ * $Id: class.AuthMySQL.php,v 1.16 2005/06/04 13:38:49 dgorski Exp $
  *
  * This file is part of coWiki. coWiki is free software under the terms of
  * the GNU General Public License (GPL). Read the LICENSE file. If you did
@@ -17,7 +17,7 @@
  * @author      Daniel T. Gorski, <[email protected]>
  * @copyright   (C) Daniel T. Gorski, {@link http://www.develnet.org}
  * @license     http://www.gnu.org/licenses/gpl.html
- * @version     $Revision: 1.15 $
+ * @version     $Revision: 1.16 $
  *
  */
 
@@ -54,12 +54,16 @@
     public function init() {
 
         $Registry = Registry::getInstance();
+        $UriInfo = new UriInfo($Registry->get('.AUTH_RESOURCE'));
 
         try {
-            $this->Storage = StorageFactory::getInstance();
-            $this->Storage->create(
-                new UriInfo($Registry->get('.AUTH_RESOURCE'))
-            );
+            $StorageFactory = StorageFactory::getInstance();
+
+            // This method does not select (use) the database ...
+            $this->Storage = $StorageFactory->create($UriInfo);
+
+            // ... we need to 'use database' here
+            $this->Storage->useDatabase($UriInfo->get('basepath'));
 
         } catch (StorageException $se) {
             RuntimeContext::getInstance()->addError(553);