aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2012-10-03 07:21:14 -0700
committerMarcello Coutinho <marcellocoutinho@gmail.com>2012-10-03 07:21:14 -0700
commite6ce2c1d5eb77dbcf9641c01bd9a63da5bb5eb4d (patch)
treeffcc907a1deba5c9e765e092c51b3667508575d5
parent02b3cbc15fd82b96d04408e1b95e6439fc51e6cf (diff)
parent21b5080d9b3bbf19d6441aebea87fe35f29783ca (diff)
downloadpfsense-packages-e6ce2c1d5eb77dbcf9641c01bd9a63da5bb5eb4d.tar.gz
pfsense-packages-e6ce2c1d5eb77dbcf9641c01bd9a63da5bb5eb4d.tar.bz2
pfsense-packages-e6ce2c1d5eb77dbcf9641c01bd9a63da5bb5eb4d.zip
Merge pull request #327 from rjcrowder/master
Dansguardian blacklist download fix for shallalist
-rw-r--r--config/dansguardian/dansguardian.php34
1 files changed, 25 insertions, 9 deletions
diff --git a/config/dansguardian/dansguardian.php b/config/dansguardian/dansguardian.php
index 520cdc5c..8571e1b7 100644
--- a/config/dansguardian/dansguardian.php
+++ b/config/dansguardian/dansguardian.php
@@ -84,17 +84,33 @@ function read_lists(){
#read dir content and find lists
$lists= scandir("$dir/$group/");
foreach ($lists as $list)
- if (!preg_match ("/^\./",$list) && is_dir("$dir/$group/$list/")){
+ if (!preg_match ("/^\./",$list) && is_dir("$dir/$group/$list/")) {
$category= scandir("$dir/$group/$list/");
foreach ($category as $file)
- if (!preg_match ("/^\./",$file)){
- #assign list to array
- $type=split("_",$file);
- if (preg_match("/(\w+)/",$type[0],$matches));
- $xml_type=$matches[1];
- if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"]=="both" && $group=="blacklists")
- $config['installedpackages']['dansguardianwhitelists'.$xml_type]['config'][]=array("descr"=> "$list $file","list" => $list,"file" => "$dir/$group/$list/$file");
- $config['installedpackages']['dansguardian'.$group.$xml_type]['config'][]=array("descr"=> "$list $file","list" => $list,"file" => "$dir/$group/$list/$file");
+ if (!preg_match ("/^\./",$file)) {
+ if (is_dir("$dir/$group/$list/$file")) {
+ $subdir=$file;
+ $subcategory= scandir("$dir/$group/$list/$subdir/");
+ foreach ($subcategory as $file)
+ if (!preg_match ("/^\./",$file)){
+ #assign list to array
+ $type=split("_",$file);
+ if (preg_match("/(\w+)/",$type[0],$matches));
+ $xml_type=$matches[1];
+ if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"]=="both" && $group=="blacklists")
+ $config['installedpackages']['dansguardianwhitelists'.$xml_type]['config'][]=array("descr"=> "{$list}_{$subdir} {$file}","list" => "{$list}_{$subdir}","file" => "$dir/$group/$list/$subdir/$file");
+ $config['installedpackages']['dansguardian'.$group.$xml_type]['config'][]=array("descr"=> "{$list}_{$subdir} {$file}","list" => "{$list}_{$subdir}","file" => "$dir/$group/$list/$subdir/$file");
+ }
+ }
+ else {
+ #assign list to array
+ $type=split("_",$file);
+ if (preg_match("/(\w+)/",$type[0],$matches));
+ $xml_type=$matches[1];
+ if ($config['installedpackages']['dansguardianblacklist']['config'][0]["liston"]=="both" && $group=="blacklists")
+ $config['installedpackages']['dansguardianwhitelists'.$xml_type]['config'][]=array("descr"=> "$list $file","list" => $list,"file" => "$dir/$group/$list/$file");
+ $config['installedpackages']['dansguardian'.$group.$xml_type]['config'][]=array("descr"=> "$list $file","list" => $list,"file" => "$dir/$group/$list/$file");
+ }
}
}
}