diff options
author | rjcrowder <randyj.crowder@gmail.com> | 2012-10-02 22:56:12 -0300 |
---|---|---|
committer | rjcrowder <randyj.crowder@gmail.com> | 2012-10-02 22:56:12 -0300 |
commit | 21b5080d9b3bbf19d6441aebea87fe35f29783ca (patch) | |
tree | 690fcfde7208756a3179d5ad755e19713d2ef7d5 | |
parent | b1edcdb38d022c1165691e8c9ff271fa9350d1f3 (diff) | |
download | pfsense-packages-21b5080d9b3bbf19d6441aebea87fe35f29783ca.tar.gz pfsense-packages-21b5080d9b3bbf19d6441aebea87fe35f29783ca.tar.bz2 pfsense-packages-21b5080d9b3bbf19d6441aebea87fe35f29783ca.zip |
Update config/dansguardian/dansguardian.php
-rw-r--r-- | config/dansguardian/dansguardian.php | 34 |
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"); + } } } } |