Esempio n. 1
0
 public static function installUninstallPlugins($data, &$fail, &$errno, &$error)
 {
     $res = array();
     if (!$fail) {
         $mainPath = dirname(__FILE__) . '/../..';
         foreach ($data['PLUG'] as $plugs) {
             $file = dirname(__FILE__) . '/../../Plugins/' . $plugs;
             if (substr($file, -5) == '.json' && file_exists($file) && is_readable($file)) {
                 $input = file_get_contents($file);
                 $input = json_decode($input, true);
                 if ($input == null) {
                     $fail = true;
                     break;
                 }
                 // Dateiliste zusammentragen
                 $fileList = array();
                 $fileListAddress = array();
                 $componentFiles = array();
                 Installation::gibPluginDateien($input, $fileList, $fileListAddress, $componentFiles);
                 $fileList[] = $mainPath . '/install/config/' . $data['SV']['name'] . '.ini';
                 $fileListAddress[] = 'install/config/' . $data['SV']['name'] . '.ini';
                 // Dateien entfernen
                 Zugang::EntferneDateien($fileList, $fileListAddress, $data);
             }
         }
     }
     return $res;
 }
Esempio n. 2
0
 /**
  * ???
  *
  * @param ???
  * @param string $func Der Bezeichner der aufzurufenden Funktion
  * @param string[][] $data Die Serverdaten
  * @param bool $fail true = Fehler, false = sonst
  * @param int $errno Die Fehlernummer
  * @param string $error Der Fehlertext 
  * @return ???
  */
 public static function Ermitteln($action, $func, $data, &$fail, &$errno, &$error)
 {
     if (!isset($data['ZV']['zv_type']) || $data['ZV']['zv_type'] == 'local' || $data['ZV']['zv_type'] == '') {
         if (is_callable($func)) {
             $temp = explode('::', $func);
             $answer = $temp[0]::$temp[1]($data, $fail, $errno, $error);
             return $answer;
         } else {
             $error = "Funktion {$func} kann nicht aufgerufen werden!";
             return array();
         }
     } elseif ($data['ZV']['zv_type'] == 'ssh') {
         $ssh = Zugang::Verbinden($data);
         $result = $ssh->exec('php -f install/install.php -- ' . $action);
         $result = json_decode($result, true);
         $ssh->disconnect();
         if (!isset($result[$action])) {
             return array();
         }
         $result = $result[$action];
         if (isset($result['fail'])) {
             $fail = $result['fail'];
         }
         unset($result['fail']);
         if (isset($result['errno'])) {
             $errno = $result['errno'];
         }
         unset($result['errno']);
         if (isset($result['error'])) {
             $error = $result['error'];
         }
         unset($result['error']);
         return $result;
     } else {
         return array();
     }
 }
 public static function install($data, &$fail, &$errno, &$error)
 {
     $serverFiles = Installation::GibServerDateien();
     $installComponentDefsResult['components'] = array();
     foreach ($serverFiles as $sf) {
         $sf = pathinfo($sf)['filename'];
         $tempData = Einstellungen::ladeEinstellungenDirekt($sf, $data);
         if ($tempData === null) {
             $fail = true;
             $error = Language::Get('generateComponents', 'noAccess');
             return;
         }
         $componentList = Zugang::Ermitteln('actionInstallComponentDefs', 'KomponentenErstellen::installiereKomponentenDefinitionen', $tempData, $fail, $errno, $error);
         if (isset($componentList['components'])) {
             $installComponentDefsResult['components'] = array_merge($installComponentDefsResult['components'], $componentList['components']);
         }
     }
     // Komponenten erzeugen
     $comList = array();
     $setDBNames = array();
     $ComponentList = array();
     // zunächst die Komponentenliste nach Namen sortieren
     $ComponentListInput = array();
     foreach ($installComponentDefsResult['components'] as $key => $input) {
         if (!isset($input['name'])) {
             continue;
         }
         if (!isset($ComponentListInput[$input['name']])) {
             $ComponentListInput[$input['name']] = array();
         }
         $ComponentListInput[$input['name']][$key] = $input;
     }
     for ($zz = 0; $zz < 2; $zz++) {
         $tempList = array();
         foreach ($ComponentListInput as $key2 => $ComNames) {
             foreach ($ComNames as $key => $input) {
                 if (!isset($input['name'])) {
                     continue;
                 }
                 if (!isset($input['type']) || $input['type'] == 'normal') {
                     // normale Komponente
                     if (!isset($input['registered'])) {
                         $comList[] = "('{$input['name']}', '{$input['urlExtern']}/{$input['path']}', '" . (isset($input['option']) ? $input['option'] : '') . "', '" . implode(';', isset($input['def']) ? $input['def'] : array()) . "')";
                         // Verknüpfungen erstellen
                         $setDBNames[] = " SET @{$key}_{$input['name']} = (select CO_id from Component where CO_address='{$input['urlExtern']}/{$input['path']}' limit 1); ";
                         $input['dbName'] = $key . '_' . $input['name'];
                         $input['registered'] = '1';
                     }
                     if (!isset($tempList[$key2])) {
                         $tempList[$key2] = array();
                     }
                     $tempList[$key2][] = $input;
                 } elseif (isset($input['type']) && $input['type'] == 'clone') {
                     // Komponente basiert auf einer bestehenden
                     if (!isset($input['base'])) {
                         continue;
                     }
                     if (!isset($input['baseURI'])) {
                         $input['baseURI'] = '';
                     }
                     if (isset($ComponentListInput[$input['base']])) {
                         foreach ($ComponentListInput[$input['base']] as $key3 => $input2) {
                             if (!isset($input2['name'])) {
                                 continue;
                             }
                             // pruefe, dass die Eintraege nicht doppelt erstellt werden
                             $found = false;
                             if (isset($ComponentListInput[$input['name']])) {
                                 foreach ($ComponentListInput[$input['name']] as $input3) {
                                     if ((!isset($input3['type']) || $input3['type'] == 'normal') && $input['name'] == $input3['name'] && "{$input3['urlExtern']}/{$input3['path']}" == "{$input2['urlExtern']}/{$input2['path']}{$input['baseURI']}") {
                                         $found = true;
                                         break;
                                     }
                                 }
                             }
                             if ($found) {
                                 continue;
                             }
                             if (isset($tempList[$input['name']])) {
                                 foreach ($tempList[$input['name']] as $input3) {
                                     if ($input['name'] == $input3['name'] && "{$input3['urlExtern']}/{$input3['path']}" == "{$input2['urlExtern']}/{$input2['path']}{$input['baseURI']}") {
                                         $found = true;
                                         break;
                                     }
                                 }
                             }
                             if ($found) {
                                 continue;
                             }
                             $input2['path'] = "{$input2['path']}{$input['baseURI']}";
                             $input2['def'] = array_merge($input2['def'], $input['def']);
                             $input2['links'] = array_merge(isset($input2['links']) ? $input2['links'] : array(), isset($input['links']) ? $input['links'] : array());
                             $input2['connector'] = array_merge(isset($input2['connector']) ? $input2['connector'] : array(), isset($input['connector']) ? $input['connector'] : array());
                             if (isset($input['option'])) {
                                 $input2['option'] = $input['option'];
                             }
                             $input2['name'] = $input['name'];
                             $input2['registered'] = null;
                             if (!isset($tempList[$key2])) {
                                 $tempList[$key2] = array();
                             }
                             $tempList[$key2][] = $input2;
                         }
                     }
                 }
             }
         }
         $ComponentListInput = $tempList;
     }
     $sql = "START TRANSACTION;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;TRUNCATE TABLE `ComponentLinkage`;SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;COMMIT;";
     //TRUNCATE TABLE `Component`;
     DBRequest::request2($sql, false, $data, true);
     $sql = "UPDATE `Component` SET `CO_status` = '0';";
     DBRequest::request2($sql, false, $data, true);
     $sql = "START TRANSACTION;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;INSERT INTO `Component` (`CO_name`, `CO_address`, `CO_option`, `CO_def`) VALUES ";
     $installComponentDefsResult['componentsCount'] = count($comList);
     $sql .= implode(',', $comList);
     unset($comList);
     $sql .= " ON DUPLICATE KEY UPDATE CO_status='1', CO_address=VALUES(CO_address), CO_option=VALUES(CO_option), CO_def=VALUES(CO_def);SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;COMMIT;";
     //echo $sql;
     DBRequest::request2($sql, false, $data, true);
     //echo $sql;
     $sql = "START TRANSACTION;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;";
     $sql .= implode('', $setDBNames);
     unset($setDBNames);
     $links = array();
     foreach ($ComponentListInput as $key2 => $ComNames) {
         foreach ($ComNames as $key => $input) {
             if (isset($input['type']) && $input['type'] != 'normal') {
                 continue;
             }
             if (isset($input['dbName'])) {
                 // prüfe nun alle Verknüpfungen dieser Komponente und erstelle diese
                 if (isset($input['links'])) {
                     foreach ($input['links'] as $link) {
                         if (!isset($link['target'])) {
                             $link['target'] = '';
                         }
                         if (!is_array($link['target'])) {
                             $link['target'] = array($link['target']);
                         }
                         foreach ($link['target'] as $tar) {
                             // $tar -> der Name der Zielkomponente
                             if (!isset($ComponentListInput[$tar])) {
                                 continue;
                             }
                             foreach ($ComponentListInput[$tar] as $target) {
                                 // $target -> das Objekt der Zielkomponente
                                 if (!isset($target['dbName'])) {
                                     continue;
                                 }
                                 if (!isset($input['link_type']) || $input['link_type'] == 'local' || $input['link_type'] == '') {
                                     if ($input['urlExtern'] == $target['urlExtern']) {
                                         $priority = isset($input['priority']) ? ", CL_priority = {$input['priority']}" : '';
                                         $relevanz = isset($input['relevanz']) ? $input['relevanz'] : '';
                                         $sql .= " INSERT INTO `ComponentLinkage` SET CO_id_owner = @{$input['dbName']}, CL_name = '{$link['name']}', CL_relevanz = '{$relevanz}', CO_id_target = @{$target['dbName']} {$priority};";
                                         $links[] = 1;
                                     }
                                 } elseif ($input['link_type'] == 'full') {
                                     if ($input['urlExtern'] == $target['urlExtern'] || isset($target['link_availability']) && $target['link_availability'] == 'full') {
                                         $priority = isset($input['priority']) ? ", CL_priority = {$input['priority']}" : '';
                                         $relevanz = isset($input['relevanz']) ? $input['relevanz'] : '';
                                         $sql .= " INSERT INTO `ComponentLinkage` SET CO_id_owner = @{$input['dbName']}, CL_name = '{$link['name']}', CL_relevanz = '{$relevanz}', CO_id_target = @{$target['dbName']} {$priority};";
                                         $links[] = 1;
                                     }
                                 }
                             }
                         }
                     }
                 }
                 if (isset($input['connector'])) {
                     foreach ($input['connector'] as $link) {
                         if (!isset($link['target'])) {
                             $link['target'] = '';
                         }
                         if (!is_array($link['target'])) {
                             $link['target'] = array($link['target']);
                         }
                         if (!isset($link['links'])) {
                             $link['links'] = array('a' => null);
                         }
                         foreach ($link['links'] as $callKey => $call) {
                             foreach ($link['target'] as $tar) {
                                 // $tar -> der Name der Zielkomponente
                                 if (!isset($ComponentListInput[$tar])) {
                                     continue;
                                 }
                                 foreach ($ComponentListInput[$tar] as $target) {
                                     // $target -> das Objekt der Zielkomponente
                                     if (!isset($target['dbName'])) {
                                         continue;
                                     }
                                     if (!isset($input['link_type']) || $input['link_type'] == 'local' || $input['link_type'] == '') {
                                         if ($input['urlExtern'] == $target['urlExtern']) {
                                             $priority = isset($link['priority']) ? ", CL_priority = {$link['priority']}" : '';
                                             $method = isset($call['method']) ? $call['method'] : 'GET';
                                             $path = isset($call['path']) ? ", CL_path = '{$method} {$call['path']}'" : '';
                                             $relevanz = isset($link['relevanz']) ? $link['relevanz'] : '';
                                             $sql .= " INSERT INTO `ComponentLinkage` SET CO_id_owner = @{$target['dbName']}, CL_name = '{$link['name']}', CL_relevanz = '{$relevanz}', CO_id_target = @{$input['dbName']} {$priority} {$path};";
                                             $links[] = 1;
                                         }
                                     } elseif ($input['link_type'] == 'full') {
                                         if ($input['urlExtern'] == $target['urlExtern'] || isset($input['link_availability']) && $input['link_availability'] == 'full') {
                                             $priority = isset($link['priority']) ? ", CL_priority = {$link['priority']}" : '';
                                             $method = isset($call['method']) ? $call['method'] : 'GET';
                                             $path = isset($call['path']) ? ", CL_path = '{$method} {$call['path']}'" : '';
                                             $relevanz = isset($link['relevanz']) ? $link['relevanz'] : '';
                                             $sql .= " INSERT INTO `ComponentLinkage` SET CO_id_owner = @{$target['dbName']}, CL_name = '{$link['name']}', CL_relevanz = '{$relevanz}', CO_id_target = @{$input['dbName']} {$priority} {$path};";
                                             $links[] = 1;
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $installComponentDefsResult['linksCount'] = count($links);
     $sql .= " SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;COMMIT;";
     DBRequest::request2($sql, false, $data, true);
     $installComponentDefsResult['components'] = $ComponentListInput;
     return $installComponentDefsResult;
 }
Esempio n. 4
0
 /**
  * Die Hauptfunktion des Installationsassistenten
  *
  * @param bool $console true = Konsolendarstellung, false = HTML
  */
 public function CallInstall($console = false)
 {
     $output = array();
     $installFail = false;
     $simple = false;
     $data = array();
     $tmp = array();
     if (isset($_POST['data'])) {
         $data = $_POST['data'];
     }
     if (isset($_POST['tmp'])) {
         $tmp = $_POST['tmp'];
     }
     if (isset($_POST['simple'])) {
         $simple = true;
     }
     if (isset($_POST['update'])) {
         $_POST['action'] = 'update';
     }
     if (isset($_POST['actionInstall'])) {
         $_POST['action'] = 'install';
     }
     if (isset($_POST['actionUpdate'])) {
         $_POST['action'] = 'update';
     }
     if (!isset($data['PL']['language'])) {
         $data['PL']['language'] = 'de';
     }
     if (!isset($data['PL']['init'])) {
         $data['PL']['init'] = 'DB/CControl';
     }
     // URLs und Pfade sollen keinen / am Ende haben (damit es einheitlich ist)
     if (isset($data['PL']['url'])) {
         $data['PL']['url'] = rtrim($data['PL']['url'], '/');
     }
     if (isset($data['PL']['urlExtern'])) {
         $data['PL']['urlExtern'] = rtrim($data['PL']['urlExtern'], '/');
     }
     if (isset($data['PL']['temp'])) {
         $data['PL']['temp'] = rtrim($data['PL']['temp'], '/');
     }
     if (isset($data['PL']['files'])) {
         $data['PL']['files'] = rtrim($data['PL']['files'], '/');
     }
     if (isset($data['PL']['init'])) {
         $data['PL']['init'] = rtrim($data['PL']['init'], '/');
     }
     // check which server is selected
     $server = isset($_POST['server']) ? $_POST['server'] : null;
     Einstellungen::$selected_server = isset($_POST['selected_server']) ? $_POST['selected_server'] : null;
     // behandle das MasterPasswort
     $serverHash = md5(Einstellungen::$selected_server);
     $tmp[$serverHash]['newMasterPassword'] = isset($tmp[$serverHash]['masterPassword']) ? $tmp[$serverHash]['masterPassword'] : null;
     if (isset($_POST['changeMasterPassword'])) {
         Einstellungen::$masterPassword[$serverHash] = isset($tmp[$serverHash]['oldMasterPassword']) ? $tmp[$serverHash]['oldMasterPassword'] : null;
         $tmp[$serverHash]['masterPassword'] = Einstellungen::$masterPassword[$serverHash];
     } else {
         Einstellungen::$masterPassword[$serverHash] = $tmp[$serverHash]['newMasterPassword'];
         $tmp[$serverHash]['masterPassword'] = Einstellungen::$masterPassword[$serverHash];
     }
     foreach ($tmp as $key => $tm) {
         if (!isset($tm['masterPassword']) && isset($tm['oldMasterPassword']) && trim($tm['oldMasterPassword']) != '') {
             $tmp[$key]['masterPassword'] = $tm['oldMasterPassword'];
             $tmp[$key]['newMasterPassword'] = isset($tmp[$key]['oldMasterPassword']) ? $tmp[$key]['oldMasterPassword'] : null;
             Einstellungen::$masterPassword[$key] = $tm['oldMasterPassword'];
         }
         if (!isset(Einstellungen::$masterPassword[$key]) && isset($tmp[$key]['masterPassword']) && trim($tmp[$key]['masterPassword']) != '') {
             $tmp[$key]['newMasterPassword'] = isset($tmp[$key]['masterPassword']) ? $tmp[$key]['masterPassword'] : null;
             Einstellungen::$masterPassword[$key] = $tm['masterPassword'];
         }
     }
     // prüfe ob der Servername geändert wurde
     if (isset($data['SV']['name']) && $data['SV']['name'] !== null && Einstellungen::$selected_server !== null) {
         if ($data['SV']['name'] != Einstellungen::$selected_server) {
             $oldServerHash = md5($data['SV']['name']);
             $newServerHash = md5(Einstellungen::$selected_server);
             if (isset(Einstellungen::$masterPassword[$oldServerHash])) {
                 Einstellungen::$masterPassword[$newServerHash] = Einstellungen::$masterPassword[$oldServerHash];
                 unset(Einstellungen::$masterPassword[$oldServerHash]);
             }
             Einstellungen::umbenennenEinstellungen(Einstellungen::$selected_server, $data['SV']['name']);
         }
     }
     // check which menu is selected
     $selected_menu = intval(isset($_POST['selected_menu']) ? $_POST['selected_menu'] : self::$menuItems[0]);
     if (isset($_POST['action']) && $_POST['action'] == 'update') {
         $selected_menu = -1;
     }
     // check server configs
     Einstellungen::$serverFiles = Installation::GibServerDateien();
     // add Server
     $addServer = false;
     $addServerResult = array();
     if ((isset($_POST['action']) && $_POST['action'] === 'install' || isset($_POST['actionAddServer']) || count(Einstellungen::$serverFiles) == 0) && !$installFail) {
         $addServer = true;
         $server = Einstellungen::NeuenServerAnlegen();
         Einstellungen::$serverFiles[] = $server;
         $server = pathinfo($server)['filename'];
         Einstellungen::ladeEinstellungen($server, $data);
         ///$data['SV']['name'] = $server;
         Einstellungen::speichereEinstellungen($server, $data);
     }
     // save data on switching between server-confs
     if (Einstellungen::$selected_server !== null && $server != null) {
         if ($server != Einstellungen::$selected_server) {
             Einstellungen::ladeEinstellungen(Einstellungen::$selected_server, $data);
             //Einstellungen::speichereEinstellungen(Einstellungen::$selected_server,$data);
             Einstellungen::resetConf();
         }
     }
     // select first if no server is selected
     if (Einstellungen::$selected_server == null && $server == null) {
         Einstellungen::$selected_server = pathinfo(Einstellungen::$serverFiles[0])['filename'];
         $server = Einstellungen::$selected_server;
     }
     if ($server != null) {
         Einstellungen::$selected_server = $server;
     }
     $server = Einstellungen::$selected_server;
     $data['SV']['name'] = Einstellungen::$selected_server;
     $serverHash = md5(Einstellungen::$selected_server);
     if (!isset($tmp[$serverHash]['masterPassword'])) {
         $tmp[$serverHash]['masterPassword'] = null;
     }
     // nun kann die Konfiguration des gewählten Servers geladen werden (selected_server)
     Einstellungen::ladeEinstellungen(Einstellungen::$selected_server, $data);
     Einstellungen::$masterPassword[$serverHash] = isset($tmp[$serverHash]['newMasterPassword']) ? $tmp[$serverHash]['newMasterPassword'] : '';
     if (isset(Einstellungen::$masterPassword[$serverHash])) {
         $tmp[$serverHash]['masterPassword'] = Einstellungen::$masterPassword[$serverHash];
     }
     // load language
     Language::loadLanguage($data['PL']['language'], 'default', 'ini');
     // ermittle alle Segmente
     $this->loadSegments();
     if (Einstellungen::$accessAllowed) {
         if ($console) {
             $data['ZV']['zv_type'] = 'local';
         }
         if ($simple) {
             $data['ZV']['zv_type'] = 'local';
         }
         if (isset($_POST['action'])) {
             $data['action'] = $_POST['action'];
         }
         $fail = false;
         $errno = null;
         $error = null;
         if ($simple) {
             $selected_menu = -1;
         }
     }
     if (!$console && !$simple) {
         // select language - german
         if (isset($_POST['actionSelectGerman']) || isset($_POST['actionSelectGerman_x'])) {
             $data['PL']['language'] = 'de';
         }
         // select language - english
         if (isset($_POST['actionSelectEnglish']) || isset($_POST['actionSelectEnglish_x'])) {
             $data['PL']['language'] = 'en';
         }
         echo "<html><head>";
         echo "<link rel='stylesheet' type='text/css' href='css/format.css'>";
         $titleText = Language::Get('main', 'title' . $selected_menu);
         if ($selected_menu == -1) {
             if (isset($_POST['action'])) {
                 $titleText = Language::Get('main', 'title' . $_POST['action']);
             }
         }
         echo "</head><body><div class='center'>";
         if (Einstellungen::$accessAllowed && $titleText !== '???') {
             echo "<h1>" . $titleText . "</h1></br>";
         }
         echo "<form action='' method='post' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false'>";
     }
     if (Einstellungen::$accessAllowed) {
         // führe die Initialisierungsfunktionen der Segmente aus
         foreach (Einstellungen::$segments as $segs) {
             if (!is_callable("{$segs}::init")) {
                 continue;
             }
             ///if (!isset($segs::$initialized)) continue;
             ///if ($segs::$initialized) continue;
             $segs::init($console, $data, $fail, $errno, $error);
         }
         $segmentResults = array();
         // installiere die Segmente
         foreach (Einstellungen::$segments as $segs) {
             if (!isset($segs::$onEvents)) {
                 continue;
             }
             foreach ($segs::$onEvents as $event) {
                 if (isset($event['enabledInstall']) && !$event['enabledInstall']) {
                     continue;
                 }
                 $isSetEvent = false;
                 if (isset($_POST['action']) && in_array($_POST['action'], $event['event'])) {
                     $isSetEvent = true;
                 }
                 foreach ($event['event'] as $ev) {
                     if (isset($_POST[$ev])) {
                         $isSetEvent = true;
                         break;
                     }
                 }
                 if (!$installFail && ($segs::$page === $selected_menu && in_array('page', $event['event']) || $isSetEvent)) {
                     $result = array();
                     $procedure = 'install';
                     if (isset($event['procedure'])) {
                         $procedure = $event['procedure'];
                     }
                     $result['content'] = Zugang::Ermitteln($event['name'], $segs . '::' . $procedure, $data, $fail, $errno, $error);
                     $segs::$installed = true;
                     $installFail = $fail;
                     $result['fail'] = $fail;
                     $result['errno'] = $errno;
                     $result['error'] = $error;
                     if ($console && !$simple) {
                         $output[$segs::$name] = $result;
                     }
                     $fail = false;
                     $errno = null;
                     $error = null;
                     if (!isset($segmentResults[$segs::$name])) {
                         $segmentResults[$segs::$name] = array();
                     }
                     $segmentResults[$segs::$name][$event['name']] = $result;
                 }
             }
         }
     }
     if (!$console && !$simple) {
         echo "<table border='0'><tr>";
         echo "<th valign='top'>";
         echo "<div style='width:150px;word-break: break-all;'>";
         echo "<table border='0'>";
         // ab hier wird die linke Infoleiste erzeugt
         foreach (Einstellungen::$segments as $segs) {
             if (isset($segs::$enabledShow) && !$segs::$enabledShow) {
                 continue;
             }
             if (!is_callable("{$segs}::showInfoBar")) {
                 continue;
             }
             $segs::showInfoBar($data);
             echo "<tr><th height='10'></th></tr>";
         }
         echo "</table>";
         echo "</div";
         echo "</th>";
         echo "<th width='2'></th>";
         echo "</th>";
         echo "<th width='600'><hr />";
         if (Einstellungen::$accessAllowed) {
             echo "<table border='0' cellpadding='4' width='600'>";
             echo "<input type='hidden' name='selected_menu' value='{$selected_menu}'>";
             echo "<tr>";
             $text = '';
             for ($i = 0; $i < count(self::$menuItems); $i++) {
                 if ($i % 5 == 0 && $i > 0) {
                     $text .= "<tr>";
                 }
                 $item = self::$menuItems[$i];
                 $type = self::$menuTypes[$i];
                 echo "<td class='" . ($type == 0 ? 'h' : 'k') . "'><div align='center'>" . Design::erstelleSubmitButtonFlach('selected_menu', $item, $selected_menu == $item ? '<font color="maroon">' . Language::Get('main', 'title' . $item) . '</font>' : Language::Get('main', 'title' . $item)) . "</div></td>";
             }
             echo "</tr>";
             echo "</table>";
         } else {
             $text = '';
             $text .= Design::erstelleBeschreibung($console, Language::Get('main', 'insertMasterPassword'));
             echo Design::erstelleBlock($console, '', $text);
         }
         echo "<hr />";
     }
     #region Sprachwahl
     if (!$console && !$simple) {
         echo "<input type='hidden' name='data[PL][language]' value='{$data['PL']['language']}'>";
         echo "<div align='center'>" . Design::erstelleSubmitButtonGrafisch('actionSelectGerman', './images/de.gif', 32, 22) . Design::erstelleSubmitButtonGrafisch('actionSelectEnglish', './images/en.gif', 32, 22) . "</div>";
     }
     #endregion Sprachwahl
     if (Einstellungen::$accessAllowed) {
         // show segments
         foreach (Einstellungen::$segments as $segs) {
             if (isset($segs::$enabledShow) && !$segs::$enabledShow) {
                 continue;
             }
             if (!isset($segs::$page) || $segs::$page === $selected_menu || isset($segs::$installed) && $segs::$installed) {
                 if (!is_callable("{$segs}::show")) {
                     continue;
                 }
                 $result = isset($segmentResults[$segs::$name]) ? $segmentResults[$segs::$name] : array();
                 $segs::show($console, $result, $data);
             }
         }
         if ($simple) {
             if ($installFail) {
                 echo "0";
             } else {
                 echo "1";
             }
         }
         if (!$console && !$simple) {
             if (($selected_menu === 2 || $selected_menu === 3 || $selected_menu === 4) && false) {
                 echo "<table border='0' cellpadding='3' width='600'>";
                 echo "<tr><td class='h'><div align='center'><input type='submit' name='actionInstall' value=' " . Language::Get('main', 'installAll') . " '></div></td></tr>";
                 echo "</table><br />";
             }
             #region zurück_weiter_buttons
             $a = '';
             $b = '';
             if (array_search($selected_menu, self::$menuItems) > 0) {
                 $item = self::$menuItems[array_search($selected_menu, self::$menuItems) - 1];
                 $a = Design::erstelleSubmitButtonFlach('selected_menu', $item, Language::Get('main', 'back')) . '<br><font size=1>(' . Language::Get('main', 'title' . $item) . ')</font>';
             }
             if ($selected_menu >= 0 && array_search($selected_menu, self::$menuItems) < count(self::$menuItems) - 1) {
                 $item = self::$menuItems[array_search($selected_menu, self::$menuItems) + 1];
                 $b = Design::erstelleSubmitButtonFlach('selected_menu', $item, Language::Get('main', 'next')) . '<br><font size=1>(' . Language::Get('main', 'title' . $item) . ')</font>';
             }
             echo "<table border='0' cellpadding='3' width='600'>";
             echo "<thead><tr><th align='left' width='50%'>{$a}</th><th align='right' width='50%'>{$b}</th></tr></thead>";
             if ($selected_menu == 0) {
                 if (!isset($_POST['actionShowPhpInfo'])) {
                     echo "<tr><th colspan='2'>" . Design::erstelleSubmitButton("actionShowPhpInfo", 'PHPInfo') . "</th></tr>";
                 }
             }
             echo "</table>";
             #endregion zurück_weiter_buttons
             echo "<div>";
             echo "</div>";
             echo "</th>";
             echo "<th width='2'></th>";
             echo "<th valign='top'>";
             // ab hier wird die Infoleiste mit der aktuellen Konfiguration erstellt
             // (die Leiste rechts am Rand)
             echo "<div style='width:150px;word-break: break-all;'>";
             echo "<table border='0'>";
             foreach (Einstellungen::$segments as $segs) {
                 if (!is_callable("{$segs}::getSettingsBar")) {
                     continue;
                 }
                 $settings = $segs::getSettingsBar($data);
                 if (count($settings) > 0) {
                     foreach ($settings as $key => $values) {
                         if (!isset($values[0]) || !isset($values[1])) {
                             continue;
                         }
                         echo "<tr><td class='e'>" . $values[0] . "</td></tr>";
                         echo "<tr><td>" . $values[1] . "</td></tr>";
                         echo "<tr><th></th></tr>";
                     }
                 }
             }
             echo "</table>";
             echo "</div";
             echo "</th></tr></form></table>";
             echo "</div></body></html>";
         }
         if (isset($_POST['actionShowPhpInfo'])) {
             ob_start();
             phpinfo();
             $phpinfo = array('phpinfo' => array());
             if (preg_match_all('#(?:<h2>(?:<a name=".*?">)?(.*?)(?:</a>)?</h2>)|(?:<tr(?: class=".*?")?><t[hd](?: class=".*?")?>(.*?)\\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\\s*</t[hd]>(?:<t[hd](?: class=".*?")?>(.*?)\\s*</t[hd]>)?)?</tr>)#s', ob_get_clean(), $matches, PREG_SET_ORDER)) {
                 foreach ($matches as $match) {
                     if (strlen($match[1])) {
                         $phpinfo[$match[1]] = array();
                     } elseif (isset($match[3])) {
                         $arr = array_keys($phpinfo);
                         $phpinfo[end($arr)][$match[2]] = isset($match[4]) ? array($match[3], $match[4]) : $match[3];
                     } else {
                         $arr = array_keys($phpinfo);
                         $phpinfo[end($arr)][] = $match[2];
                     }
                 }
             }
             echo "<br><br><br><br><div align='center'>";
             foreach ($phpinfo as $name => $section) {
                 echo "<h3>{$name}</h3>\n<table>\n";
                 foreach ($section as $key => $val) {
                     if (is_array($val)) {
                         echo "<tr><td>{$key}</td><td>{$val['0']}</td><td>{$val['1']}</td></tr>\n";
                     } elseif (is_string($key)) {
                         echo "<tr><td>{$key}</td><td>{$val}</td></tr>\n";
                     } else {
                         echo "<tr><td>{$val}</td></tr>\n";
                     }
                 }
                 echo "</table>\n";
             }
             echo "</div>";
         }
     }
     if ($console && !$simple) {
         echo json_encode($output);
     }
     if (!$console && !$simple) {
         Einstellungen::speichereEinstellungen($server, $data);
     }
 }