_configData = $configData; } /** * Validate config data and save when valid * * Checks database connection params. * If connection is successfull the values are saved to the config file. * * @param Zend_View $view The view of the form for adding messages */ public function validateAndSaveConfig(Zend_View $view) { $saveConfig = false; $config = Msd_Registry::getConfig(); $translator = Msd_Language::getInstance()->getTranslator(); $db = Msd_Db::getAdapter($this->_configData['dbuser']); try { $db->getServerInfo(); $saveConfig = true; } catch (Msd_Exception $e) { $msg = $translator->_('L_ERROR').' (' . $e->getCode().') '; $msg .= $e->getMessage(); $view->popUpMessage()->addMessage( 'db-access-error', 'L_ERROR', $msg, array( 'modal' => true, 'dialogClass' => 'error', ) ); } if ($saveConfig) { $config->setConfig($this->_configData); $saved = $config->save(); if ($saved === true) { $view->popUpMessage()->addMessage( 'save-config', 'L_NOTICE', array('L_SAVE_SUCCESS', $view->config->getParam('general.title')), array( 'modal' => true, 'dialogClass' => 'notice' ) ); } else { die("Fehler beim Speichern der Konfiguration!"); } } } }