From 8ff2c930ee79b582ce1bde897f900b0a6fb0266e Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Tue, 18 Feb 2014 17:01:02 +0100 Subject: [PATCH] show and check whether a php-config is used by the system-hostname Signed-off-by: Michael Kaufmann (d00p) --- admin_phpsettings.php | 20 ++++++++++++++++++-- lng/english.lng.php | 5 ++++- lng/german.lng.php | 3 +++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/admin_phpsettings.php b/admin_phpsettings.php index c741ce54..19967afc 100644 --- a/admin_phpsettings.php +++ b/admin_phpsettings.php @@ -70,7 +70,15 @@ if ($page == 'overview') { while ($row2 = $domainresult_stmt->fetch(PDO::FETCH_ASSOC)) { $domains.= $row2['domain'] . '
'; } - } else { + } + + if (Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $row['id'] + || Settings::Get('phpfpm.vhost_defaultini') == $row['id'] + ) { + $domains .= Settings::Get('system.hostname'); + } + + if ($domains == '') { $domains = $lng['admin']['phpsettings']['notused']; } $count ++; @@ -173,6 +181,14 @@ if ($page == 'overview') { ); $result = Database::pexecute_first($result_stmt, array('id' => $id)); + if ((Settings::Get('system.mod_fcgid') == '1' + && Settings::Get('system.mod_fcgid_defaultini_ownvhost') == $id) + || (Settings::Get('phpfpm.enabled') == '1' + && Settings::Get('phpfpm.vhost_defaultini') == $id) + ) { + standard_error('cannotdeletehostnamephpconfig'); + } + if ($result['id'] != 0 && $result['id'] == $id && (int)$userinfo['change_serversettings'] == 1 @@ -186,7 +202,7 @@ if ($page == 'overview') { // config that is to be deleted $upd_stmt = Database::prepare(" UPDATE `" . TABLE_PANEL_DOMAINS . "` SET - `phpsettingid` = 1 WHERE `phpsettingid` = :id" + `phpsettingid` = '1' WHERE `phpsettingid` = :id" ); Database::pexecute($upd_stmt, array('id' => $id)); diff --git a/lng/english.lng.php b/lng/english.lng.php index 2c8050e4..1f7fd5a6 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1810,4 +1810,7 @@ $lng['admin']['integrityid'] = '#'; $lng['admin']['integrityname'] = 'Name'; $lng['admin']['integrityresult'] = 'Result'; $lng['admin']['integrityfix'] = 'Fix problems automatically'; -$lng['question']['admin_integritycheck_reallyfix'] = 'Do you really want to try fixing all database integrity problems automatically?'; \ No newline at end of file +$lng['question']['admin_integritycheck_reallyfix'] = 'Do you really want to try fixing all database integrity problems automatically?'; +$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.'; diff --git a/lng/german.lng.php b/lng/german.lng.php index dee643a2..dda58e49 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1537,3 +1537,6 @@ $lng['admin']['integrityname'] = 'Name'; $lng['admin']['integrityresult'] = 'Ergebnis'; $lng['admin']['integrityfix'] = 'Probleme automatisch beheben'; $lng['question']['admin_integritycheck_reallyfix'] = 'Möchten Sie wirklich versuchen sätliche Datenbank - Integritätsprobleme automatisch zu beheben?'; +$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.';