From 5a6732cdab3ed5f42bf3ecb470f99ca59488e6e4 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 12 Sep 2015 21:59:32 +0200 Subject: havp - fix templates --- config/havp/havp.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/havp/havp.xml b/config/havp/havp.xml index c99bf8c4..a1484a59 100644 --- a/config/havp/havp.xml +++ b/config/havp/havp.xml @@ -212,9 +212,11 @@ - + + + -- cgit v1.2.3 From 1039ba4bdf562783f19ac3ed551011f5cfe7200a Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 12 Sep 2015 22:09:19 +0200 Subject: havp - fix template paths --- config/havp/havp.inc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'config') diff --git a/config/havp/havp.inc b/config/havp/havp.inc index 38412f31..30b06d03 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -87,9 +87,13 @@ define('HVDEF_PID_FILE', '/var/run/havp.pid'); $pf_version=substr(trim(file_get_contents("/etc/version")), 0, 3); if ($pf_version == "2.1" || $pf_version == "2.2") { - define("HVDEF_WORK_DIR", "/usr/pbi/havp-" . php_uname("m") . "/local/etc"); + define("HVDEF_WORK_DIR", "/usr/pbi/havp-" . php_uname("m") . "/local/etc"); + define('HVDEF_TEMPLATES', "/usr/pbi/havp-" . php_uname("m") . "/local/share/examples/havp/templates"); + define('HVDEF_TEMPLATES_EX', HVDEF_TEMPLATES . '_ex'); } else { - define("HVDEF_WORK_DIR", "/usr/local/etc/havp"); + define("HVDEF_WORK_DIR", "/usr/local/etc/havp"); + define('HVDEF_TEMPLATES', '/usr/local/share/examples/havp/templates'); + define('HVDEF_TEMPLATES_EX', HVDEF_TEMPLATES . '_ex'); } define('HVDEF_LOG_DIR', '/var/log/havp'); @@ -97,8 +101,6 @@ define('HVDEF_TEMP_DIR', '/var/tmp'); define('HVDEF_HAVPTEMP_DIR', HVDEF_TEMP_DIR . '/havp'); define('HVDEF_RAMTEMP_DIR', HVDEF_TEMP_DIR . '/havpRAM'); define('HVDEF_SCANTEMPFILE', '/havp-XXXXXX'); -define('HVDEF_TEMPLATES', '/usr/local/share/examples/havp/templates'); -define('HVDEF_TEMPLATES_EX', HVDEF_TEMPLATES . '_ex'); define('HVDEF_FILTER_RULES', '/tmp/rules.havp'); define('HVDEF_HAVP_CONFIG', HVDEF_WORK_DIR . '/havp.config'); define('HVDEF_HAVP_XMLCONF', HVDEF_WORK_DIR . '/havp_conf.xml'); @@ -628,7 +630,7 @@ function havp_convert_pfxml_xml() { $havp_config[F_PROXYBINDIFACE] = 'localhost'; /* Language template files path */ $lng = $havp_config[F_LANGUAGE] ? $havp_config[F_LANGUAGE] : "en"; - $havp_config[F_TEMPLATEPATH] = (file_exists(HVDEF_TEMPLATES_EX . "/$lng") ? HVDEF_TEMPLATES_EX : HVDEF_TEMPLATES ); + $havp_config[F_TEMPLATEPATH] = (file_exists(HVDEF_TEMPLATES . "/$lng") ? HVDEF_TEMPLATES : HVDEF_TEMPLATES_EX ); $havp_config[F_TEMPLATEPATH] .= "/$lng"; /* AV settings */ $pf_avset_conf = $config['installedpackages'][HVFORM_AVSET]['config'][0]; -- cgit v1.2.3 From d1f18400aaa29b8959795c7463b1d9ca36a891c9 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 12 Sep 2015 22:20:44 +0200 Subject: havp - remove created bogus templates directory on uninstall --- config/havp/havp.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/havp/havp.inc b/config/havp/havp.inc index 30b06d03..40c1dfbc 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -240,6 +240,9 @@ function havp_deinstall() { // unlink_if_exists(HVDEF_AVUPD_SCRIPT); // unlink_if_exists(HVDEF_CLAM_PID); // unlink_if_exists(HVDEF_CLAM_SOCKET); + if (is_dir("/usr/local/share/examples/havp/")) { + mwexec("/bin/rm -rf /usr/local/share/examples/havp/"); + } umountRAMDisk(); } /* -- cgit v1.2.3 From f78d8f684d8bd839d47bc1230d2086eaadbe1bd0 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 12 Sep 2015 23:07:46 +0200 Subject: default to the custom created templates directory --- config/havp/havp.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/havp/havp.inc b/config/havp/havp.inc index 40c1dfbc..9e931a95 100644 --- a/config/havp/havp.inc +++ b/config/havp/havp.inc @@ -633,7 +633,7 @@ function havp_convert_pfxml_xml() { $havp_config[F_PROXYBINDIFACE] = 'localhost'; /* Language template files path */ $lng = $havp_config[F_LANGUAGE] ? $havp_config[F_LANGUAGE] : "en"; - $havp_config[F_TEMPLATEPATH] = (file_exists(HVDEF_TEMPLATES . "/$lng") ? HVDEF_TEMPLATES : HVDEF_TEMPLATES_EX ); + $havp_config[F_TEMPLATEPATH] = (file_exists(HVDEF_TEMPLATES_EX . "/$lng") ? HVDEF_TEMPLATES_EX : HVDEF_TEMPLATES ); $havp_config[F_TEMPLATEPATH] .= "/$lng"; /* AV settings */ $pf_avset_conf = $config['installedpackages'][HVFORM_AVSET]['config'][0]; -- cgit v1.2.3