From 3d187fd0a06261a6c0ed4c4dcf7bcbc9aa15994b Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 28 Oct 2010 06:33:58 +0000 Subject: [PATCH] - fix undefined indexes in ips and ports if ssl is not enabled - fix getSwap() and getMemory() in FroxlorHostInfo-class --- admin_ipsandports.php | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/admin_ipsandports.php b/admin_ipsandports.php index d6e6f2a3..9260889f 100644 --- a/admin_ipsandports.php +++ b/admin_ipsandports.php @@ -141,13 +141,22 @@ if($page == 'ipsandports' $vhostcontainer = intval($_POST['vhostcontainer']); $specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/'); $vhostcontainer_servername_statement = intval($_POST['vhostcontainer_servername_statement']); - $ssl = intval($_POST['ssl']); - $ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file'); - $ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file'); - $ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file'); - $ssl_cert_chainfile = validate($_POST['ssl_cert_chainfile'], 'ssl_cert_chainfile'); $default_vhostconf_domain = validate(str_replace("\r\n", "\n", $_POST['default_vhostconf_domain']), 'default_vhostconf_domain', '/^[^\0]*$/'); $docroot = validate($_POST['docroot'], 'docroot'); + if((int)$settings['system']['use_ssl'] == 1) + { + $ssl = intval($_POST['ssl']); + $ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file'); + $ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file'); + $ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file'); + $ssl_cert_chainfile = validate($_POST['ssl_cert_chainfile'], 'ssl_cert_chainfile'); + } else { + $ssl = 0; + $ssl_cert_file = ''; + $ssl_key_file = ''; + $ssl_ca_file = ''; + $ssl_cert_chainfile = ''; + } if($listen_statement != '1') { @@ -269,13 +278,22 @@ if($page == 'ipsandports' $vhostcontainer = intval($_POST['vhostcontainer']); $specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/'); $vhostcontainer_servername_statement = intval($_POST['vhostcontainer_servername_statement']); - $ssl = intval($_POST['ssl']); - $ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file'); - $ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file'); - $ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file'); - $ssl_cert_chainfile = validate($_POST['ssl_cert_chainfile'], 'ssl_cert_chainfile'); $default_vhostconf_domain = validate(str_replace("\r\n", "\n", $_POST['default_vhostconf_domain']), 'default_vhostconf_domain', '/^[^\0]*$/'); $docroot = validate($_POST['docroot'], 'docroot'); + if((int)$settings['system']['use_ssl'] == 1) + { + $ssl = intval($_POST['ssl']); + $ssl_cert_file = validate($_POST['ssl_cert_file'], 'ssl_cert_file'); + $ssl_key_file = validate($_POST['ssl_key_file'], 'ssl_key_file'); + $ssl_ca_file = validate($_POST['ssl_ca_file'], 'ssl_ca_file'); + $ssl_cert_chainfile = validate($_POST['ssl_cert_chainfile'], 'ssl_cert_chainfile'); + } else { + $ssl = 0; + $ssl_cert_file = ''; + $ssl_key_file = ''; + $ssl_ca_file = ''; + $ssl_cert_chainfile = ''; + } if($listen_statement != '1') {