even more fixes, seems to work now => validate more email addresses per account
authorroot <root@cacert1-mgr.it-sls.de>
Wed, 18 Aug 2010 13:13:32 +0000 (15:13 +0200)
committerroot <root@cacert1-mgr.it-sls.de>
Wed, 18 Aug 2010 13:13:32 +0000 (15:13 +0200)
manager/application/configs/application.ini.ca-mgr1 [new file with mode: 0644]
manager/application/controllers/MailController.php
manager/library/CAcert/User/Emails.php

diff --git a/manager/application/configs/application.ini.ca-mgr1 b/manager/application/configs/application.ini.ca-mgr1
new file mode 100644 (file)
index 0000000..4db026b
--- /dev/null
@@ -0,0 +1,57 @@
+[production]\r
+phpSettings.display_startup_errors = 1\r
+phpSettings.display_errors = 1\r
+includePaths.library = LIBRARY_PATH\r
+bootstrap.path = APPLICATION_PATH "/Bootstrap.php"\r
+bootstrap.class = "Bootstrap"\r
+resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"\r
+resources.frontController.noViewRenderer = 0\r
+resources.frontController.noErrorHandler = 0\r
+resources.frontController.useDefaultControllerAlways = 0\r
+resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"\r
+resources.view[] =\r
+autoloadernamespaces.0 = "CAcert_"\r
+\r
+; Database settings for Session DB\r
+ca_mgr.db.session.pdo                          = "Pdo_Mysql"\r
+ca_mgr.db.session.autocleanup          = 1\r
+ca_mgr.db.session.host                         = "localhost"\r
+ca_mgr.db.session.username                     = "ca_mgr"\r
+ca_mgr.db.session.password                     = "jsdfhsd47534hsdf7"\r
+ca_mgr.db.session.dbname                       = "ca_mgr"\r
+\r
+; Database settings for Auth DB (CACert User Table)\r
+ca_mgr.db.auth.pdo                                     = "Pdo_Mysql"\r
+ca_mgr.db.auth.host                                    = "cacert1.it-sls.de"\r
+ca_mgr.db.auth.username                                = "ca_mgr"\r
+ca_mgr.db.auth.password                                = "6348Jhfge(3457H5Kse"\r
+ca_mgr.db.auth.dbname                          = "cacert"\r
+ca_mgr.db.auth.tablename                       = "users"\r
+\r
+; Database settings for Auth DB (Manager User Table)\r
+ca_mgr.db.auth2.pdo                                    = "Pdo_Mysql"\r
+ca_mgr.db.auth2.host                           = "localhost"\r
+ca_mgr.db.auth2.username                       = "ca_mgr"\r
+ca_mgr.db.auth2.password                       = "jsdfhsd47534hsdf7"\r
+ca_mgr.db.auth2.dbname                         = "ca_mgr"\r
+ca_mgr.db.auth2.tablename                      = "system_user"\r
+\r
+; Database settings for Config DB (access to system_config and dnssecme data tables)\r
+ca_mgr.db.config.pdo                           = "Pdo_Mysql"\r
+ca_mgr.db.config.host                          = "localhost"\r
+ca_mgr.db.config.username                      = "ca_mgr"\r
+ca_mgr.db.config.password                      = "jsdfhsd47534hsdf7"\r
+ca_mgr.db.config.dbname                                = "ca_mgr"\r
+\r
+; Application name for logger\r
+log.application                                                = "web"\r
+\r
+[staging : production]\r
+\r
+[testing : production]\r
+phpSettings.display_startup_errors = 1\r
+phpSettings.display_errors = 1\r
+\r
+[development : production]\r
+phpSettings.display_startup_errors = 1\r
+phpSettings.display_errors = 1\r
index fb58194..b48faad 100644 (file)
@@ -17,10 +17,6 @@ class MailController extends Zend_Controller_Action
     public function init()
     {
         /* Initialize action controller here */
-       $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
-       $db2 = Zend_Db::factory($config->ca_mgr->db->auth2->pdo, $config->ca_mgr->db->auth2);
-               Zend_Registry::set('auth2_dbc', $db2);
-
                $session = Zend_Registry::get('session');
        $auth = $session->authdata['authed_permissions'];
 
@@ -35,7 +31,9 @@ class MailController extends Zend_Controller_Action
                        '"' . (($action == 'full')?' class="active"':'') . '>' . I18n::_('View all Mails') . '</a>', Zend_View_Helper_Placeholder_Container_Abstract::SET, 2);
        }
 
-       $emails = new CAcert_User_Emails();
+       $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV);
+       $db = Zend_Db::factory($config->ca_mgr->db->auth->pdo, $config->ca_mgr->db->auth);
+       $emails = new CAcert_User_Emails($db);
 
        $this->addresses = $emails->getEmailAddressesByLogin($session->authdata['authed_username']);
 
index d345ce8..44b1310 100644 (file)
@@ -1,8 +1,10 @@
 <?php\r
 \r
 class CAcert_User_Emails {\r
-       public function __construct() {\r
-               Log::Log()->debug(__METHOD__);\r
+    private $db = null;\r
+\r
+       public function __construct($db) {\r
+        $this->db = $db;\r
        }\r
 \r
        /**\r
@@ -11,7 +13,7 @@ class CAcert_User_Emails {
         * @return array\r
         */\r
        public function getEmailAddressesByLogin($addr) {\r
-               $db = Zend_Registry::get('auth2_dbc');\r
+               $db = $this->db;\r
 \r
                /**\r
                 * find out user id by email address\r
@@ -51,7 +53,6 @@ class CAcert_User_Emails {
                        }\r
                }\r
 \r
-               Log::Log()->debug(__METHOD__ . ' mail addresses ' . var_export($emails, true));\r
                return $emails;\r
        }\r
-}
\ No newline at end of file
+}\r