Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
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;
 }
 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;
 }
Ejemplo n.º 5
0
 public static function show($console, $result, $data)
 {
     $text = '';
     $text .= Design::erstelleBeschreibung($console, Language::Get('extensions', 'description'));
     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);
     }
     $fail = $result['fail'];
     $error = $result['error'];
     $errno = $result['errno'];
     $content = $result['content'];
     if ($content != null) {
         foreach ($content as $extensionName => $status) {
             if (!$console) {
                 $text .= Design::erstelleZeile($console, $extensionName, 'e', $status ? Language::Get('main', 'ok') : "<font color='red'>" . Language::Get('main', 'fail') . "</font>", 'v');
             } else {
                 $text .= $extensionName . ' ' . ($status ? Language::Get('main', 'ok') : Language::Get('main', 'fail')) . "\n";
             }
         }
     } else {
         $text .= Design::erstelleZeile($console, "<font color='red'>" . Language::Get('main', 'fail') . "</font>", 'e');
     }
     echo Design::erstelleBlock($console, Language::Get('extensions', 'title'), $text);
     return null;
 }
Ejemplo n.º 6
0
 public static function show($console, $result, $data)
 {
     $text = '';
     if (!$console) {
         $text .= Design::erstelleBeschreibung($console, Language::Get('database_informations', 'description'));
         $text .= Design::erstelleZeile($console, Language::Get('database_informations', 'db_path'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_path'], 'data[DB][db_path]', 'localhost', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('database_informations', 'db_name'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_name'], 'data[DB][db_name]', 'uebungsplattform', true), 'v');
         echo Design::erstelleBlock($console, Language::Get('database_informations', 'title'), $text);
     }
     $text = '';
     if (!$console) {
         $text .= "<tr><td colspan='2'>" . Language::Get('databaseAdmin', 'description') . "</td></tr>";
         $text .= Design::erstelleZeile($console, Language::Get('databaseAdmin', 'db_user'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_user'], 'data[DB][db_user]', 'root', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('databaseAdmin', 'db_passwd'), 'e', Design::erstellePasswortzeile($console, $data['DB']['db_passwd'], 'data[DB][db_passwd]', '', true), 'v');
         echo Design::erstelleBlock($console, Language::Get('databaseAdmin', 'title'), $text);
     }
     $text = '';
     if (!$console) {
         $text .= "<tr><td colspan='2'>" . Language::Get('databasePlatformUser', 'description') . "</td></tr>";
         $text .= Design::erstelleZeile($console, Language::Get('databasePlatformUser', 'db_user_operator'), 'e', Design::erstelleEingabezeile($console, $data['DB']['db_user_operator'], 'data[DB][db_user_operator]', 'DBOperator', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('databasePlatformUser', 'db_passwd_operator'), 'e', Design::erstellePasswortzeile($console, $data['DB']['db_passwd_operator'], 'data[DB][db_passwd_operator]', '', true), 'v');
         echo Design::erstelleBlock($console, Language::Get('databasePlatformUser', 'title'), $text);
     }
     return null;
 }
Ejemplo n.º 7
0
 public static function show($console, $result, $data)
 {
     $text = '';
     $failure = false;
     Einstellungen::$path = dirname(__FILE__) . '/../config';
     if (!is_dir(Einstellungen::$path) || !is_writable(__FILE__)) {
         $text .= Design::erstelleZeile($console, Language::Get('mainInfo', 'notWritable'), 'error');
         $failure = true;
     }
     if ($failure) {
         echo Design::erstelleBlock($console, Language::Get('mainInfo', 'title'), $text);
     }
 }
Ejemplo n.º 8
0
 public static function show($console, $result, $data)
 {
     $text = '';
     $text .= Design::erstelleBeschreibung($console, Language::Get('general_informations', 'description'));
     if (!$console) {
         $text .= Design::erstelleZeile($console, Language::Get('general_informations', 'server_name'), 'e', Design::erstelleEingabezeile($console, $data['SV']['name'], 'data[SV][name]', $data['SV']['name'], false), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('general_informations', 'url'), 'e', Design::erstelleEingabezeile($console, $data['PL']['url'], 'data[PL][url]', 'http://localhost/uebungsplattform', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('general_informations', 'localPath'), 'e', Design::erstelleEingabezeile($console, $data['PL']['localPath'], 'data[PL][localPath]', '/var/www/uebungsplattform', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('general_informations', 'urlExtern'), 'e', Design::erstelleEingabezeile($console, $data['PL']['urlExtern'], 'data[PL][urlExtern]', 'http://localhost/uebungsplattform', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('general_informations', 'temp'), 'e', Design::erstelleEingabezeile($console, $data['PL']['temp'], 'data[PL][temp]', '/var/www/temp', true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('general_informations', 'files'), 'e', Design::erstelleEingabezeile($console, $data['PL']['files'], 'data[PL][files]', '/var/www/files', true), 'v');
     }
     echo Design::erstelleBlock($console, Language::Get('general_informations', 'title'), $text);
     return null;
 }
Ejemplo n.º 9
0
 public static function show($console, $result, $data)
 {
     $text = '';
     if (!$console) {
         $text .= Design::erstelleBeschreibung($console, Language::Get('access', 'description'));
         $text .= Design::erstelleZeile($console, Language::Get('access', 'local'), 'e', Design::erstelleGruppenAuswahl($console, $data['ZV']['zv_type'], 'data[ZV][zv_type]', 'local', 'local', true), 'v');
         $text .= Design::erstelleZeile($console, '&nbsp;', '', '', '');
         $text .= Design::erstelleZeile($console, Language::Get('access', 'ssh'), 'e', Design::erstelleGruppenAuswahl($console, $data['ZV']['zv_type'], 'data[ZV][zv_type]', 'ssh', null, true), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('access', 'username'), 'e', Design::erstelleEingabezeile($console, $data['ZV']['zv_ssh_login'], 'data[ZV][zv_ssh_login]', 'root'), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('access', 'address'), 'e', Design::erstelleEingabezeile($console, $data['ZV']['zv_ssh_address'], 'data[ZV][zv_ssh_address]', 'localhost'), 'v');
         $text .= Design::erstelleZeile($console, Language::Get('access', 'password'), 'e', Design::erstellePasswortzeile($console, $data['ZV']['zv_ssh_password'], 'data[ZV][zv_ssh_password]', ''), 'v', Design::erstelleGruppenAuswahl($console, $data['ZV']['zv_ssh_auth_type'], 'data[ZV][zv_ssh_auth_type]', 'passwd', 'passwd', true), 'h');
         $text .= Design::erstelleZeile($console, Language::Get('access', 'keyFile'), 'e', Design::erstelleEingabezeile($console, $data['ZV']['zv_ssh_key_file'], 'data[ZV][zv_ssh_key_file]', '/var/public.ppk'), 'v', Design::erstelleGruppenAuswahl($console, $data['ZV']['zv_ssh_auth_type'], 'data[ZV][zv_ssh_auth_type]', 'keyFile', null, true), 'h');
         echo Design::erstelleBlock($console, Language::Get('access', '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);
 }
Ejemplo n.º 12
0
 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;
 }
Ejemplo n.º 13
0
 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;
 }
Ejemplo n.º 14
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;
 }
Ejemplo n.º 15
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);
 }
Ejemplo n.º 16
0
 /**
  * Erzeugt eine Installationszeile
  * Prüft ob Fehler gemeldet wurden und gibt OK oder Fehler aus
  *
  * @param bool $console true = Konsolendarstellung, false = HTML
  * @param bool $fail true = Fehler, false = sonst
  * @param int $errno Die Fehlernummer
  * @param string $error Der Fehlertext 
  * @return string Der Text der Installationszeile
  */
 public static function erstelleInstallationszeile($console, $fail, $errno, $error, $descText = null)
 {
     $descText = isset($descText) ? $descText : Language::Get('main', 'installation');
     if (!$console) {
         if ($fail === true) {
             //$installFail = true;
             return Design::erstelleZeile($console, $descText, 'e', '', 'v', "<div align ='center'><font color='red'>" . Language::Get('main', 'fail') . ($errno != null && $errno != '' ? " ({$errno})" : '') . "<br> {$error}</font></align>", 'v');
         } else {
             return Design::erstelleZeile($console, $descText, 'e', '', 'v', '<div align ="center">' . Language::Get('main', 'ok') . '</align>', 'v');
         }
     } else {
         if ($fail === true) {
             //$installFail = true;
             return Design::erstelleZeile($console, $descText, 'e', '', 'v', Language::Get('main', 'fail') . ($errno != null && $errno != '' ? " ({$errno})" : '') . " {$error}", 'v');
         } else {
             return Design::erstelleZeile($console, $descText, 'e', '', 'v', Language::Get('main', 'ok'), 'v');
         }
     }
 }