From 27a37ac3ddcd0dc1a8a230841199fc8ba997195f Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Mon, 9 Jul 2012 11:42:43 -0300 Subject: dansguardian - include missing exceptioniplist field to gui --- config/dansguardian/dansguardian.inc | 13 +++++++++++-- config/dansguardian/dansguardian_ips_header.xml | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'config/dansguardian') diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc index 8a976ebf..0ef32a07 100755 --- a/config/dansguardian/dansguardian.inc +++ b/config/dansguardian/dansguardian.inc @@ -260,9 +260,9 @@ function sync_package_dansguardian() { "/lists/contentscanners/exceptionvirusmimetypelist", "/lists/contentscanners/exceptionvirussitelist", "/lists/contentscanners/exceptionvirusurllist", + "/lists/exceptioniplist", "/lists/pics"); - $dansguardian_dir="/usr/local/etc/dansguardian"; foreach ($files as $file) if (! file_exists($dansguardian_dir.$file.'.sample')){ @@ -671,7 +671,7 @@ function sync_package_dansguardian() { if($dansguardian_antivirus['extension_list'] == "" && file_exists ($dansguardian_dir.'/lists/contentscanners/exceptionvirusextensionlist.sample')){ $config['installedpackages']['dansguardianantivirusacl']['config'][0]['extension_list']=base64_encode(file_get_contents($dansguardian_dir.'/lists/contentscanners/exceptionvirusextensionlist.sample')); $load_samples++; - } + } file_put_contents($dansguardian_dir."/lists/contentscanners/exceptionvirusextensionlist",($dansguardian_antivirus['extension_enabled']?dg_text_area_decode($config['installedpackages']['dansguardianantivirusacl']['config'][0]['extension_list']):""),LOCK_EX); #log report @@ -682,6 +682,15 @@ function sync_package_dansguardian() { $dansguardian_log['report_file']=base64_encode($report_file); $load_samples++; } + #exception ip list + #create a default setup if not exists + if (!is_array($config['installedpackages']['dansguardianips']['config'])) + $config['installedpackages']['dansguardianips']['config'][0]=array(); + if($config['installedpackages']['dansguardianips']['config'][0]['exceptioniplist']){ + $config['installedpackages']['dansguardianips']['config'][0]['exceptioniplist']=base64_encode(file_get_contents($dansguardian_dir.'/lists/exceptioniplist.sample')); + $load_samples++; + } + file_put_contents($dansguardian_dir."/lists/exceptioniplist",dg_text_area_decode($config['installedpackages']['dansguardianips']['config'][0]['exceptioniplist']),LOCK_EX); if($load_samples > 0) write_config(); diff --git a/config/dansguardian/dansguardian_ips_header.xml b/config/dansguardian/dansguardian_ips_header.xml index 33e50332..c15e31da 100644 --- a/config/dansguardian/dansguardian_ips_header.xml +++ b/config/dansguardian/dansguardian_ips_header.xml @@ -97,4 +97,18 @@ - \ No newline at end of file + + Exception IP list + listtopic + + + exceptioniplist + Exception Ip List + + Leave empty to load dansguardian defaults.]]> + textarea + 80 + 12 + base64 + + \ No newline at end of file -- cgit v1.2.3