Esempio n. 1
0
 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;
 }
Esempio n. 2
0
 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;
 }
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 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);
 }