public static function show($console, $result, $data) { $isUpdate = isset($data['action']) && $data['action'] == 'update' ? true : false; $text = ''; $text .= Design::erstelleBeschreibung($console, Language::Get('platform', 'description')); if (!$console) { $text .= Design::erstelleZeile($console, Language::Get('platform', 'createTables'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0]), 'h'); $text .= Design::erstelleZeile($console, Language::Get('platform', 'details'), 'e', Design::erstelleAuswahl($console, $data['PL']['pl_details'], 'data[PL][pl_details]', 'details', null), 'v'); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { if (!$console && isset($data['PL']['pl_details']) && $data['PL']['pl_details'] === 'details' && !$isUpdate) { foreach ($content as $component => $dat) { $text .= "<tr><td class='e' rowspan='1'>{$component}</td><td class='v'></td><td class='e'><div align ='center'>" . (isset($dat['status']) && $dat['status'] === 201 ? Language::Get('main', 'ok') : "<font color='red'>" . Language::Get('main', 'fail') . " ({$dat['status']})</font>") . "</align></td></tr>"; } } else { $text .= Design::erstelleZeile($console, Language::Get('platform', 'countComponents'), 'e', count($content), 'v_c'); } $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('platform', 'title'), $text); return null; }
public static function show($console, $result, $data) { $text = ''; $text .= Design::erstelleBeschreibung($console, Language::Get('createSuperAdmin', 'description')); if (!$console) { $text .= Design::erstelleZeile($console, Language::Get('createSuperAdmin', 'db_user_insert'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_user_insert'], 'data[DB][db_user_insert]', 'root'), 'v'); $text .= Design::erstelleZeile($console, Language::Get('createSuperAdmin', 'db_passwd_insert'), 'e', Design::erstellePasswortzeile($console, $data['DB']['db_passwd_insert'], 'data[DB][db_passwd_insert]', ''), 'v'); $text .= Design::erstelleZeile($console, Language::Get('createSuperAdmin', 'db_first_name_insert'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_first_name_insert'], 'data[DB][db_first_name_insert]', ''), 'v'); $text .= Design::erstelleZeile($console, Language::Get('createSuperAdmin', 'db_last_name_insert'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_last_name_insert'], 'data[DB][db_last_name_insert]', ''), 'v'); $text .= Design::erstelleZeile($console, Language::Get('createSuperAdmin', 'db_email_insert'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_email_insert'], 'data[DB][db_email_insert]', ''), 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0], Language::Get('main', 'create')), 'h'); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('createSuperAdmin', 'title'), $text); }
public static function show($console, $result, $data) { $text = ''; if (!$console) { $text .= Design::erstelleBeschreibung($console, Language::Get('generateComponents', 'description')); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (!$console) { $text .= Design::erstelleZeile($console, Language::Get('generateComponents', 'generateComponents'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0]), 'h'); } if (self::$installed) { if (isset($content['components'])) { $text .= Design::erstelleZeile($console, Language::Get('generateComponents', 'numberComponents'), 'v', $content['componentsCount'], 'v'); $text .= Design::erstelleZeile($console, Language::Get('generateComponents', 'numberLinks'), 'v', $content['linksCount'], 'v'); } $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('generateComponents', 'title'), $text); return null; }
public static function show($console, $result, $data) { $text = ''; if (!$console) { $text .= Design::erstelleBeschreibung($console, Language::Get('general_settings', 'description')); $text .= Design::erstelleZeile($console, Language::Get('general_settings', 'init'), 'e', '', 'v', Design::erstelleSubmitButton('actionInstallInit'), 'h'); $text .= Design::erstelleZeile($console, Language::Get('database', 'db_override'), 'e', Design::erstelleAuswahl($console, $data['DB']['db_override'], 'data[DB][db_override]', 'override', null, true), 'v'); $text .= Design::erstelleZeile($console, Language::Get('database', 'db_ignore'), 'e', Design::erstelleAuswahl($console, $data['DB']['db_ignore'], 'data[DB][db_ignore]', 'ignore', null, true), 'v'); $text .= Design::erstelleZeile($console, Language::Get('general_settings', 'details'), 'e', Design::erstelleAuswahl($console, $data['PL']['pl_main_details'], 'data[PL][pl_main_details]', 'details', null, true), 'v'); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { if ($data['PL']['pl_main_details'] == 'details') { foreach ($content as $component => $dat) { if (!$console) { $text .= "<tr><td class='e' rowspan='1'>{$component}</td><td class='v'></td><td class='e'><div align ='center'>" . (isset($dat['status']) && $dat['status'] === 201 ? Language::Get('main', 'ok') : "<font color='red'>" . Language::Get('main', 'fail') . " ({$dat['status']})</font>") . "</align></td></tr>"; } else { $text .= "{$component}: " . (isset($dat['status']) && $dat['status'] === 201 ? Language::Get('main', 'ok') . "\n" : Language::Get('main', 'fail') . " ({$dat['status']})\n"); } } } $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('general_settings', 'title'), $text); return null; }
public static function show($console, $result, $data) { $executedEvents = array(); foreach ($result as $key => $value) { $executedEvents[] = $key; } $text = ''; $text .= Design::erstelleBeschreibung($console, Language::Get('cleanCourses', 'description')); if (!$console) { $text .= Design::erstelleZeile($console, Language::Get('cleanCourses', 'getAmount'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['collectCleanCourses']['event'][0], Language::Get('cleanCourses', 'collectAmount')), 'h'); } if (isset($result[self::$onEvents['collectCleanCourses']['name']]) && $result[self::$onEvents['collectCleanCourses']['name']] != null) { $result = $result[self::$onEvents['collectCleanCourses']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { if (!$console && isset($data['C']['c_details']) && $data['C']['c_details'] === 'details') { if (isset($content)) { foreach ($content as $component => $dat) { $text .= "<tr><td class='e' rowspan='1'>{$component}</td><td class='v'><div align ='center'>{$dat['amount']}</align></td></tr>"; } } } else { $count = 0; if (isset($content)) { foreach ($content as $component => $dat) { $count += $dat['amount']; } } $text .= Design::erstelleZeile($console, Language::Get('cleanCourses', 'dirtyRows'), 'e', $count, 'v_c'); } if (!$console && in_array(self::$onEvents['collectCleanCourses']['name'], $executedEvents)) { $text .= Design::erstelleZeile($console, Language::Get('cleanCourses', 'cleanCourses'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['cleanCourses']['event'][0], Language::Get('cleanCourses', 'clean')), 'h'); } elseif (!$console && in_array(self::$onEvents['cleanCourses']['name'], $executedEvents)) { $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } } echo Design::erstelleBlock($console, Language::Get('cleanCourses', 'title'), $text); return null; }
public static function show($console, $result, $data) { $text = ''; $text .= Design::erstelleBeschreibung($console, Language::Get('userInterface', 'description')); if (!$console) { $text .= Design::erstelleZeile($console, Language::Get('userInterface', 'conf'), 'e', Design::erstelleEingabezeile($console, $data['UI']['conf'], 'data[UI][conf]', '../UI/include/Config.php', true), 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0]), 'h'); $text .= Design::erstelleZeile($console, Language::Get('userInterface', 'siteKey'), 'e', Design::erstelleEingabezeile($console, $data['UI']['siteKey'], 'data[UI][siteKey]', 'b67dc54e7d03a9afcd16915a55edbad2d20a954562c482de3863456f01a0dee4', true), 'v'); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('userInterface', 'title'), $text); }
public static function show($console, $result, $data) { $text = ''; if (!$console) { $text .= Design::erstelleBeschreibung($console, Language::Get('createDatabasePlatformUser', 'description')); $text .= Design::erstelleZeile($console, Language::Get('createDatabasePlatformUser', 'db_user_override_operator'), 'e', Design::erstelleAuswahl($console, $data['DB']['db_user_override_operator'], 'data[DB][db_user_override_operator]', 'override', null, true), 'v'); $text .= Design::erstelleZeile($console, Language::Get('createDatabasePlatformUser', 'createUser'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0], Language::Get('main', 'create')), 'h'); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('createDatabasePlatformUser', 'title'), $text); return null; }
public static function show($console, $result, $data) { $pluginFiles = array(); if ($handle = @opendir(dirname(__FILE__) . '/../../Plugins')) { while (false !== ($file = readdir($handle))) { if (substr($file, -5) != '.json' || $file == '.' || $file == '..') { continue; } if (is_dir(dirname(__FILE__) . '/../../Plugins/' . $file)) { continue; } $pluginFiles[] = $file; } closedir($handle); } $text = ''; $text .= Design::erstelleBeschreibung($console, Language::Get('packages', 'description')); if (self::$onEvents['install']['enabledInstall']) { $text .= Design::erstelleZeile($console, Language::Get('packages', 'installSelected'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0], Language::Get('main', 'install')), 'h'); } if (self::$onEvents['uninstall']['enabledInstall']) { $text .= Design::erstelleZeile($console, Language::Get('packages', 'uninstallSelected'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['uninstall']['event'][0], Language::Get('main', 'uninstall')), 'h'); } if (self::$onEvents['validateFiles']['enabledInstall']) { $text .= Design::erstelleZeile($console, Language::Get('packages', 'validateFilesDesc'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['validateFiles']['event'][0], Language::Get('packages', 'validateFiles')), 'h'); } $validateFiles = false; if (isset($result[self::$onEvents['validateFiles']['name']])) { $validateFiles = true; } if (isset($result[self::$onEvents['check']['name']]) && $result[self::$onEvents['check']['name']] != null) { $result = $result[self::$onEvents['check']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $installedPlugins = $result['content']; // hier die möglichen Erweiterungen ausgeben, zudem noch die Daten dieser Erweiterungen foreach ($pluginFiles as $plug) { $dat = file_get_contents(dirname(__FILE__) . '/../../Plugins/' . $plug); $dat = json_decode($dat, true); $name = $dat['name']; $version = $dat['version']; $voraussetzungen = $dat['requirements']; if (!is_array($voraussetzungen)) { $voraussetzungen = array($voraussetzungen); } $text .= Design::erstelleZeile($console, "{$name} v{$dat['version']}", 'e', self::$onEvents['install']['enabledInstall'] || self::$onEvents['uninstall']['enabledInstall'] ? Design::erstelleAuswahl($console, $data['PLUG']['plug_install_' . $name], 'data[PLUG][plug_install_' . $name . ']', $plug, null, true) : '', 'v'); $isInstalled = false; if (isset($installedPlugins)) { foreach ($installedPlugins as $instPlug) { if ($name == $instPlug['name']) { if (isset($instPlug['version'])) { $text .= Design::erstelleZeile($console, Language::Get('packages', 'currentVersion'), 'v', 'v' . $instPlug['version'], 'v'); } else { $text .= Design::erstelleZeile($console, Language::Get('packages', 'currentVersion'), 'v', '???', 'v'); } $isInstalled = true; break; } } } if (!$isInstalled) { $text .= Design::erstelleZeile($console, Language::Get('packages', 'currentVersion'), 'v', '---', 'v'); } $vorText = ''; foreach ($voraussetzungen as $vor) { $vorText .= "{$vor['name']} v{$vor['version']}, "; } if ($vorText == '') { $vorText = '---'; } else { $vorText = substr($vorText, 0, -2); } $text .= Design::erstelleZeile($console, Language::Get('packages', 'requirements'), 'v', $vorText, 'v'); $file = dirname(__FILE__) . '/../../Plugins/' . $plug; $fileCount = 0; $fileSize = 0; $componentCount = 0; if (file_exists($file) && is_readable($file)) { $input = file_get_contents($file); $input = json_decode($input, true); if ($input == null) { $fail = true; break; } $fileList = array(); $fileListAddress = array(); $componentFiles = array(); self::gibPluginDateien($input, $fileList, $fileListAddress, $componentFiles); $fileCount = count($fileList); foreach ($fileList as $f) { if (is_readable($f)) { $fileSize += filesize($f); if ($validateFiles) { if ($fileSize > 0 && strtolower(substr($f, -5)) === '.json') { // validiere die json Datei $cont = file_get_contents($f); if (trim($cont) != '') { $val = @json_decode(file_get_contents($f)); if ($val === null) { $text .= Design::erstelleZeileShort($console, realpath($f), 'break v', Language::Get('packages', 'jsonInvalid'), 'v error_light break'); } } } if ($fileSize > 0 && strtolower(substr($f, -4)) === '.php') { // validiere die php Datei $output = null; $result = null; exec('(php -l -d error_reporting=E_ALL -d display_errors=on -d log_errors=off -f ' . realpath($f) . ') 2>&1', $output, $result); if ($result != 0) { $text .= Design::erstelleZeileShort($console, realpath($f), 'break v', implode('<br>', $output), 'v error_light break'); } } } } } $componentCount = count($componentFiles); } $text .= Design::erstelleZeile($console, Language::Get('packages', 'numberComponents'), 'v', $componentCount, 'v'); $text .= Design::erstelleZeile($console, Language::Get('packages', 'numberFiles'), 'v', $fileCount, 'v'); $text .= Design::erstelleZeile($console, Language::Get('packages', 'size'), 'v', Design::formatBytes($fileSize), 'v'); } /*if ($installPlugins){ if ($installPluginsResult !=null) foreach ($installPluginsResult as $component){ // $text .= "<tr><td class='e' rowspan='1'>{$component}</td><td class='v'></td><td class='e'><div align ='center'>".((isset($dat['status']) && $dat['status']===201) ? Language::Get('main','ok') : "<font color='red'>".Language::Get('main','fail')." ({$dat['status']})</font>")."</align></td></tr>"; } $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } if ($uninstallPlugins){ if ($uninstallPluginsResult !=null) foreach ($uninstallPluginsResult as $component){ // $text .= "<tr><td class='e' rowspan='1'>{$component}</td><td class='v'></td><td class='e'><div align ='center'>".((isset($dat['status']) && $dat['status']===201) ? Language::Get('main','ok') : "<font color='red'>".Language::Get('main','fail')." ({$dat['status']})</font>")."</align></td></tr>"; } $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); }*/ echo Design::erstelleBlock($console, Language::Get('packages', 'title'), $text); return null; }
public static function show($console, $result, $data) { $text = ''; if (!$console) { $text .= Design::erstelleBeschreibung($console, Language::Get('gitUpdate', 'description')); } $collected = array(); if (isset($result[self::$onEvents['collect']['name']]) && $result[self::$onEvents['collect']['name']] != null) { $collected = $result[self::$onEvents['collect']['name']]; } elseif (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $collected = $result[self::$onEvents['install']['name']]; } else { $collected = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $collected['fail']; $error = $collected['error']; $errno = $collected['errno']; if (Einstellungen::$accessAllowed) { //if ($collected['content'] === null){ if (!$console) { $text .= Design::erstelleZeileShort($console, Language::Get('gitUpdate', 'collectGitUpdatesDesc'), 'e', Design::erstelleSubmitButton(self::$onEvents['collect']['event'][0], Language::Get('gitUpdate', 'collectGitUpdates')), 'h'); } //} if (isset($collected['content']['modified']) && $collected['content']['modified'] !== null) { $t = ''; if (isset($collected['content']['modified'][0])) { $t = $collected['content']['modified'][0]; } else { $t = Language::Get('gitUpdate', 'noUpdates'); } if (!$console) { $text .= "<tr><td class='v' colspan='3'>{$t}</td></tr>"; } else { } } if (isset($collected['content']['commits']) && $collected['content']['commits'] !== null) { for ($i = 0; $i < 20 && $i < count($collected['content']['commits']); $i++) { if (!$console) { $text .= "<tr><td class='v' colspan='2'>{$collected['content']['commits'][$i]['desc']}</td><td class='e'>{$collected['content']['commits'][$i]['period']}</td></tr>"; } else { } } if (count($collected['content']['commits']) > 20) { if (!$console) { $text .= Design::erstelleZeile($console, Language::Get('gitUpdate', 'additionalCommits', array('additionalCommits' => count($collected['content']['commits']) - 20)), 'v'); } else { } } if (count($collected['content']['commits']) > 0) { if (!$console) { $text .= Design::erstelleZeileShort($console, Language::Get('gitUpdate', 'installGitUpdatesDesc'), 'e', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0], Language::Get('gitUpdate', 'installGitUpdates')), 'h'); } } } if (self::$installed) { $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error, Language::Get('gitUpdate', 'executeGitUpdatesDesc')); } } echo Design::erstelleBlock($console, Language::Get('gitUpdate', 'title'), $text); return null; }
public static function show($console, $result, $data) { $isUpdate = isset($data['action']) && $data['action'] == 'update' ? true : false; $text = ''; if (!$console) { $text .= Design::erstelleBeschreibung($console, Language::Get('components', 'description')); $text .= Design::erstelleZeile($console, Language::Get('components', 'init'), 'e', '', 'v', Design::erstelleSubmitButton(self::$onEvents['install']['event'][0]), 'h'); $text .= Design::erstelleZeile($console, Language::Get('components', 'details'), 'e', Design::erstelleAuswahl($console, $data['CO']['co_details'], 'data[CO][co_details]', 'details', null, true), 'v'); } if (isset($result[self::$onEvents['install']['name']]) && $result[self::$onEvents['install']['name']] != null) { $result = $result[self::$onEvents['install']['name']]; } else { $result = array('content' => null, 'fail' => false, 'errno' => null, 'error' => null); } $fail = $result['fail']; $error = $result['error']; $errno = $result['errno']; $content = $result['content']; if (self::$installed) { // counts installed commands $installedCommands = 0; // counts installed components $installedComponents = 0; // counts installed links $installedLinks = 0; foreach ($content as $componentName => &$component) { if (isset($component['init'])) { $component['init'] = Component::decodeComponent(json_encode($component['init'])); } if (isset($component['links'])) { $component['links'] = Link::decodeLink(json_encode($component['links'])); } if (isset($component['commands'])) { $router = new \Slim\Router(); foreach ($component['commands'] as $command) { $route = new \Slim\Route($command['path'], 'is_array'); $route->via(isset($command['method']) ? strtoupper($command['method']) : 'GET'); $router->map($route); } $component['router'] = $router; } } foreach ($content as $componentName => $component) { $linkNames = array(); $linkNamesUnique = array(); $callNames = array(); $links = array(); if (isset($component['links'])) { $links = $component['links']; } foreach ($links as $link) { $linkNames[] = $link->getName(); $linkNamesUnique[$link->getName()] = $link->getName(); } $calls = null; if (isset($component['call'])) { $calls = $component['call']; } if ($calls !== null) { foreach ($calls as $pos => $callList) { if (isset($callList['name'])) { $callNames[$callList['name']] = $callList['name']; } } } $countLinks = 1; if (isset($component['init']) && $component['init'] !== null && $component['init']->getStatus() === 201) { $countLinks += count($linkNames) + count(array_diff($callNames, $linkNamesUnique)) + count($linkNamesUnique) - count(array_diff($linkNamesUnique, $callNames)); $countLinks++; } else { if (!isset($component['init']) || $component['init'] === null) { $fail = true; $error = Language::Get('components', 'componentCrashed'); } } $countCommands = count(isset($component['commands']) ? $component['commands'] : array()); if (isset($component['init']) && isset($data['CO']['co_details']) && $data['CO']['co_details'] === 'details' && !$isUpdate) { $defs = explode(";", $component['init']->getDef()); $baseComponent = count($defs) > 2 ? "<br><span class='info-color tiny'>(" . $defs[0] . ")</span>" : ''; $text .= "<tr><td class='e' rowspan='{$countLinks}'>{$componentName}{$baseComponent}</td><td class='v'>{$component['init']->getAddress()}</td><td class='e'><div align ='center'>" . ($component['init']->getStatus() === 201 ? Language::Get('main', 'ok') : "<font color='red'>" . Language::Get('main', 'fail') . " ({$component['init']->getStatus()})</font>") . "</align></td></tr>"; } if (isset($component['init']) && $component['init'] !== null && $component['init']->getStatus() === 201) { $installedComponents++; $installedLinks += count(isset($component['links']) ? $component['links'] : array()); $installedCommands += $countCommands; if (isset($data['CO']['co_details']) && $data['CO']['co_details'] === 'details' && !$isUpdate) { $text .= "<tr><td class='v' colspan='2'>" . Language::Get('components', 'installedCalls') . ": {$countCommands}</td></tr>"; } $links = array(); if (isset($component['links'])) { $links = $component['links']; } $lastLink = null; foreach ($links as $link) { $calls = null; if (isset($component['call'])) { $calls = $component['call']; } $linkFound = false; if ($calls !== null) { foreach ($calls as $pos => $callList) { if (isset($callList['name']) && $callList['name'] === $link->getName()) { $linkFound = true; break; } } } if ($lastLink != $link->getName() && $linkFound) { $calls = null; if (isset($component['call'])) { $calls = $component['call']; } $notRoutable = false; if ($calls !== null) { foreach ($calls as $pos => $callList) { if ($link->getName() !== $callList['name']) { continue; } if (isset($callList['links']) && $callList['links'] !== null) { foreach ($callList['links'] as $pos2 => $call) { if (!isset($content[$link->getTargetName()]['router'])) { $notRoutable = true; break; } if ($content[$link->getTargetName()]['router'] == null) { continue; } if ($call === null) { continue; } if (!isset($call['method'])) { continue; } if (!isset($call['path'])) { continue; } $routes = count($content[$link->getTargetName()]['router']->getMatchedRoutes(strtoupper($call['method']), $call['path']), true); if ($routes === 0) { $notRoutable = true; break; } } } if ($notRoutable) { break; } } if (isset($data['CO']['co_details']) && $data['CO']['co_details'] === 'details' && !$isUpdate) { $text .= "<tr><td class='v'>{$link->getName()}</td><td class='e'><div align ='center'>" . (!$notRoutable ? Language::Get('main', 'ok') : '<font color="red">' . Language::Get('components', 'notRoutable') . '</font>') . "</align></td></tr>"; } } } if (isset($data['CO']['co_details']) && $data['CO']['co_details'] === 'details' && !$isUpdate) { $text .= "<tr><td class='v'>{$link->getName()}" . (!$linkFound ? " (<font color='red'>" . Language::Get('components', 'unknown') . "</font>)" : '') . "</td><td class='v'>{$link->getTargetName()}</td></tr>"; } $lastLink = $link->getName(); } // fehlende links $calls = null; if (isset($component['call'])) { $calls = $component['call']; } if ($calls !== null) { foreach ($calls as $pos => $callList) { $found = false; foreach ($links as $link) { if ($link->getName() == $callList['name']) { $found = true; break; } } if (!$found) { if (isset($data['CO']['co_details']) && $data['CO']['co_details'] === 'details' && !$isUpdate) { $text .= "<tr><td class='v'>{$callList['name']}</td><td class='e'><font color='red'>" . Language::Get('components', 'unallocated') . "</font></td></tr>"; } } } } } } if ($installedComponents == 0) { $fail = true; $error = Language::Get('components', 'noComponents'); } else { if ($installedLinks == 0) { $fail = true; $error = Language::Get('components', 'noLinks'); } else { if ($installedCommands == 0) { $fail = true; $error = Language::Get('components', 'noCommands'); } } } if (isset($data['CO']['co_details']) && $data['CO']['co_details'] === 'details' && !$isUpdate) { $text .= Design::erstelleZeile($console, '', '', '', '', '', ''); } $text .= Design::erstelleZeile($console, Language::Get('components', 'installedComponents'), 'e', '', 'v', $installedComponents, 'v'); $text .= Design::erstelleZeile($console, Language::Get('components', 'installedLinks'), 'e', '', 'v', $installedLinks, 'v'); $text .= Design::erstelleZeile($console, Language::Get('components', 'installedCommands'), 'e', '', 'v', $installedCommands, 'v'); $text .= Design::erstelleInstallationszeile($console, $fail, $errno, $error); } echo Design::erstelleBlock($console, Language::Get('components', 'title'), $text); }
/** * 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); } }