From 0fea430100e63268f0dc313061a713fe114c7c59 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 10 Apr 2014 16:31:57 -0400 Subject: Fix a whole bunch of invalid version tests. --- config/apache_mod_security-dev/apache_mod_security_view_logs.php | 4 ++-- config/apache_mod_security-dev/apache_view_logs.php | 4 ++-- config/apache_mod_security/apache_mod_security_view_logs.php | 4 ++-- config/apcupsd/apcupsd_status.php | 5 ++--- config/bacula-client/bacula-client_view_config.php | 5 ++--- config/dansguardian/dansguardian_about.php | 4 ++-- config/freeradius2/freeradius_view_config.php | 4 ++-- config/haproxy-devel/haproxy_global.php | 4 ++-- config/haproxy-devel/haproxy_listeners.php | 4 ++-- config/haproxy-devel/haproxy_listeners_edit.php | 4 ++-- config/haproxy-devel/haproxy_pool_edit.php | 4 ++-- config/haproxy-devel/haproxy_pools.php | 4 ++-- config/haproxy-devel/haproxy_stats.php | 4 ++-- config/haproxy-legacy/haproxy_frontends.php | 4 ++-- config/haproxy-legacy/haproxy_frontends_edit.php | 4 ++-- config/haproxy-legacy/haproxy_global.php | 4 ++-- config/haproxy-legacy/haproxy_servers.php | 4 ++-- config/haproxy-legacy/haproxy_servers_edit.php | 4 ++-- config/haproxy-stable/haproxy_global.php | 4 ++-- config/haproxy-stable/haproxy_listeners.php | 4 ++-- config/haproxy-stable/haproxy_listeners_edit.php | 4 ++-- config/haproxy-stable/haproxy_pool_edit.php | 4 ++-- config/haproxy-stable/haproxy_pools.php | 4 ++-- config/haproxy/haproxy_global.php | 4 ++-- config/haproxy/haproxy_listeners.php | 4 ++-- config/haproxy/haproxy_listeners_edit.php | 4 ++-- config/haproxy/haproxy_pool_edit.php | 4 ++-- config/haproxy/haproxy_pools.php | 4 ++-- config/mailscanner/mailscanner_about.php | 4 ++-- config/openospfd/status_ospfd.php | 4 ++-- config/postfix/postfix_about.php | 4 ++-- config/postfix/postfix_queue.php | 4 ++-- config/postfix/postfix_search.php | 4 ++-- config/postfix/postfix_view_config.php | 2 +- config/sarg/sarg_about.php | 4 ++-- config/sarg/sarg_realtime.php | 4 ++-- config/sarg/sarg_reports.php | 4 ++-- config/tinydns/tinydns_dhcp_filter.php | 4 ++-- config/tinydns/tinydns_status.php | 4 ++-- config/tinydns/tinydns_view_logs.php | 4 ++-- config/varnish3/varnish_view_config.php | 4 ++-- config/varnish3/varnishstat.php | 4 ++-- config/varnish64/varnish_view_config.php | 4 ++-- config/varnish64/varnishstat.php | 4 ++-- config/vnstat2/www/diag_vnstat.php | 4 ++-- config/vnstat2/www/diag_vnstat2.php | 4 ++-- config/zebedee/zebedee_del_key.php | 4 ++-- config/zebedee/zebedee_keys.php | 4 ++-- config/zebedee/zebedee_log.php | 4 ++-- config/zebedee/zebedee_view_config.php | 4 ++-- 50 files changed, 99 insertions(+), 101 deletions(-) diff --git a/config/apache_mod_security-dev/apache_mod_security_view_logs.php b/config/apache_mod_security-dev/apache_mod_security_view_logs.php index 669c71f4..68d41f59 100755 --- a/config/apache_mod_security-dev/apache_mod_security_view_logs.php +++ b/config/apache_mod_security-dev/apache_mod_security_view_logs.php @@ -38,8 +38,8 @@ require_once("/etc/inc/pkg-utils.inc"); require_once("/etc/inc/globals.inc"); require_once("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Apache Proxy: Logs"; diff --git a/config/apache_mod_security-dev/apache_view_logs.php b/config/apache_mod_security-dev/apache_view_logs.php index 10bb1db6..3338d5f3 100644 --- a/config/apache_mod_security-dev/apache_view_logs.php +++ b/config/apache_mod_security-dev/apache_view_logs.php @@ -38,8 +38,8 @@ require_once("/etc/inc/functions.inc"); require_once("/etc/inc/pkg-utils.inc"); require_once("/etc/inc/globals.inc"); require_once("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Status: Apache VirtualHost Logs"; diff --git a/config/apache_mod_security/apache_mod_security_view_logs.php b/config/apache_mod_security/apache_mod_security_view_logs.php index 0218ac46..b2e60320 100644 --- a/config/apache_mod_security/apache_mod_security_view_logs.php +++ b/config/apache_mod_security/apache_mod_security_view_logs.php @@ -40,8 +40,8 @@ if($_REQUEST['getactivity']) { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: Mod_Security+Apache+Proxy: Logs"; diff --git a/config/apcupsd/apcupsd_status.php b/config/apcupsd/apcupsd_status.php index 8450bb6d..693ec290 100755 --- a/config/apcupsd/apcupsd_status.php +++ b/config/apcupsd/apcupsd_status.php @@ -29,9 +29,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); - -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: Apcupsd (Status)"; diff --git a/config/bacula-client/bacula-client_view_config.php b/config/bacula-client/bacula-client_view_config.php index 0420af90..305bcb83 100644 --- a/config/bacula-client/bacula-client_view_config.php +++ b/config/bacula-client/bacula-client_view_config.php @@ -30,11 +30,10 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; - $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); if ($pf_version > 2.0) define('BACULA_LOCALBASE', '/usr/pbi/bacula-' . php_uname("m")); else diff --git a/config/dansguardian/dansguardian_about.php b/config/dansguardian/dansguardian_about.php index 95f1245b..4cb47200 100755 --- a/config/dansguardian/dansguardian_about.php +++ b/config/dansguardian/dansguardian_about.php @@ -29,8 +29,8 @@ require_once("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "About: Dansguardian Package"; diff --git a/config/freeradius2/freeradius_view_config.php b/config/freeradius2/freeradius_view_config.php index 93fbba83..bfabd7fa 100644 --- a/config/freeradius2/freeradius_view_config.php +++ b/config/freeradius2/freeradius_view_config.php @@ -67,8 +67,8 @@ if ($_REQUEST['file']!=""){ get_file($_REQUEST['file']); } else{ - $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); - if(strstr($pfSversion, "1.2")) + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version < 2.0) $one_two = true; $pgtitle = "FreeRADIUS: View Configuration"; diff --git a/config/haproxy-devel/haproxy_global.php b/config/haproxy-devel/haproxy_global.php index 44f01dc5..50472d9f 100755 --- a/config/haproxy-devel/haproxy_global.php +++ b/config/haproxy-devel/haproxy_global.php @@ -133,8 +133,8 @@ if (!$pconfig['logfacility']) if (!$pconfig['loglevel']) $pconfig['loglevel'] = 'info'; -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Settings"; diff --git a/config/haproxy-devel/haproxy_listeners.php b/config/haproxy-devel/haproxy_listeners.php index cbb263c5..7022ec34 100644 --- a/config/haproxy-devel/haproxy_listeners.php +++ b/config/haproxy-devel/haproxy_listeners.php @@ -70,8 +70,8 @@ if ($_GET['act'] == "del") { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Frontends"; diff --git a/config/haproxy-devel/haproxy_listeners_edit.php b/config/haproxy-devel/haproxy_listeners_edit.php index 884bb364..6731731d 100644 --- a/config/haproxy-devel/haproxy_listeners_edit.php +++ b/config/haproxy-devel/haproxy_listeners_edit.php @@ -227,8 +227,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $closehead = false; diff --git a/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php index 726dab30..49eb4271 100644 --- a/config/haproxy-devel/haproxy_pool_edit.php +++ b/config/haproxy-devel/haproxy_pool_edit.php @@ -250,8 +250,8 @@ if ($_POST) { $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item']; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $closehead = false; diff --git a/config/haproxy-devel/haproxy_pools.php b/config/haproxy-devel/haproxy_pools.php index 15567807..92235933 100644 --- a/config/haproxy-devel/haproxy_pools.php +++ b/config/haproxy-devel/haproxy_pools.php @@ -65,8 +65,8 @@ if ($_GET['act'] == "del") { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Backend server pools"; diff --git a/config/haproxy-devel/haproxy_stats.php b/config/haproxy-devel/haproxy_stats.php index cbf5b2b2..10dd136a 100644 --- a/config/haproxy-devel/haproxy_stats.php +++ b/config/haproxy-devel/haproxy_stats.php @@ -129,8 +129,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Stats"; diff --git a/config/haproxy-legacy/haproxy_frontends.php b/config/haproxy-legacy/haproxy_frontends.php index 3b865ae3..1aef0b8f 100755 --- a/config/haproxy-legacy/haproxy_frontends.php +++ b/config/haproxy-legacy/haproxy_frontends.php @@ -65,8 +65,8 @@ if ($_GET['act'] == "del") { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Frontend"; diff --git a/config/haproxy-legacy/haproxy_frontends_edit.php b/config/haproxy-legacy/haproxy_frontends_edit.php index 61577a4a..db1c71be 100755 --- a/config/haproxy-legacy/haproxy_frontends_edit.php +++ b/config/haproxy-legacy/haproxy_frontends_edit.php @@ -263,8 +263,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: Frontend: Edit"; diff --git a/config/haproxy-legacy/haproxy_global.php b/config/haproxy-legacy/haproxy_global.php index f88f1cc5..509fdfe2 100755 --- a/config/haproxy-legacy/haproxy_global.php +++ b/config/haproxy-legacy/haproxy_global.php @@ -81,8 +81,8 @@ $pconfig['remotesyslog'] = $config['installedpackages']['haproxy']['remotesyslog $pconfig['advanced'] = base64_decode($config['installedpackages']['haproxy']['advanced']); $pconfig['nbproc'] = $config['installedpackages']['haproxy']['nbproc']; -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Settings"; diff --git a/config/haproxy-legacy/haproxy_servers.php b/config/haproxy-legacy/haproxy_servers.php index 5d7fbcdd..e04ed74c 100755 --- a/config/haproxy-legacy/haproxy_servers.php +++ b/config/haproxy-legacy/haproxy_servers.php @@ -66,8 +66,8 @@ if ($_GET['act'] == "del") { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Servers"; diff --git a/config/haproxy-legacy/haproxy_servers_edit.php b/config/haproxy-legacy/haproxy_servers_edit.php index 9f1eb147..86431992 100755 --- a/config/haproxy-legacy/haproxy_servers_edit.php +++ b/config/haproxy-legacy/haproxy_servers_edit.php @@ -149,8 +149,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: Server: Edit"; diff --git a/config/haproxy-stable/haproxy_global.php b/config/haproxy-stable/haproxy_global.php index fa58f9a2..c8b05d52 100755 --- a/config/haproxy-stable/haproxy_global.php +++ b/config/haproxy-stable/haproxy_global.php @@ -107,8 +107,8 @@ if (!$pconfig['logfacility']) if (!$pconfig['loglevel']) $pconfig['loglevel'] = 'info'; -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Settings"; diff --git a/config/haproxy-stable/haproxy_listeners.php b/config/haproxy-stable/haproxy_listeners.php index b34b2590..8c6125f0 100755 --- a/config/haproxy-stable/haproxy_listeners.php +++ b/config/haproxy-stable/haproxy_listeners.php @@ -65,8 +65,8 @@ if ($_GET['act'] == "del") { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Listener"; diff --git a/config/haproxy-stable/haproxy_listeners_edit.php b/config/haproxy-stable/haproxy_listeners_edit.php index f2b244df..e9c6187c 100755 --- a/config/haproxy-stable/haproxy_listeners_edit.php +++ b/config/haproxy-stable/haproxy_listeners_edit.php @@ -241,8 +241,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: Listener: Edit"; diff --git a/config/haproxy-stable/haproxy_pool_edit.php b/config/haproxy-stable/haproxy_pool_edit.php index 6ca730e9..1e9958eb 100755 --- a/config/haproxy-stable/haproxy_pool_edit.php +++ b/config/haproxy-stable/haproxy_pool_edit.php @@ -173,8 +173,8 @@ if ($_POST) { $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item']; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: pool: Edit"; diff --git a/config/haproxy-stable/haproxy_pools.php b/config/haproxy-stable/haproxy_pools.php index c3bc30b1..0edc2ad8 100755 --- a/config/haproxy-stable/haproxy_pools.php +++ b/config/haproxy-stable/haproxy_pools.php @@ -67,8 +67,8 @@ if ($_GET['act'] == "del") { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Server pools"; diff --git a/config/haproxy/haproxy_global.php b/config/haproxy/haproxy_global.php index b632c7cc..16f5152d 100755 --- a/config/haproxy/haproxy_global.php +++ b/config/haproxy/haproxy_global.php @@ -120,8 +120,8 @@ if (!$pconfig['logfacility']) if (!$pconfig['loglevel']) $pconfig['loglevel'] = 'info'; -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Settings"; diff --git a/config/haproxy/haproxy_listeners.php b/config/haproxy/haproxy_listeners.php index e1508d95..a5bc9a22 100755 --- a/config/haproxy/haproxy_listeners.php +++ b/config/haproxy/haproxy_listeners.php @@ -65,8 +65,8 @@ if ($_GET['act'] == "del") { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Listener"; diff --git a/config/haproxy/haproxy_listeners_edit.php b/config/haproxy/haproxy_listeners_edit.php index 7ebbc701..2b71c7ea 100755 --- a/config/haproxy/haproxy_listeners_edit.php +++ b/config/haproxy/haproxy_listeners_edit.php @@ -241,8 +241,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: Listener: Edit"; diff --git a/config/haproxy/haproxy_pool_edit.php b/config/haproxy/haproxy_pool_edit.php index 4f2b5902..4da508f2 100755 --- a/config/haproxy/haproxy_pool_edit.php +++ b/config/haproxy/haproxy_pool_edit.php @@ -171,8 +171,8 @@ if ($_POST) { $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item']; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: pool: Edit"; diff --git a/config/haproxy/haproxy_pools.php b/config/haproxy/haproxy_pools.php index 6c2146a0..a0bf75a2 100755 --- a/config/haproxy/haproxy_pools.php +++ b/config/haproxy/haproxy_pools.php @@ -67,8 +67,8 @@ if ($_GET['act'] == "del") { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Server pools"; diff --git a/config/mailscanner/mailscanner_about.php b/config/mailscanner/mailscanner_about.php index 9277a3a7..1909e039 100755 --- a/config/mailscanner/mailscanner_about.php +++ b/config/mailscanner/mailscanner_about.php @@ -29,8 +29,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "About: Mailscanner Package"; diff --git a/config/openospfd/status_ospfd.php b/config/openospfd/status_ospfd.php index 6fcca6bd..25f18d85 100644 --- a/config/openospfd/status_ospfd.php +++ b/config/openospfd/status_ospfd.php @@ -93,8 +93,8 @@ function doCmdT($title, $command) { echo "\n"; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; ?> diff --git a/config/postfix/postfix_about.php b/config/postfix/postfix_about.php index b7d04d16..87d0cf69 100755 --- a/config/postfix/postfix_about.php +++ b/config/postfix/postfix_about.php @@ -30,8 +30,8 @@ $shortcut_section = "postfix"; require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Diagnostics: Search Mail"; diff --git a/config/postfix/postfix_queue.php b/config/postfix/postfix_queue.php index bf6e956c..7afd8fe7 100755 --- a/config/postfix/postfix_queue.php +++ b/config/postfix/postfix_queue.php @@ -104,8 +104,8 @@ if ($_REQUEST['cmd']!=""){ get_cmd(); } else{ - $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); - if(strstr($pfSversion, "1.2")) + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version < 2.0) $one_two = true; $pgtitle = "Status: Postfix Mail Queue"; diff --git a/config/postfix/postfix_search.php b/config/postfix/postfix_search.php index 78d79869..c29d8cf2 100755 --- a/config/postfix/postfix_search.php +++ b/config/postfix/postfix_search.php @@ -34,8 +34,8 @@ $uname=posix_uname(); if ($uname['machine']=='amd64') ini_set('memory_limit', '250M'); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Diagnostics: Search Mail"; diff --git a/config/postfix/postfix_view_config.php b/config/postfix/postfix_view_config.php index c3efda53..24bfd575 100644 --- a/config/postfix/postfix_view_config.php +++ b/config/postfix/postfix_view_config.php @@ -57,7 +57,7 @@ if ($_REQUEST['file']!=""){ } else{ $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); - if(strstr($pfSversion, "1.2")) + if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: Postfix View Configuration"; diff --git a/config/sarg/sarg_about.php b/config/sarg/sarg_about.php index 118bbb48..573dc5ee 100755 --- a/config/sarg/sarg_about.php +++ b/config/sarg/sarg_about.php @@ -29,8 +29,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "About: Sarg Package"; diff --git a/config/sarg/sarg_realtime.php b/config/sarg/sarg_realtime.php index f8bf0f3e..81ea0a79 100755 --- a/config/sarg/sarg_realtime.php +++ b/config/sarg/sarg_realtime.php @@ -99,8 +99,8 @@ if ($_REQUEST['cmd']!=""){ } else{ require("guiconfig.inc"); - $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); - if(strstr($pfSversion, "1.2")) + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version < 2.0) $one_two = true; $pgtitle = "Status: Sarg Realtime"; diff --git a/config/sarg/sarg_reports.php b/config/sarg/sarg_reports.php index 07d8e898..f18eb80e 100755 --- a/config/sarg/sarg_reports.php +++ b/config/sarg/sarg_reports.php @@ -29,8 +29,8 @@ require("guiconfig.inc"); - $pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); - if(strstr($pfSversion, "1.2")) + $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); + if ($pf_version < 2.0) $one_two = true; $pgtitle = "Status: Sarg Reports"; diff --git a/config/tinydns/tinydns_dhcp_filter.php b/config/tinydns/tinydns_dhcp_filter.php index c92abcf8..85f5f8e7 100644 --- a/config/tinydns/tinydns_dhcp_filter.php +++ b/config/tinydns/tinydns_dhcp_filter.php @@ -42,8 +42,8 @@ require("guiconfig.inc"); $pgtitle = "TinyDNS: DHCP Domains"; include("head.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; ?> diff --git a/config/tinydns/tinydns_status.php b/config/tinydns/tinydns_status.php index b6061a60..ba119da9 100644 --- a/config/tinydns/tinydns_status.php +++ b/config/tinydns/tinydns_status.php @@ -41,8 +41,8 @@ if(!$config['installedpackages']['tinydns']['config'][0]['ipaddress']) $pgtitle = "TinyDNS: Status"; include("head.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; ?> diff --git a/config/tinydns/tinydns_view_logs.php b/config/tinydns/tinydns_view_logs.php index dc359451..57daa02e 100644 --- a/config/tinydns/tinydns_view_logs.php +++ b/config/tinydns/tinydns_view_logs.php @@ -42,8 +42,8 @@ if($_REQUEST['getactivity']) { if(!$config['installedpackages']['tinydns']['config'][0]) Header("Location: /pkg_edit.php?xml=tinydns.xml&id=0"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "TinyDNS: View Logs"; diff --git a/config/varnish3/varnish_view_config.php b/config/varnish3/varnish_view_config.php index 15c68447..69a9fabb 100644 --- a/config/varnish3/varnish_view_config.php +++ b/config/varnish3/varnish_view_config.php @@ -29,8 +29,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Varnish: View Configuration"; diff --git a/config/varnish3/varnishstat.php b/config/varnish3/varnishstat.php index 9fe3d77d..10d9ceb9 100644 --- a/config/varnish3/varnishstat.php +++ b/config/varnish3/varnishstat.php @@ -36,8 +36,8 @@ if($_REQUEST['getactivity']) { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Varnish: VarnishSTAT"; diff --git a/config/varnish64/varnish_view_config.php b/config/varnish64/varnish_view_config.php index 15c68447..69a9fabb 100644 --- a/config/varnish64/varnish_view_config.php +++ b/config/varnish64/varnish_view_config.php @@ -29,8 +29,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Varnish: View Configuration"; diff --git a/config/varnish64/varnishstat.php b/config/varnish64/varnishstat.php index 9fe3d77d..10d9ceb9 100644 --- a/config/varnish64/varnishstat.php +++ b/config/varnish64/varnishstat.php @@ -36,8 +36,8 @@ if($_REQUEST['getactivity']) { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Varnish: VarnishSTAT"; diff --git a/config/vnstat2/www/diag_vnstat.php b/config/vnstat2/www/diag_vnstat.php index afef3849..04e03911 100644 --- a/config/vnstat2/www/diag_vnstat.php +++ b/config/vnstat2/www/diag_vnstat.php @@ -41,7 +41,7 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); $pgtitle = gettext("Vnstat2 summary "); if($_REQUEST['getactivity']) { @@ -77,7 +77,7 @@ include("head.inc");
{$pgtitle}

"; echo "Go Back
"; if($savemsg) { diff --git a/config/vnstat2/www/diag_vnstat2.php b/config/vnstat2/www/diag_vnstat2.php index ec19a0b2..e5ce1de5 100644 --- a/config/vnstat2/www/diag_vnstat2.php +++ b/config/vnstat2/www/diag_vnstat2.php @@ -43,7 +43,7 @@ global $config; $aaaa = $config['installedpackages']['vnstat2']['config'][0]['vnstat_interface2']; $bbbb = convert_real_interface_to_friendly_descr($aaaa); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); $pgtitle = gettext("Vnstat2 info for $bbbb ($aaaa)"); if($_REQUEST['getactivity']) { @@ -87,7 +87,7 @@ else
{$pgtitle}

"; echo "Go Back
"; if($savemsg) { diff --git a/config/zebedee/zebedee_del_key.php b/config/zebedee/zebedee_del_key.php index 49688fd3..9b52bbd9 100644 --- a/config/zebedee/zebedee_del_key.php +++ b/config/zebedee/zebedee_del_key.php @@ -32,8 +32,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $zebede_keys = $config['installedpackages']['zebedeekeys']['config'] ; diff --git a/config/zebedee/zebedee_keys.php b/config/zebedee/zebedee_keys.php index 1ff7d06e..58adc79d 100644 --- a/config/zebedee/zebedee_keys.php +++ b/config/zebedee/zebedee_keys.php @@ -34,8 +34,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Zebedee Tunneling"; diff --git a/config/zebedee/zebedee_log.php b/config/zebedee/zebedee_log.php index 784ad93e..4e7911c6 100644 --- a/config/zebedee/zebedee_log.php +++ b/config/zebedee/zebedee_log.php @@ -36,8 +36,8 @@ if($_REQUEST['getactivity']) { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Zebedee: Logs"; diff --git a/config/zebedee/zebedee_view_config.php b/config/zebedee/zebedee_view_config.php index 1d57d8eb..26e0f1ff 100644 --- a/config/zebedee/zebedee_view_config.php +++ b/config/zebedee/zebedee_view_config.php @@ -29,8 +29,8 @@ require("guiconfig.inc"); -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Zebedee: View Configuration"; -- cgit v1.2.3