From 4f4689c4e9778bd35430ff13f8e236455a0f671d Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Tue, 18 Feb 2014 17:13:25 +0100 Subject: [PATCH] also check for php.configs that are set as default on deletion; emphasize default config in overview Signed-off-by: Michael Kaufmann (d00p) --- admin_phpsettings.php | 19 +++++++++++++++++++ lng/english.lng.php | 1 + lng/german.lng.php | 1 + 3 files changed, 21 insertions(+) diff --git a/admin_phpsettings.php b/admin_phpsettings.php index 19967afc..ea0df113 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -72,6 +72,7 @@ if ($page == 'overview') { } } + // check whether we use that config as froxor-vhost config if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id'] || Settings::Get('phpfpm.vhost_defaultini') == $row['id'] ) { @@ -81,6 +82,16 @@ if ($page == 'overview') { if ($domains == '') { $domains = $lng['admin']['phpsettings']['notused']; } + + // check whether this is our default config + if ((Settings::Get('system.mod_fcgid') == '1' + && Settings::Get('system.mod_fcgid_defaultini') == $id) + || (Settings::Get('phpfpm.enabled') == '1' + && Settings::Get('phpfpm.defaultini') == $id) + ) { + $row['description'] = ''.$row['description'].''; + } + $count ++; eval("\$tablecontent.=\"" . getTemplate("phpconfig/overview_overview") . "\";"); } @@ -189,6 +200,14 @@ if ($page == 'overview') { standard_error('cannotdeletehostnamephpconfig'); } + if ((Settings::Get('system.mod_fcgid') == '1' + && Settings::Get('system.mod_fcgid_defaultini') == $id) + || (Settings::Get('phpfpm.enabled') == '1' + && Settings::Get('phpfpm.defaultini') == $id) + ) { + standard_error('cannotdeletedefaultphpconfig'); + } + if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['change_serversettings'] == 1 diff --git a/lng/english.lng.php b/lng/english.lng.php index 1f7fd5a6..f885aca4 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1814,3 +1814,4 @@ $lng['question']['admin_integritycheck_reallyfix'] = 'Do you really want to try $lng['serversettings']['system_croncmdline']['title'] = 'Cron execution command (php-binary)'; $lng['serversettings']['system_croncmdline']['description'] = 'Command to execute our cronjobs. Change this only if you know what you are doing (default: "/usr/bin/nice -n 5 /usr/bin/php5 -q")!'; $lng['error']['cannotdeletehostnamephpconfig'] = 'This PHP-configuration is used by the Froxlor-vhost and cannot be deleted.'; +$lng['error']['cannotdeletedefaultphpconfig'] = 'This PHP-configuration is set as default and cannot be deleted.'; diff --git a/lng/german.lng.php b/lng/german.lng.php index dda58e49..69c54eb9 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1540,3 +1540,4 @@ $lng['question']['admin_integritycheck_reallyfix'] = 'Möchten Sie wirklich $lng['serversettings']['system_croncmdline']['title'] = 'Cron Startbefehl (php Programm)'; $lng['serversettings']['system_croncmdline']['description'] = 'Befehl zum Ausführen des Cronjobs. Ändern dieser Einstellung nur wenn nötig (Standard: "/usr/bin/nice -n 5 /usr/bin/php5 -q")!'; $lng['error']['cannotdeletehostnamephpconfig'] = 'Diese PHP-Konfiguration ist dem Froxlor-Vhost zugewiesen und kann daher nicht gelöscht werden.'; +$lng['error']['cannotdeletedefaultphpconfig'] = 'Diese PHP-Konfiguration ist als Standard hinterlegt und kann daher nicht gelöscht werden.';