From 40d68df86b6decdc9d4878ccd1efa84a914919cc Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 22 Jun 2012 09:29:23 +0200 Subject: [PATCH 1/4] Fix jquery-ui.css inclusion in templates/Froxlor/header.tpl --- templates/Froxlor/header.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/Froxlor/header.tpl b/templates/Froxlor/header.tpl index 070d9692..3cffe7aa 100644 --- a/templates/Froxlor/header.tpl +++ b/templates/Froxlor/header.tpl @@ -22,7 +22,7 @@ - + From d89856fac03aef0c59bf3099701dd3eb31fd8867 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Mon, 25 Jun 2012 09:27:39 +0200 Subject: [PATCH 2/4] fix some possible undefined indexes due to the change from yesno-selectbox to a checkbox, refs #645 fixes #1105 --- admin_admins.php | 35 +++++++++++--------- admin_cronjobs.php | 6 ++-- admin_customers.php | 31 +++++++++-------- admin_domains.php | 68 +++++++++++++++++++++----------------- admin_ipsandports.php | 55 ++++++++++++++++++------------ customer_autoresponder.php | 4 +-- customer_domains.php | 14 ++++---- customer_email.php | 2 +- customer_extras.php | 19 +++++++---- customer_ftp.php | 4 +-- customer_mysql.php | 4 +-- 11 files changed, 136 insertions(+), 106 deletions(-) diff --git a/admin_admins.php b/admin_admins.php index 741a323d..ff1a0147 100644 --- a/admin_admins.php +++ b/admin_admins.php @@ -291,7 +291,7 @@ if($page == 'admins' $number_of_aps_packages = - 1; } - $can_manage_aps_packages = intval($_POST['can_manage_aps_packages']); + $can_manage_aps_packages = isset($_POST['can_manage_aps_packages']) ? 1 : 0; } else { @@ -473,11 +473,13 @@ if($page == 'admins' $ftps_ul = makecheckbox('ftps_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); - #$change_serversettings = makeyesno('change_serversettings', '1', '0', '0'); - #$customers_see_all = makeyesno('customers_see_all', '1', '0', '0'); - #$domains_see_all = makeyesno('domains_see_all', '1', '0', '0'); - #$caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', '0'); - #$can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', '0'); + /* + $change_serversettings = makeyesno('change_serversettings', '1', '0', '0'); + $customers_see_all = makeyesno('customers_see_all', '1', '0', '0'); + $domains_see_all = makeyesno('domains_see_all', '1', '0', '0'); + $caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', '0'); + $can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', '0'); + */ $number_of_aps_packages_ul = makecheckbox('number_of_aps_packages_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $admin_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/admin/formfield.admin_add.php'; @@ -532,7 +534,7 @@ if($page == 'admins' { $password = validate($_POST['admin_password'], 'new password'); $def_language = validate($_POST['def_language'], 'default language'); - $deactivated = intval($_POST['deactivated']); + $deactivated = isset($_POST['deactivated']) ? 1 : 0; $customers = intval_ressource($_POST['customers']); if(isset($_POST['customers_ul'])) @@ -638,7 +640,7 @@ if($page == 'admins' $number_of_aps_packages = - 1; } - $can_manage_aps_packages = intval($_POST['can_manage_aps_packages']); + $can_manage_aps_packages = isset($_POST['can_manage_aps_packages']) ? 1 : 0; $customers_see_all = 0; if(isset($_POST['customers_see_all'])) @@ -654,7 +656,7 @@ if($page == 'admins' $change_serversettings = 0; if(isset($_POST['change_serversettings'])) - $change_serversettings = intval($_POST['change_serversettings']); + $change_serversettings = isset($_POST['change_serversettings']) ? 1 : 0; $diskspace = intval($_POST['diskspace']); @@ -862,13 +864,14 @@ if($page == 'admins' } } - #$change_serversettings = makeyesno('change_serversettings', '1', '0', $result['change_serversettings']); - #$customers_see_all = makeyesno('customers_see_all', '1', '0', $result['customers_see_all']); - #$domains_see_all = makeyesno('domains_see_all', '1', '0', $result['domains_see_all']); - #$caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', $result['caneditphpsettings']); - #$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']); - #$can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', $result['can_manage_aps_packages']); - + /* + $change_serversettings = makeyesno('change_serversettings', '1', '0', $result['change_serversettings']); + $customers_see_all = makeyesno('customers_see_all', '1', '0', $result['customers_see_all']); + $domains_see_all = makeyesno('domains_see_all', '1', '0', $result['domains_see_all']); + $caneditphpsettings = makeyesno('caneditphpsettings', '1', '0', $result['caneditphpsettings']); + $deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']); + $can_manage_aps_packages = makeyesno('can_manage_aps_packages', '1', '0', $result['can_manage_aps_packages']); + */ $result = htmlentities_array($result); $admin_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/admin/formfield.admin_edit.php'; diff --git a/admin_cronjobs.php b/admin_cronjobs.php index cb9d4110..4cdc0405 100644 --- a/admin_cronjobs.php +++ b/admin_cronjobs.php @@ -101,7 +101,7 @@ if($page == 'cronjobs' if(isset($_POST['send']) && $_POST['send'] == 'send') { - $isactive = intval($_POST['isactive']); + $isactive = isset($_POST['isactive']) ? 1 : 0; $interval_value = validate($_POST['interval_value'], 'interval_value', '/^([0-9]+)$/Di', 'stringisempty'); $interval_interval = validate($_POST['interval_interval'], 'interval_interval'); @@ -121,7 +121,7 @@ if($page == 'cronjobs' } else { - #$isactive = makeyesno('isactive', '1', '0', $result['isactive']); + //$isactive = makeyesno('isactive', '1', '0', $result['isactive']); // interval $interval_nfo = explode(' ', $result['interval']); $interval_value = $interval_nfo[0]; @@ -159,5 +159,3 @@ if($page == 'cronjobs' */ } } - -?> diff --git a/admin_customers.php b/admin_customers.php index bedbf190..52eb0fc1 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -924,13 +924,16 @@ if($page == 'customers' $tickets_ul = makecheckbox('tickets_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $mysqls_ul = makecheckbox('mysqls_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); $number_of_aps_packages_ul = makecheckbox('number_of_aps_packages_ul', $lng['customer']['unlimited'], '-1', false, '0', true, true); - #$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', '1'); - #$email_imap = makeyesno('email_imap', '1', '0', '1'); - #$email_pop3 = makeyesno('email_pop3', '1', '0', '1'); - #$sendpassword = makeyesno('sendpassword', '1', '0', '1'); - #$phpenabled = makeyesno('phpenabled', '1', '0', '1'); - #$perlenabled = makeyesno('perlenabled', '1', '0', '0'); - #$store_defaultindex = makeyesno('store_defaultindex', '1', '0', '1'); + /* + $createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', '1'); + $email_imap = makeyesno('email_imap', '1', '0', '1'); + $email_pop3 = makeyesno('email_pop3', '1', '0', '1'); + $sendpassword = makeyesno('sendpassword', '1', '0', '1'); + $phpenabled = makeyesno('phpenabled', '1', '0', '1'); + $perlenabled = makeyesno('perlenabled', '1', '0', '0'); + $store_defaultindex = makeyesno('store_defaultindex', '1', '0', '1'); + */ + // why still makeyesno for this one? $backup_allowed = makeyesno('backup_allowed', '1', '0', '0'); $gender_options = makeoption($lng['gender']['undef'], 0, true, true, true); @@ -1588,12 +1591,14 @@ if($page == 'customers' $result['aps_packages'] = ''; } - #$createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0')); - #$phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']); - #$perlenabled = makeyesno('perlenabled', '1', '0', $result['perlenabled']); - #$deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']); - #$email_imap = makeyesno('email_imap', '1', '0', $result['imap']); - #$email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']); + /* + $createstdsubdomain = makeyesno('createstdsubdomain', '1', '0', (($result['standardsubdomain'] != '0') ? '1' : '0')); + $phpenabled = makeyesno('phpenabled', '1', '0', $result['phpenabled']); + $perlenabled = makeyesno('perlenabled', '1', '0', $result['perlenabled']); + $deactivated = makeyesno('deactivated', '1', '0', $result['deactivated']); + $email_imap = makeyesno('email_imap', '1', '0', $result['imap']); + $email_pop3 = makeyesno('email_pop3', '1', '0', $result['pop3']); + */ $backup_allowed = makeyesno('backup_allowed', '1', '0', $result['backup_allowed']); $result = htmlentities_array($result); diff --git a/admin_domains.php b/admin_domains.php index b9e309f6..b6a81e39 100644 --- a/admin_domains.php +++ b/admin_domains.php @@ -284,7 +284,7 @@ if($page == 'domains' if($userinfo['change_serversettings'] == '1') { $isbinddomain = intval($_POST['isbinddomain']); - $caneditdomain = intval($_POST['caneditdomain']); + $caneditdomain = isset($_POST['caneditdomain']) ? 1 : 0; $zonefile = validate($_POST['zonefile'], 'zonefile'); if(isset($_POST['dkim'])) @@ -325,8 +325,8 @@ if($page == 'domains' if($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1') { - $openbasedir = intval($_POST['openbasedir']); - $safemode = intval($_POST['safemode']); + $openbasedir = isset($_POST['openbasedir']) ? 1 : 0; + $safemode = isset($_POST['safemode']) ? 1 : 0; if((int)$settings['system']['mod_fcgid'] == 1) { @@ -385,7 +385,7 @@ if($page == 'domains' && isset($_POST['ssl_ipandport']) && $_POST['ssl'] != '0') { - $ssl = (int)$_POST['ssl']; + $ssl = 1; // if ssl is set and != 0 it can only be 1 $ssl_redirect = 0; if (isset($_POST['ssl_redirect'])) { $ssl_redirect = (int)$_POST['ssl_redirect']; @@ -683,18 +683,20 @@ if($page == 'domains' $phpconfigs.= makeoption($row['description'], $row['id'], $settings['system']['mod_fcgid_defaultini'], true, true); } - #$isbinddomain = makeyesno('isbinddomain', '1', '0', '1'); - #$isemaildomain = makeyesno('isemaildomain', '1', '0', '1'); - #$email_only = makeyesno('email_only', '1', '0', '0'); + /* + $isbinddomain = makeyesno('isbinddomain', '1', '0', '1'); + $isemaildomain = makeyesno('isemaildomain', '1', '0', '1'); + $email_only = makeyesno('email_only', '1', '0', '0'); + $dkim = makeyesno('dkim', '1', '0', '1'); + $wwwserveralias = makeyesno('wwwserveralias', '1', '0', '1'); + $caneditdomain = makeyesno('caneditdomain', '1', '0', '1'); + $openbasedir = makeyesno('openbasedir', '1', '0', '1'); + $safemode = makeyesno('safemode', '1', '0', '1'); + $speciallogfile = makeyesno('speciallogfile', '1', '0', '0'); + $ssl = makeyesno('ssl', '1', '0', '0'); + $ssl_redirect = makeyesno('ssl_redirect', '1', '0', '0'); + */ $subcanemaildomain = makeoption($lng['admin']['subcanemaildomain']['never'], '0', '0', true, true) . makeoption($lng['admin']['subcanemaildomain']['choosableno'], '1', '0', true, true) . makeoption($lng['admin']['subcanemaildomain']['choosableyes'], '2', '0', true, true) . makeoption($lng['admin']['subcanemaildomain']['always'], '3', '0', true, true); - #$dkim = makeyesno('dkim', '1', '0', '1'); - #$wwwserveralias = makeyesno('wwwserveralias', '1', '0', '1'); - #$caneditdomain = makeyesno('caneditdomain', '1', '0', '1'); - #$openbasedir = makeyesno('openbasedir', '1', '0', '1'); - #$safemode = makeyesno('safemode', '1', '0', '1'); - #$speciallogfile = makeyesno('speciallogfile', '1', '0', '0'); - #$ssl = makeyesno('ssl', '1', '0', '0'); - #$ssl_redirect = makeyesno('ssl_redirect', '1', '0', '0'); $add_date = date('Y-m-d'); $domain_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/domains/formfield.domains_add.php'; @@ -793,7 +795,7 @@ if($page == 'domains' $aliasdomain = intval($_POST['alias']); $issubof = intval($_POST['issubof']); $subcanemaildomain = intval($_POST['subcanemaildomain']); - $caneditdomain = intval($_POST['caneditdomain']); + $caneditdomain = isset($_POST['caneditdomain']) ? 1 : 0; $registration_date = trim($_POST['registration_date']); $registration_date = validate($registration_date, 'registration_date', '/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/', '', array('0000-00-00', '0', '')); @@ -821,7 +823,7 @@ if($page == 'domains' if($settings['dkim']['use_dkim'] == '1') { - $dkim = intval($_POST['dkim']); + $dkim = isset($_POST['dkim']) ? 1 : 0; } else { @@ -854,8 +856,8 @@ if($page == 'domains' if($userinfo['caneditphpsettings'] == '1' || $userinfo['change_serversettings'] == '1') { - $openbasedir = intval($_POST['openbasedir']); - $safemode = intval($_POST['safemode']); + $openbasedir = isset($_POST['openbasedir']) ? 1 : 0; + $safemode = isset($_POST['safemode']) ? 1 : 0; if((int)$settings['system']['mod_fcgid'] == 1) { @@ -914,7 +916,7 @@ if($page == 'domains' && isset($_POST['ssl_ipandport']) && $_POST['ssl'] != '0') { - $ssl = (int)$_POST['ssl']; + $ssl = 1; // if ssl is set and != 0, it can only be 1 $ssl_redirect = 0; if (isset($_POST['ssl_redirect'])) { $ssl_redirect = (int)$_POST['ssl_redirect']; @@ -1237,20 +1239,22 @@ if($page == 'domains' } $result['specialsettings'] = $result['specialsettings']; - #$isbinddomain = makeyesno('isbinddomain', '1', '0', $result['isbinddomain']); - #$wwwserveralias = makeyesno('wwwserveralias', '1', '0', $result['wwwserveralias']); - #$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']); - #$email_only = makeyesno('email_only', '1', '0', $result['email_only']); - #$ssl = makeyesno('ssl', '1', '0', $result['ssl']); - #$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); + /* + $isbinddomain = makeyesno('isbinddomain', '1', '0', $result['isbinddomain']); + $wwwserveralias = makeyesno('wwwserveralias', '1', '0', $result['wwwserveralias']); + $isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']); + $email_only = makeyesno('email_only', '1', '0', $result['email_only']); + $ssl = makeyesno('ssl', '1', '0', $result['ssl']); + $ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); + $dkim = makeyesno('dkim', '1', '0', $result['dkim']); + $caneditdomain = makeyesno('caneditdomain', '1', '0', $result['caneditdomain']); + $openbasedir = makeyesno('openbasedir', '1', '0', $result['openbasedir']); + $safemode = makeyesno('safemode', '1', '0', $result['safemode']); + */ $subcanemaildomain = makeoption($lng['admin']['subcanemaildomain']['never'], '0', $result['subcanemaildomain'], true, true); $subcanemaildomain.= makeoption($lng['admin']['subcanemaildomain']['choosableno'], '1', $result['subcanemaildomain'], true, true); $subcanemaildomain.= makeoption($lng['admin']['subcanemaildomain']['choosableyes'], '2', $result['subcanemaildomain'], true, true); $subcanemaildomain.= makeoption($lng['admin']['subcanemaildomain']['always'], '3', $result['subcanemaildomain'], true, true); - #$dkim = makeyesno('dkim', '1', '0', $result['dkim']); - #$caneditdomain = makeyesno('caneditdomain', '1', '0', $result['caneditdomain']); - #$openbasedir = makeyesno('openbasedir', '1', '0', $result['openbasedir']); - #$safemode = makeyesno('safemode', '1', '0', $result['safemode']); $speciallogfile = ($result['speciallogfile'] == 1 ? $lng['panel']['yes'] : $lng['panel']['no']); $result['add_date'] = date('Y-m-d', $result['add_date']); @@ -1262,7 +1266,9 @@ if($page == 'domains' $phpconfigs.= makeoption($phpconfigs_row['description'], $phpconfigs_row['id'], $result['phpsettingid'], true, true); } - #$specialsettingsforsubdomains = makeyesno('specialsettingsforsubdomains', '1', '0', '1'); + /* + $specialsettingsforsubdomains = makeyesno('specialsettingsforsubdomains', '1', '0', '1'); + */ $result = htmlentities_array($result); diff --git a/admin_ipsandports.php b/admin_ipsandports.php index be6a3145..9dab8cfb 100644 --- a/admin_ipsandports.php +++ b/admin_ipsandports.php @@ -141,11 +141,11 @@ if($page == 'ipsandports' { $ip = validate_ip($_POST['ip']); $port = validate($_POST['port'], 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array('stringisempty', 'myport')); - $listen_statement = intval($_POST['listen_statement']); - $namevirtualhost_statement = intval($_POST['namevirtualhost_statement']); - $vhostcontainer = intval($_POST['vhostcontainer']); + $listen_statement = isset($_POST['listen_statement']) ? 1 : 0; + $namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0; + $vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0; $specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/'); - $vhostcontainer_servername_statement = intval($_POST['vhostcontainer_servername_statement']); + $vhostcontainer_servername_statement = isset($_POST['vhostcontainer_servername_statement']) ? 1 : 0; $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) @@ -261,11 +261,13 @@ if($page == 'ipsandports' } else { - #$enable_ssl = makeyesno('ssl', '1', '0', '0'); - #$listen_statement = makeyesno('listen_statement', '1', '0', '1'); - #$namevirtualhost_statement = makeyesno('namevirtualhost_statement', '1', '0', '1'); - #$vhostcontainer = makeyesno('vhostcontainer', '1', '0', '1'); - #$vhostcontainer_servername_statement = makeyesno('vhostcontainer_servername_statement', '1', '0', '1'); + /* + $enable_ssl = makeyesno('ssl', '1', '0', '0'); + $listen_statement = makeyesno('listen_statement', '1', '0', '1'); + $namevirtualhost_statement = makeyesno('namevirtualhost_statement', '1', '0', '1'); + $vhostcontainer = makeyesno('vhostcontainer', '1', '0', '1'); + $vhostcontainer_servername_statement = makeyesno('vhostcontainer_servername_statement', '1', '0', '1'); + */ $ipsandports_add_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_add.php'; $ipsandports_add_form = htmlform::genHTMLForm($ipsandports_add_data); @@ -290,16 +292,23 @@ if($page == 'ipsandports' $port = validate($_POST['port'], 'port', '/^(([1-9])|([1-9][0-9])|([1-9][0-9][0-9])|([1-9][0-9][0-9][0-9])|([1-5][0-9][0-9][0-9][0-9])|(6[0-4][0-9][0-9][0-9])|(65[0-4][0-9][0-9])|(655[0-2][0-9])|(6553[0-5]))$/Di', array('stringisempty', 'myport')); $result_checkfordouble = $db->query_first("SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ip`='" . $db->escape($ip) . "' AND `port`='" . (int)$port . "'"); $result_sameipotherport = $db->query_first("SELECT `id` FROM `" . TABLE_PANEL_IPSANDPORTS . "` WHERE `ip`='" . $db->escape($result['ip']) . "' AND `id`!='" . (int)$id . "'"); - $listen_statement = intval($_POST['listen_statement']); - $namevirtualhost_statement = intval($_POST['namevirtualhost_statement']); - $vhostcontainer = intval($_POST['vhostcontainer']); + $listen_statement = isset($_POST['listen_statement']) ? 1 : 0; + $namevirtualhost_statement = isset($_POST['namevirtualhost_statement']) ? 1 : 0; + $vhostcontainer = isset($_POST['vhostcontainer']) ? 1 : 0; $specialsettings = validate(str_replace("\r\n", "\n", $_POST['specialsettings']), 'specialsettings', '/^[^\0]*$/'); - $vhostcontainer_servername_statement = intval($_POST['vhostcontainer_servername_statement']); + $vhostcontainer_servername_statement = isset($_POST['vhostcontainer_servername_statement']) ? 1 : 0; $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']); + + if((int)$settings['system']['use_ssl'] == 1 + /* + * check here if ssl is even checked, cause if not, we don't need + * to validate and set all the $ssl_*_file vars + */ + && isset($_POST['ssl']) + && $_POST['ssl'] != 0 + ) { + $ssl = 1; $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'); @@ -402,7 +411,7 @@ if($page == 'ipsandports' $log->logAction(ADM_ACTION, LOG_WARNING, "changed IP/port from '" . $result['ip'] . ":" . $result['port'] . "' to '" . $ip . ":" . $port . "'"); inserttask('1'); - # Using nameserver, insert a task which rebuilds the server config + // Using nameserver, insert a task which rebuilds the server config if ($settings['system']['bind_enable']) { inserttask('4'); @@ -412,12 +421,14 @@ if($page == 'ipsandports' } else { - #$enable_ssl = makeyesno('ssl', '1', '0', $result['ssl']); $result = htmlentities_array($result); - #$listen_statement = makeyesno('listen_statement', '1', '0', $result['listen_statement']); - #$namevirtualhost_statement = makeyesno('namevirtualhost_statement', '1', '0', $result['namevirtualhost_statement']); - #$vhostcontainer = makeyesno('vhostcontainer', '1', '0', $result['vhostcontainer']); - #$vhostcontainer_servername_statement = makeyesno('vhostcontainer_servername_statement', '1', '0', $result['vhostcontainer_servername_statement']); + /* + $enable_ssl = makeyesno('ssl', '1', '0', $result['ssl']); + $listen_statement = makeyesno('listen_statement', '1', '0', $result['listen_statement']); + $namevirtualhost_statement = makeyesno('namevirtualhost_statement', '1', '0', $result['namevirtualhost_statement']); + $vhostcontainer = makeyesno('vhostcontainer', '1', '0', $result['vhostcontainer']); + $vhostcontainer_servername_statement = makeyesno('vhostcontainer_servername_statement', '1', '0', $result['vhostcontainer_servername_statement']); + */ $ipsandports_edit_data = include_once dirname(__FILE__).'/lib/formfields/admin/ipsandports/formfield.ipsandports_edit.php'; $ipsandports_edit_form = htmlform::genHTMLForm($ipsandports_edit_data); diff --git a/customer_autoresponder.php b/customer_autoresponder.php index b3c1b407..d98bbabc 100644 --- a/customer_autoresponder.php +++ b/customer_autoresponder.php @@ -110,7 +110,7 @@ if($action == "add") $date_from_off = makecheckbox('date_from_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true); $date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, '-1', true, true); - #$isactive = makeyesno('active', '1', '0', '1'); + //$isactive = makeyesno('active', '1', '0', '1'); $autoresponder_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/autoresponder/formfield.autoresponder_add.php'; $autoresponder_add_form = htmlform::genHTMLForm($autoresponder_add_data); @@ -241,7 +241,7 @@ if($action == "edit") } $date_until_off = makecheckbox('date_until_off', $lng['panel']['not_activated'], '-1', false, $deactivated, true, true); - #$isactive = makeyesno('active', '1', '0', $row['enabled']); + //$isactive = makeyesno('active', '1', '0', $row['enabled']); $autoresponder_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/autoresponder/formfield.autoresponder_edit.php'; $autoresponder_edit_form = htmlform::genHTMLForm($autoresponder_edit_data); diff --git a/customer_domains.php b/customer_domains.php index 5724547a..c25bdda7 100644 --- a/customer_domains.php +++ b/customer_domains.php @@ -352,7 +352,7 @@ elseif($page == 'domains') $log->logAction(USR_ACTION, LOG_INFO, "added subdomain '" . $completedomain . "'"); inserttask('1'); - # Using nameserver, insert a task which rebuilds the server config + // Using nameserver, insert a task which rebuilds the server config if ($settings['system']['bind_enable']) { inserttask('4'); @@ -388,7 +388,7 @@ elseif($page == 'domains') } } - #$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); + //$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); $openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true); $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); @@ -532,7 +532,7 @@ elseif($page == 'domains') $result = $db->query("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET `documentroot`='" . $db->escape($path) . "', `isemaildomain`='" . (int)$isemaildomain . "', `iswildcarddomain`='" . (int)$iswildcarddomain . "', `aliasdomain`=" . (($aliasdomain != 0 && $alias_check == 0) ? '\'' . $db->escape($aliasdomain) . '\'' : 'NULL') . ",`openbasedir_path`='" . $db->escape($openbasedir_path) . "', `ssl_redirect`='" . $ssl_redirect . "' WHERE `customerid`='" . (int)$userinfo['customerid'] . "' AND `id`='" . (int)$id . "'"); inserttask('1'); - # Using nameserver, insert a task which rebuilds the server config + // Using nameserver, insert a task which rebuilds the server config if ($settings['system']['bind_enable']) { inserttask('4'); @@ -585,9 +585,11 @@ elseif($page == 'domains') } } - #$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); - #$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']); - #$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']); + /* + $ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']); + $iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']); + $isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']); + */ $openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true); $result_ipandport = $db->query_first("SELECT `ip` FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id`='".(int)$result['ipandport']."'"); diff --git a/customer_email.php b/customer_email.php index b6cebb24..b4736c44 100644 --- a/customer_email.php +++ b/customer_email.php @@ -281,7 +281,7 @@ elseif($page == 'emails') $domains.= makeoption($idna_convert->decode($row['domain']), $row['domain']); } - #$iscatchall = makeyesno('iscatchall', '1', '0', '0'); + //$iscatchall = makeyesno('iscatchall', '1', '0', '0'); $email_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/email/formfield.emails_add.php'; $email_add_form = htmlform::genHTMLForm($email_add_data); diff --git a/customer_extras.php b/customer_extras.php index 6b64d55f..4cdb9ae8 100644 --- a/customer_extras.php +++ b/customer_extras.php @@ -353,9 +353,10 @@ elseif($page == 'htaccess') standard_error('invalidpath'); } - if(isset($_POST['options_cgi'])) - { - $options_cgi = intval($_POST['options_cgi']); + if(isset($_POST['options_cgi']) + && (int)$_POST['options_cgi'] != 0 + ) { + $options_cgi = '1'; } else { @@ -393,9 +394,11 @@ elseif($page == 'htaccess') else { $pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']); - #$options_indexes = makeyesno('options_indexes', '1', '0', '0'); $cperlenabled = customerHasPerlEnabled($userinfo['customerid']); - #$options_cgi = makeyesno('options_cgi', '1', '0', '0'); + /* + $options_indexes = makeyesno('options_indexes', '1', '0', '0'); + $options_cgi = makeyesno('options_cgi', '1', '0', '0'); + */ $htaccess_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htaccess_add.php'; $htaccess_add_form = htmlform::genHTMLForm($htaccess_add_data); @@ -460,9 +463,11 @@ elseif($page == 'htaccess') $result['error404path'] = $result['error404path']; $result['error403path'] = $result['error403path']; $result['error500path'] = $result['error500path']; - #$options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']); $cperlenabled = customerHasPerlEnabled($userinfo['customerid']); - #$options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']); + /* + $options_indexes = makeyesno('options_indexes', '1', '0', $result['options_indexes']); + $options_cgi = makeyesno('options_cgi', '1', '0', $result['options_cgi']); + */ $result = htmlentities_array($result); $htaccess_edit_data = include_once dirname(__FILE__).'/lib/formfields/customer/extras/formfield.htaccess_edit.php'; diff --git a/customer_ftp.php b/customer_ftp.php index ffcb408d..821c5b6c 100644 --- a/customer_ftp.php +++ b/customer_ftp.php @@ -144,7 +144,7 @@ elseif($page == 'accounts') $password = validate($_POST['ftp_password'], 'password'); $password = validatePassword($password); - $sendinfomail = intval($_POST['sendinfomail']); + $sendinfomail = isset($_POST['sendinfomail']) ? 1 : 0; if($sendinfomail != 1) { $sendinfomail = 0; @@ -268,7 +268,7 @@ elseif($page == 'accounts') } } - #$sendinfomail = makeyesno('sendinfomail', '1', '0', '0'); + //$sendinfomail = makeyesno('sendinfomail', '1', '0', '0'); $ftp_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/ftp/formfield.ftp_add.php'; $ftp_add_form = htmlform::genHTMLForm($ftp_add_data); diff --git a/customer_mysql.php b/customer_mysql.php index 5897a152..a7eb13fc 100644 --- a/customer_mysql.php +++ b/customer_mysql.php @@ -150,7 +150,7 @@ elseif($page == 'mysqls') $password = validate($_POST['mysql_password'], 'password'); $password = validatePassword($password); - $sendinfomail = intval($_POST['sendinfomail']); + $sendinfomail = isset($_POST['sendinfomail']) ? 1 : 0; if($sendinfomail != 1) { $sendinfomail = 0; @@ -258,7 +258,7 @@ elseif($page == 'mysqls') $mysql_servers .= makeoption($mysql_server_details['caption'], $mysql_server); } - #$sendinfomail = makeyesno('sendinfomail', '1', '0', '0'); + //$sendinfomail = makeyesno('sendinfomail', '1', '0', '0'); $mysql_add_data = include_once dirname(__FILE__).'/lib/formfields/customer/mysql/formfield.mysql_add.php'; $mysql_add_form = htmlform::genHTMLForm($mysql_add_data); From f5bc81faca86ca7eeb81ed2de2b08a492079321b Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 28 Jun 2012 08:53:23 +0200 Subject: [PATCH 3/4] check if path could be opened before iterating through it, fixes #1104 --- .../jobs/cron_tasks.inc.http.10.apache.php | 30 +++++++++++-------- .../jobs/cron_tasks.inc.http.20.lighttpd.php | 27 ++++++++++------- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 25 +++++++++++----- 3 files changed, 51 insertions(+), 31 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 63ca8091..9236c21e 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -1368,22 +1368,26 @@ class apache $configdir = $this->settings['phpfpm']['configdir']; $phpfpm_file_dirhandle = opendir($this->settings['phpfpm']['configdir']); - while(false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) - { - if(is_array($known_phpfpm_files) - && $phpfpm_filename != '.' - && $phpfpm_filename != '..' - && !in_array($phpfpm_filename, $known_phpfpm_files) - && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename))) - { - fwrite($this->debugHandler, ' apache::wipeOutOldVhostConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); - $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); - unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); + if ($phpfpm_file_dirhandle !== false) { + + while (false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) { + + if (is_array($known_phpfpm_files) + && $phpfpm_filename != '.' + && $phpfpm_filename != '..' + && !in_array($phpfpm_filename, $known_phpfpm_files) + && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)) + ) { + fwrite($this->debugHandler, ' apache::wipeOutOldVhostConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); + $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); + unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); } - if(!is_array($known_phpfpm_files)) - { + if (!is_array($known_phpfpm_files)) { $this->logger->logAction(CRON_ACTION, LOG_WARNING, "WARNING!! PHP-FPM Configs Not written!!"); } + } + } else { + $this->logger->logAction(CRON_ACTION, LOG_WARNING, "WARNING!! PHP-FPM configuration path could not be read (".$this->settings['phpfpm']['configdir'].")"); } } } diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index 18a3506b..80fb0b9f 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -1038,21 +1038,28 @@ class lighttpd $configdir = $this->settings['phpfpm']['configdir']; $phpfpm_file_dirhandle = opendir($this->settings['phpfpm']['configdir']); - - while(false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) - { - if($phpfpm_filename != '.' - && $phpfpm_filename != '..' - && !in_array($phpfpm_filename, $known_phpfpm_files) - && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename))) - { + + if ($phpfpm_file_dirhandle !== false) { + + while (false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) { + + if (is_array($known_phpfpm_files) + && $phpfpm_filename != '.' + && $phpfpm_filename != '..' + && !in_array($phpfpm_filename, $known_phpfpm_files) + && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)) + ) { fwrite($this->debugHandler, ' lighttpd::wipeOutOldConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); } + if (!is_array($known_phpfpm_files)) { + $this->logger->logAction(CRON_ACTION, LOG_WARNING, "WARNING!! PHP-FPM Configs Not written!!"); + } + } + } else { + $this->logger->logAction(CRON_ACTION, LOG_WARNING, "WARNING!! PHP-FPM configuration path could not be read (".$this->settings['phpfpm']['configdir'].")"); } } } } - -?> diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 596a304e..2a218d84 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -1046,18 +1046,27 @@ class nginx $configdir = $this->settings['phpfpm']['configdir']; $phpfpm_file_dirhandle = opendir($this->settings['phpfpm']['configdir']); - - while(false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) - { - if($phpfpm_filename != '.' - && $phpfpm_filename != '..' - && !in_array($phpfpm_filename, $known_phpfpm_files) - && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename))) - { + + if ($phpfpm_file_dirhandle !== false) { + + while (false !== ($phpfpm_filename = readdir($phpfpm_file_dirhandle))) { + + if (is_array($known_phpfpm_files) + && $phpfpm_filename != '.' + && $phpfpm_filename != '..' + && !in_array($phpfpm_filename, $known_phpfpm_files) + && file_exists(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)) + ) { fwrite($this->debugHandler, ' nginx::wipeOutOldVhostConfigs: unlinking PHP5-FPM ' . $phpfpm_filename . "\n"); $this->logger->logAction(CRON_ACTION, LOG_NOTICE, 'unlinking ' . $phpfpm_filename); unlink(makeCorrectFile($this->settings['phpfpm']['configdir'] . '/' . $phpfpm_filename)); } + if (!is_array($known_phpfpm_files)) { + $this->logger->logAction(CRON_ACTION, LOG_WARNING, "WARNING!! PHP-FPM Configs Not written!!"); + } + } + } else { + $this->logger->logAction(CRON_ACTION, LOG_WARNING, "WARNING!! PHP-FPM configuration path could not be read (".$this->settings['phpfpm']['configdir'].")"); } } } From 938b6ebf526ba7559b6bcf448139a85160a2001f Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Sat, 30 Jun 2012 13:58:20 +0200 Subject: [PATCH 4/4] correct std-customer index-file so the broder-radius works in all browser supporting it --- templates/misc/standardcustomer/index.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/templates/misc/standardcustomer/index.html b/templates/misc/standardcustomer/index.html index 7f07264e..cd3b909f 100644 --- a/templates/misc/standardcustomer/index.html +++ b/templates/misc/standardcustomer/index.html @@ -23,10 +23,9 @@ margin: -100px 0 0 -258px; background-color: #2d6b85; border: 1px solid #254f76; - -moz-border-radius-bottomleft:20px; - -moz-border-radius-bottomright:20px; - -moz-border-radius-topleft:20px; - -moz-border-radius-topright:20px; + -moz-border-radius:20px; + -webkit-border-radius:20px; + border-radius:20px; } footer { width: 500px;