Exemplo n.º 1
0
 /**
  * @brief Constructor
  *
  * @param Database  &$database      reference to the Database object
  * @param Log       &$log           reference to the Log object
  *
  * @throws Exception if there was an error
  */
 public function __construct(&$database, &$log)
 {
     if (get_class($database) != 'Database') {
         throw new Exception('$database ist kein Database-Objekt!');
     }
     if (get_class($log) != 'Log') {
         throw new Exception('$log ist kein Log-Objekt!');
     }
     $this->database = $database;
     $this->log = $log;
     // get the installed version
     $this->installed_version = SystemVersion::get_installed_version();
     debug('hint', 'System initialisiert: Version ' . $this->get_installed_version()->as_string(false, false, false, true), __FILE__, __LINE__, __METHOD__);
 }
Exemplo n.º 2
0
    $action = 'save_admin_password';
}
if (isset($_REQUEST['save_db_settings'])) {
    $action = 'save_db_settings';
}
if (isset($_REQUEST['save_db_backup_path'])) {
    $action = 'save_db_backup_path';
}
/********************************************************************************
 *
 *   Initialize Objects
 *
 *********************************************************************************/
$html = new HTML($config['html']['theme'], $config['html']['custom_css'], 'Part-DB Installation/Update');
try {
    $system_version = SystemVersion::get_installed_version();
} catch (Exception $e) {
    $messages[] = array('text' => nl2br($e->getMessage()), 'strong' => true, 'color' => 'red');
    $fatal_error = true;
}
/********************************************************************************
 *
 *   Execute actions
 *
 *********************************************************************************/
if (!$fatal_error) {
    switch ($action) {
        case 'save_locales':
            try {
                $config['timezone'] = $timezone;
                $config['language'] = $language;