diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2012-07-09 12:25:07 -0300 |
---|---|---|
committer | Marcello Coutinho <marcellocoutinho@gmail.com> | 2012-07-09 12:25:07 -0300 |
commit | 4e8dd82f957006899f1babb2e521b8fd3cdcd2ce (patch) | |
tree | d3e59909a70fc5bf42981f625cabc584a3396668 /config/dansguardian/dansguardian.inc | |
parent | 27a37ac3ddcd0dc1a8a230841199fc8ba997195f (diff) | |
download | pfsense-packages-4e8dd82f957006899f1babb2e521b8fd3cdcd2ce.tar.gz pfsense-packages-4e8dd82f957006899f1babb2e521b8fd3cdcd2ce.tar.bz2 pfsense-packages-4e8dd82f957006899f1babb2e521b8fd3cdcd2ce.zip |
dansguardian - improve exceptioniplist array creation and test
Diffstat (limited to 'config/dansguardian/dansguardian.inc')
-rwxr-xr-x | config/dansguardian/dansguardian.inc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc index 0ef32a07..f61936a7 100755 --- a/config/dansguardian/dansguardian.inc +++ b/config/dansguardian/dansguardian.inc @@ -32,7 +32,13 @@ require_once("util.inc"); require("globals.inc"); #require("guiconfig.inc"); -$uname=posix_uname(); +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version > 2.0) + define('DANSGUARDIAN_DIR', '/usr/pbi/dansguardian-' . php_uname("m")); +else + define('DANSGUARDIAN_DIR', '/usr/local'); + + $uname=posix_uname(); if ($uname['machine']=='amd64') ini_set('memory_limit', '250M'); @@ -423,7 +429,7 @@ function sync_package_dansguardian() { file_put_contents($dansguardian_dir."/lists/logsitelist.".$dansguardian_site['name'],($dansguardian_site['urlsite_enabled']?dg_text_area_decode($config['installedpackages']['dansguardiansiteacl']['config'][$count]['log_sitelist']):""),LOCK_EX); $count++; } - + #URL ACL #create a default setup if not exists if (!is_array($config['installedpackages']['dansguardianurlacl']['config'])) @@ -682,11 +688,12 @@ 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]=array("exceptioniplist" => ""); + if($config['installedpackages']['dansguardianips']['config'][0]['exceptioniplist'] == "" && file_exists ($dansguardian_dir.'/lists/exceptioniplist.sample')){ $config['installedpackages']['dansguardianips']['config'][0]['exceptioniplist']=base64_encode(file_get_contents($dansguardian_dir.'/lists/exceptioniplist.sample')); $load_samples++; } |