From 4bd91a811dee1f8d68cd36a3fd72416d271d7eb0 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 9 Feb 2015 13:54:55 +0100 Subject: [PATCH] change admin_configfiles to handle the new XML-configs instead of the old php-arrays Signed-off-by: Michael Kaufmann (d00p) --- admin_configfiles.php | 331 +++++++++--------- lng/dutch.lng.php | 3 - lng/english.lng.php | 8 +- lng/french.lng.php | 3 - lng/german.lng.php | 8 +- lng/italian.lng.php | 3 - lng/portugues.lng.php | 3 - lng/swedish.lng.php | 3 - .../Sparkle/admin/configfiles/configfiles.tpl | 41 ++- .../configfiles/configfiles_commands.tpl | 9 +- .../admin/configfiles/configfiles_file.tpl | 9 +- .../admin/configfiles/configfiles_files.tpl | 6 - .../configfiles/configfiles_subfileblock.tpl | 5 + .../Sparkle/admin/configfiles/wizard.tpl | 24 +- templates/Sparkle/assets/css/main.css | 11 + 15 files changed, 250 insertions(+), 217 deletions(-) delete mode 100644 templates/Sparkle/admin/configfiles/configfiles_files.tpl create mode 100644 templates/Sparkle/admin/configfiles/configfiles_subfileblock.tpl diff --git a/admin_configfiles.php b/admin_configfiles.php index 37c1fd68..d35593d1 100644 --- a/admin_configfiles.php +++ b/admin_configfiles.php @@ -2,7 +2,6 @@ /** * This file is part of the Froxlor project. - * Copyright (c) 2003-2009 the SysCP Team (see authors). * Copyright (c) 2010 the Froxlor Team (see authors). * * For the full copyright and license information, please view the COPYING @@ -10,174 +9,182 @@ * COPYING file online at http://files.froxlor.org/misc/COPYING.txt * * @copyright (c) the authors - * @author Florian Lippert (2003-2009) * @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Panel * + * @since 0.9.34 */ - define('AREA', 'admin'); -$need_db_sql_data = true; require './lib/init.php'; -require './lib/configfiles_index.inc.php'; -$distribution = ''; -$distributions_select = ''; -$service = ''; -$services_select = ''; -$daemon = ''; -$daemons_select = ''; - -if($userinfo['change_serversettings'] == '1') -{ - if(isset($_GET['distribution']) - && $_GET['distribution'] != '' - && isset($configfiles[$_GET['distribution']]) - && is_array($configfiles[$_GET['distribution']])) - { - $distribution = $_GET['distribution']; - - if(isset($_GET['service']) - && $_GET['service'] != '' - && isset($configfiles[$distribution]['services'][$_GET['service']]) - && is_array($configfiles[$distribution]['services'][$_GET['service']])) - { - $service = $_GET['service']; - - if(isset($_GET['daemon']) - && $_GET['daemon'] != '' - && isset($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']]) - && is_array($configfiles[$distribution]['services'][$service]['daemons'][$_GET['daemon']])) - { - $daemon = $_GET['daemon']; - } - else - { - foreach($configfiles[$distribution]['services'][$service]['daemons'] as $daemon_name => $daemon_details) - { - $daemons_select.= makeoption($daemon_details['label'], $daemon_name); - } - } - } - else - { - foreach($configfiles[$distribution]['services'] as $service_name => $service_details) - { - $services_select.= makeoption($service_details['label'], $service_name); - } - } - } - else - { - foreach($configfiles as $distribution_name => $distribution_details) - { - $distributions_select.= makeoption($distribution_details['label'], $distribution_name); - } - } - - if($distribution != '' - && $service != '' - && $daemon != '') - { - $replace_arr = Array( - '' => $sql['user'], - '' => 'MYSQL_PASSWORD', - '' => $sql['db'], - '' => $sql['host'], - '' => Settings::Get('system.hostname'), - '' => Settings::Get('system.ipaddress'), - '' => Settings::Get('system.nameservers'), - '' => Settings::Get('system.vmail_homedir'), - '' => Settings::Get('system.vmail_uid'), - '' => Settings::Get('system.vmail_gid'), - '' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '', - '' => (Settings::Get('system.mod_fcgid_tmpdir') != '') ? makeCorrectDir(Settings::Get('system.mod_fcgid_tmpdir')) : '/tmp/', - '' => makeCorrectDir(FROXLOR_INSTALL_DIR), - '' => makeCorrectDir(Settings::Get('system.bindconf_directory')), - '' => Settings::Get('system.apachereload_command'), - '' => makeCorrectDir(Settings::Get('system.logfiles_directory')), - '' => makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')), - '' => Settings::Get('system.httpgroup') - ); - $files = ''; - $configpage = ''; - foreach($configfiles[$distribution]['services'][$service]['daemons'][$daemon] as $action => $value) - { - if(substr($action, 0, 8) == 'commands') - { - $commands = ''; - - if(is_array($value)) - { - $commands = implode("\n", $value); - $commands = str_replace("\n\n", "\n", $commands); - - if($commands != '') - { - eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";"); - } - } - } - elseif(substr($action, 0, 5) == 'files') - { - $files = ''; - - if(is_array($value)) - { - while(list($filename, $realname) = each($value)) - { - $file_content = file_get_contents('./templates/misc/configfiles/' . $distribution . '/' . $daemon . '/' . $filename); - $file_content = strtr($file_content, $replace_arr); - $file_content = htmlspecialchars($file_content); - $numbrows = count(explode("\n", $file_content)); - eval("\$files.=\"" . getTemplate("configfiles/configfiles_file") . "\";"); - } - - eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_files") . "\";"); - } - } - } - - if(isset($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']) - && is_array($configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart'])) - { - $restart = implode("\n", $configfiles[$distribution]['services'][$service]['daemons'][$daemon]['restart']); - } - else - { - $restart = ''; - } - - eval("echo \"" . getTemplate("configfiles/configfiles") . "\";"); - } - elseif($page == 'overview') - { - $log->logAction(ADM_ACTION, LOG_NOTICE, "viewed admin_configfiles"); - $distributions = ''; - foreach($configfiles as $distribution_name => $distribution_details) - { - $services = ''; - foreach($distribution_details['services'] as $service_name => $service_details) - { - $daemons = ''; - foreach($service_details['daemons'] as $daemon_name => $daemon_details) - { - eval("\$daemons.=\"" . getTemplate("configfiles/choose_daemon") . "\";"); - } - - eval("\$services.=\"" . getTemplate("configfiles/choose_service") . "\";"); - } - - eval("\$distributions.=\"" . getTemplate("configfiles/choose_distribution") . "\";"); - } - - eval("echo \"" . getTemplate("configfiles/choose") . "\";"); - } - else - { - eval("echo \"" . getTemplate("configfiles/wizard") . "\";"); - } +if ($userinfo['change_serversettings'] == '1') { + + $replace_arr = Array( + '' => $sql['user'], + '' => 'MYSQL_PASSWORD', + '' => $sql['db'], + '' => $sql['host'], + '' => Settings::Get('system.hostname'), + '' => Settings::Get('system.ipaddress'), + '' => Settings::Get('system.nameservers'), + '' => Settings::Get('system.vmail_homedir'), + '' => Settings::Get('system.vmail_uid'), + '' => Settings::Get('system.vmail_gid'), + '' => (Settings::Get('system.use_ssl') == '1') ? 'imaps pop3s' : '', + '' => (Settings::Get('system.mod_fcgid_tmpdir') != '') ? makeCorrectDir(Settings::Get('system.mod_fcgid_tmpdir')) : '/tmp/', + '' => makeCorrectDir(FROXLOR_INSTALL_DIR), + '' => makeCorrectDir(Settings::Get('system.bindconf_directory')), + '' => Settings::Get('system.apachereload_command'), + '' => makeCorrectDir(Settings::Get('system.logfiles_directory')), + '' => makeCorrectDir(Settings::Get('phpfpm.fastcgi_ipcdir')), + '' => Settings::Get('system.httpgroup') + ); + + // get distro from URL param + $distribution = isset($_GET['distribution']) ? $_GET['distribution'] : ""; + $service = isset($_GET['service']) ? $_GET['service'] : ""; + $daemon = isset($_GET['daemon']) ? $_GET['daemon'] : ""; + $distributions_select = ""; + $services_select = ""; + $daemons_select = ""; + + $configfiles = ""; + $services = ""; + $daemons = ""; + + $config_dir = makeCorrectDir(FROXLOR_INSTALL_DIR . '/lib/configfiles/'); + + if ($distribution != "") { + // create configparser object + $configfiles = new ConfigParser($config_dir . '/' . $distribution . ".xml"); + + // get distro-info + $dist_display = getCompleteDistroName($configfiles); + + // get all the services from the distro + $services = $configfiles->getServices(); + + if ($service != "") { + + $daemons = $services[$service]->getDaemons(); + + if ($daemon == "") { + foreach ($daemons as $di => $dd) { + $daemons_select .= makeoption($dd->title, $di); + } + } + } else { + foreach ($services as $si => $sd) { + $services_select .= makeoption($sd->title, $si); + } + } + } else { + + // show list of available distro's + $distros = glob($config_dir . '*.xml'); + // read in all the distros + foreach ($distros as $_distribution) { + // get configparser object + $dist = new ConfigParser($_distribution); + // get distro-info + $dist_display = getCompleteDistroName($dist); + // create select-box-option + $distributions_select .= makeoption($dist_display, str_replace(".xml", "", strtolower(basename($_distribution)))); + } + } + + if ($distribution != "" && $service != "" && $daemon != "") { + + $confarr = $daemons[$daemon]->getConfig(); + + $configpage = ''; + + $commands_pre = ""; + $commands_file = ""; + $commands_post = ""; + + $lasttype = ''; + $commands = ''; + foreach ($confarr as $idx => $action) { + if ($lasttype != '' && $lasttype != $action['type']) { + eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";"); + $lasttype = ''; + $commands = ''; + } + switch ($action['type']) { + case "install": + $commands .= $action['content'] . "\n"; + $lasttype = "install"; + break; + case "command": + $commands .= $action['content'] . "\n"; + $lasttype = "command"; + break; + case "file": + if (array_key_exists('content', $action)) { + $commands_file = getFileContentContainer($action['content'], $replace_arr, $action['name']); + } elseif (array_key_exists('subcommands', $action)) { + foreach ($action['subcommands'] as $fileaction) { + if (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "pre") { + $commands_pre .= $fileaction['content'] . "\n"; + } elseif (array_key_exists('execute', $fileaction) && $fileaction['execute'] == "post") { + $commands_post .= $fileaction['content'] . "\n"; + } elseif ($fileaction['type'] == 'file') { + $commands_file = getFileContentContainer($fileaction['content'], $replace_arr, $action['name']); + } + } + } + $realname = $action['name']; + $commands = trim($commands_pre); + if ($commands != "") { + eval("\$commands_pre=\"" . getTemplate("configfiles/configfiles_commands") . "\";"); + } + $commands = trim($commands_post); + if ($commands != "") { + eval("\$commands_post=\"" . getTemplate("configfiles/configfiles_commands") . "\";"); + } + eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_subfileblock") . "\";"); + $commands_pre = ''; + $commands_post = ''; + break; + } + } + $commands = trim($commands); + if ($commands != '') { + eval("\$configpage.=\"" . getTemplate("configfiles/configfiles_commands") . "\";"); + } + eval("echo \"" . getTemplate("configfiles/configfiles") . "\";"); + } else { + eval("echo \"" . getTemplate("configfiles/wizard") . "\";"); + } +} else { + die('not allowed to see this page'); + // redirect or similar here } -?> +// helper functions +function getFileContentContainer($file_content, &$replace_arr, $realname) +{ + $files = ""; + if ($file_content != '') { + $file_content = strtr($file_content, $replace_arr); + $file_content = htmlspecialchars($file_content); + $numbrows = count(explode("\n", $file_content)); + eval("\$files=\"" . getTemplate("configfiles/configfiles_file") . "\";"); + } + return $files; +} + +function getCompleteDistroName($cparser) +{ + // get distro-info + $dist_display = $cparser->distributionName; + if ($cparser->distributionVersion != '') { + $dist_display .= " (" . $cparser->distributionVersion . ")"; + } + if ($cparser->deprecated) { + $dist_display .= " [deprecated]"; + } + return $dist_display; +} diff --git a/lng/dutch.lng.php b/lng/dutch.lng.php index 085bcde6..a78c2b14 100644 --- a/lng/dutch.lng.php +++ b/lng/dutch.lng.php @@ -269,9 +269,6 @@ $lng['admin']['deactivated_user'] = 'Gebruiker deactiveren'; $lng['admin']['sendpassword'] = 'Verstuur wachtwoord'; $lng['admin']['ownvhostsettings'] = 'Eigen vHost-Instellingen'; $lng['admin']['configfiles']['serverconfiguration'] = 'Configuratie'; -$lng['admin']['configfiles']['files'] = 'Configuratiebestanden: Wijzig de volgende bestanden of maak ze aan met
de volgende inhoud als u dit nog niet gedaan heeft.
Let Op: Het MySQL-wachtwoord is niet aangepast vanwege beveiligings overwegingen.
Vervang "MYSQL_PASSWORD" zelf. Als u uw MYSQl wachtwoord vergeten bent
kunt u het terugvinden in "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Commando\'s: Start de volgende commando\'s in een shell.'; -$lng['admin']['configfiles']['restart'] = 'Herstarten: Start de volgende commando\'s in een shell zodat de configuratie opnieuw geladen wordt.'; $lng['admin']['templates']['templates'] = 'Sjablonen'; $lng['admin']['templates']['template_add'] = 'Maak sjabloon'; $lng['admin']['templates']['template_edit'] = 'Bewerk sjabloon'; diff --git a/lng/english.lng.php b/lng/english.lng.php index 9c790c58..70ec6c69 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -300,9 +300,6 @@ $lng['admin']['deactivated_user'] = 'Deactivate user'; $lng['admin']['sendpassword'] = 'Send password'; $lng['admin']['ownvhostsettings'] = 'Own vHost-settings'; $lng['admin']['configfiles']['serverconfiguration'] = 'Configuration'; -$lng['admin']['configfiles']['files'] = 'Configfiles: Please change the following files or create them with
the following content if they do not exist.
Please note: The MySQL-password has not been replaced for security reasons.
Please replace "MYSQL_PASSWORD" on your own. If you forgot your MySQL-password
you\'ll find it in "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Commands: Please execute the following commands in a shell.'; -$lng['admin']['configfiles']['restart'] = 'Restart: Please execute the following commands in a shell in order to reload the new configuration.'; $lng['admin']['templates']['templates'] = 'Email-templates'; $lng['admin']['templates']['template_add'] = 'Add template'; $lng['admin']['templates']['template_edit'] = 'Edit template'; @@ -1839,3 +1836,8 @@ $lng['usersettings']['custom_notes']['show'] = 'Show your notes on the dashboard $lng['serversettings']['system_send_cron_errors']['title'] = 'Send cron-errors to froxlor-admin via e-mail'; $lng['serversettings']['system_send_cron_errors']['description'] = 'Chose whether you want to receive an e-mail on cronjob errors. Keep in mind that this can lead to an e-mail being sent every 5 minutes depending on the error and your cronjob settings.'; $lng['error']['fcgidandphpfpmnogoodtogether'] = 'FCGID and PHP-FPM cannot be activated at the same time'; + +// Added in Froxlor 0.9.34 +$lng['admin']['configfiles']['legend'] = 'You are about to configure a service/daemon. The following legend explains the nomenclature.'; +$lng['admin']['configfiles']['commands'] = 'Commands: These commands are to be executed line by line as root-user in a shell.
It is safe to copy the whole block and paste it into the shell.'; +$lng['admin']['configfiles']['files'] = 'Configfiles: This is an example of the contents of a configuration file.
The commands before these textfields should open an editor with the target file.
Just copy and paste the contents into the editor and save the file.

Please note: The MySQL-password has not been replaced for security reasons. Please replace "MYSQL_PASSWORD" on your own. If you forgot your MySQL-password you\'ll find it in "lib/userdata.inc.php"'; diff --git a/lng/french.lng.php b/lng/french.lng.php index 8e146d26..92fe9a7b 100644 --- a/lng/french.lng.php +++ b/lng/french.lng.php @@ -302,9 +302,6 @@ $lng['admin']['deactivated_user'] = 'Désactiver l\'utilisateur'; $lng['admin']['sendpassword'] = 'Envoyer le mot de passe'; $lng['admin']['ownvhostsettings'] = 'Configuration spéciale du vHost'; $lng['admin']['configfiles']['serverconfiguration'] = 'Exemple de configuration'; -$lng['admin']['configfiles']['files'] = 'Fichiers de configuration : Veuillez créer ou modifier les fichiers suivants avec le contenu ci-dessous.

IMPORTANT : Le mot de passe MySQL n\'est pas donné dans les informations ci-dessous
pour des raisons de sécurité. Veuillez donc remplacer les "MYSQL_PASSWORD"
manuellement avec le mot de passe correspondant. En cas d\'oubli, vous pouvez le retrouver dans
le fichier "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Commandes : Veuillez exécuter les commandes ci-dessous dans le shell.'; -$lng['admin']['configfiles']['restart'] = 'Redémarrage : Veuillez exécuter les commandes ci-dessous pour
prendre en compte les changements.'; $lng['admin']['templates']['templates'] = 'Modèles'; $lng['admin']['templates']['template_add'] = 'Ajouter un modèle'; $lng['admin']['templates']['template_edit'] = 'Modifier un modèle'; diff --git a/lng/german.lng.php b/lng/german.lng.php index a6dabfac..0ef754db 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -299,9 +299,6 @@ $lng['admin']['deactivated_user'] = 'Benutzer sperren'; $lng['admin']['sendpassword'] = 'Passwort zusenden'; $lng['admin']['ownvhostsettings'] = 'Eigene vHost-Einstellungen'; $lng['admin']['configfiles']['serverconfiguration'] = 'Konfiguration'; -$lng['admin']['configfiles']['files'] = 'Konfigurationsdateien: Bitte ändern Sie die entsprechenden Konfigurationsdateien oder legen Sie mit dem folgenden Inhalt neu an, falls sie nicht existieren.
Beachten Sie: Das MySQL-Passwort wurde aus Sicherheitsgründen nicht ersetzt. Bitte ersetzen Sie "MYSQL_PASSWORD" manuell durch das entsprechende Passwort. Falls Sie es vergessen haben sollten, finden Sie es in der Datei "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Kommandos: Bitte führen Sie die folgenden Kommandos in einer Shell aus.'; -$lng['admin']['configfiles']['restart'] = 'Neustart: Bitte führen Sie die folgenden Kommandos zum Neuladen der Konfigurationsdateien in einer Shell aus.'; $lng['admin']['templates']['templates'] = 'E-Mail-Vorlagen'; $lng['admin']['templates']['template_add'] = 'Vorlage hinzufügen'; $lng['admin']['templates']['template_edit'] = 'Vorlage bearbeiten'; @@ -1566,3 +1563,8 @@ $lng['usersettings']['custom_notes']['show'] = 'Zeige die Notizen auf dem Dashbo $lng['serversettings']['system_send_cron_errors']['title'] = 'Sende Cron-Fehler via E-Mail an den Froxlor-Admin'; $lng['serversettings']['system_send_cron_errors']['description'] = 'Gib an, ob bei einem Cron-Fehler eine E-Mail versendet werden soll. Beachte das es je nach Fehler und Cronjob-Einstellungen dazu kommen kann, dass diese E-Mail alle 5 Minuten gesendet wird.'; $lng['error']['fcgidandphpfpmnogoodtogether'] = 'FCGID und PHP-FPM können nicht gleichzeitig aktiviert werden.'; + +// Added in Froxlor 0.9.34 +$lng['admin']['configfiles']['legend'] = 'Du konfigurierst nun einen Service/Daemon. Die folgende Legende zeigen unsere Nomenklatur.'; +$lng['admin']['configfiles']['commands'] = 'Kommandos: Die angezeigten Befehle müssen als Benutzer root in einer Shell ausgeführt werden.
Es kann auch problemlos der ganze Block kopiert und in die Shell eingefügt werden.'; +$lng['admin']['configfiles']['files'] = 'Konfigurationsdateien: Dies ist der Inhalt einer Konfigurationsdatei.
Der Befehl direkt vor dem Textfeld sollte einen Editor mit der Zeildatei öffnen.
Der Inhalt kann nun einfach kopiert und in den Editor eingefügt und die Datei gespeichert werden.

Beachten Sie: Das MySQL-Passwort wurde aus Sicherheitsgründen nicht ersetzt. Bitte ersetzen Sie "MYSQL_PASSWORD" manuell durch das entsprechende Passwort. Falls Sie es vergessen haben sollten, finden Sie es in der Datei "lib/userdata.inc.php".'; diff --git a/lng/italian.lng.php b/lng/italian.lng.php index f1ea20c7..3d0a71f4 100644 --- a/lng/italian.lng.php +++ b/lng/italian.lng.php @@ -293,9 +293,6 @@ $lng['admin']['deactivated_user'] = 'Disattiva utente'; $lng['admin']['sendpassword'] = 'Invia password'; $lng['admin']['ownvhostsettings'] = 'Impostazioni vHost speciali'; $lng['admin']['configfiles']['serverconfiguration'] = 'Configurazione servizi'; -$lng['admin']['configfiles']['files'] = 'File di configurazione: Per favore cambia questi file o creali
se non esistono, con il seguente contenuto.
NOTA: La password di MySQL non è stata rimpiazzata per ragioni di sicurezza.
Per favore rimpiazza "MYSQL_PASSWORD" con la password MySQL dell\'utente Froxlor. Se hai dimenticato la password per MySQL
la trovi in "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Comandi: Per favore esegui i seguenti comandi in una shell.'; -$lng['admin']['configfiles']['restart'] = 'Ricarica: Per favore esegui i seguenti comandi (in ordine) in una shell per ricaricare la configurazione.'; $lng['admin']['templates']['templates'] = 'Template'; $lng['admin']['templates']['template_add'] = 'Aggiungi template'; $lng['admin']['templates']['template_edit'] = 'Modifica template'; diff --git a/lng/portugues.lng.php b/lng/portugues.lng.php index e028156b..75f2a84d 100644 --- a/lng/portugues.lng.php +++ b/lng/portugues.lng.php @@ -297,9 +297,6 @@ $lng['admin']['deactivated_user'] = 'Desativar usuário'; $lng['admin']['sendpassword'] = 'Enviar senha'; $lng['admin']['ownvhostsettings'] = 'Own vHost-Settings'; $lng['admin']['configfiles']['serverconfiguration'] = 'Configurações'; -$lng['admin']['configfiles']['files'] = 'Configfiles: Por favor altere os seguintes arquivos ou crie eles com
o seguinte conteúdo se ele não existir.
Por favor observe: A senha do MySQL não foi alterada por razões de segurança.
Por favor substitua "MYSQL_PASSWORD" por uma sua. Se você esqueceu a senha do MySQL
você pode verificar em "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Commands: Por favor execute as seguintes comandos no shell.'; -$lng['admin']['configfiles']['restart'] = 'Restart: Por favor execute as seguintes comandos no shell para carregar aas novas configurações.'; $lng['admin']['templates']['templates'] = 'Templates'; $lng['admin']['templates']['template_add'] = 'Adicionar template'; $lng['admin']['templates']['template_edit'] = 'Editar template'; diff --git a/lng/swedish.lng.php b/lng/swedish.lng.php index 18f0c548..d6caf52d 100644 --- a/lng/swedish.lng.php +++ b/lng/swedish.lng.php @@ -286,9 +286,6 @@ $lng['admin']['deactivated_user'] = 'Avaktivera användare'; $lng['admin']['sendpassword'] = 'Skicka lösenord'; $lng['admin']['ownvhostsettings'] = 'Egna vHost-Inställningar'; $lng['admin']['configfiles']['serverconfiguration'] = 'Konfiguration'; -$lng['admin']['configfiles']['files'] = 'Konfigurationsfiler: Ändra eller skapa följande filer med
följande innehåll om de inte finns redan.
Notera: MySQL-lösenordet har inte ändrats på grund av säkerhetsskäl.
Du måste själv ändra lösenordet "MYSQL_PASSWORD" på egen hand. Om du glömt bort ditt MySQL-password
så kan du hitta det här "lib/userdata.inc.php".'; -$lng['admin']['configfiles']['commands'] = 'Kommandon: Kör följande kommandon i ett terminalfönster.'; -$lng['admin']['configfiles']['restart'] = 'Omstart: Kör följande kommandon i ett terminalfönster för att ladda in den nya konfigurationen.'; $lng['admin']['templates']['templates'] = 'Mallar'; $lng['admin']['templates']['template_add'] = '[Lägg till en ny mall]'; $lng['admin']['templates']['template_edit'] = 'Ändra en befintlig mall'; diff --git a/templates/Sparkle/admin/configfiles/configfiles.tpl b/templates/Sparkle/admin/configfiles/configfiles.tpl index 28edca8b..9d8cb0d2 100644 --- a/templates/Sparkle/admin/configfiles/configfiles.tpl +++ b/templates/Sparkle/admin/configfiles/configfiles.tpl @@ -3,27 +3,38 @@ $header

  - {$configfiles[$distribution]['label']} »  - {$configfiles[$distribution]['services'][$service]['label']} »  - {$configfiles[$distribution]['services'][$service]['daemons'][$daemon]['label']}  -[{$lng['panel']['back']}] + {$dist_display} »  + {$services[$service]->title} »  + {$daemons[$daemon]->title} [{$lng['panel']['back']}]

- - {$configpage} - - - +
{$lng['admin']['configfiles']['restart']}
- - + + - -
- {$lng['admin']['configfiles']['legend']}[close]
-
+ + {$lng['admin']['configfiles']['commands']} +
+chmod u+x example-script.sh
+./example-script.sh
+ + + {$lng['admin']['configfiles']['files']} + +
Lorem ipsum dolor sit amet,
+consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt
+ut labore et dolore magna aliquyam erat, sed diam voluptua.
+At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+ + + +
+ +
+ {$configpage}
$footer diff --git a/templates/Sparkle/admin/configfiles/configfiles_commands.tpl b/templates/Sparkle/admin/configfiles/configfiles_commands.tpl index 85bfee0a..20063a07 100644 --- a/templates/Sparkle/admin/configfiles/configfiles_commands.tpl +++ b/templates/Sparkle/admin/configfiles/configfiles_commands.tpl @@ -1,6 +1,3 @@ - - {$lng['admin']['configfiles']['commands']} - - - - +
+
{$commands}
+
diff --git a/templates/Sparkle/admin/configfiles/configfiles_file.tpl b/templates/Sparkle/admin/configfiles/configfiles_file.tpl index 7c737366..cdea0337 100644 --- a/templates/Sparkle/admin/configfiles/configfiles_file.tpl +++ b/templates/Sparkle/admin/configfiles/configfiles_file.tpl @@ -1,5 +1,4 @@ -

-
- -

- +
+
$EDITOR {$realname}
+
{$file_content}
+
diff --git a/templates/Sparkle/admin/configfiles/configfiles_files.tpl b/templates/Sparkle/admin/configfiles/configfiles_files.tpl deleted file mode 100644 index 3b07f63c..00000000 --- a/templates/Sparkle/admin/configfiles/configfiles_files.tpl +++ /dev/null @@ -1,6 +0,0 @@ - - {$lng['admin']['configfiles']['files']} - - - {$files} - diff --git a/templates/Sparkle/admin/configfiles/configfiles_subfileblock.tpl b/templates/Sparkle/admin/configfiles/configfiles_subfileblock.tpl new file mode 100644 index 00000000..9e886073 --- /dev/null +++ b/templates/Sparkle/admin/configfiles/configfiles_subfileblock.tpl @@ -0,0 +1,5 @@ +
+ {$commands_pre} + {$commands_file} + {$commands_post} +
diff --git a/templates/Sparkle/admin/configfiles/wizard.tpl b/templates/Sparkle/admin/configfiles/wizard.tpl index a9fec6d0..66fbdc0a 100644 --- a/templates/Sparkle/admin/configfiles/wizard.tpl +++ b/templates/Sparkle/admin/configfiles/wizard.tpl @@ -17,11 +17,31 @@ $header - + - + diff --git a/templates/Sparkle/assets/css/main.css b/templates/Sparkle/assets/css/main.css index 7796a54c..0f23a1a8 100644 --- a/templates/Sparkle/assets/css/main.css +++ b/templates/Sparkle/assets/css/main.css @@ -1453,3 +1453,14 @@ table thead th.tablesorter-headerDesc { .nolbr { white-space: nowrap; } + +.shell { + font-family: Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace; + color: #bbb; + background-color: #333; + border: 1px solid #000; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + padding: 10px; +}
{$lng['admin']['configfiles']['distribution']}:{$configfiles[$distribution]['label']} + + + {$dist_display} + + + +
{$lng['admin']['configfiles']['service']}:{$configfiles[$distribution]['services'][$service]['label']} + + + {$services[$service]->title} + + + +
{$lng['admin']['configfiles']['daemon']}: