diff options
author | marcelloc <marcellocoutinho@gmail.com> | 2012-01-27 17:08:33 -0200 |
---|---|---|
committer | marcelloc <marcellocoutinho@gmail.com> | 2012-01-27 17:08:33 -0200 |
commit | f1415041a0c45bd986772356dc72581fe716de99 (patch) | |
tree | 8564ed983c77c33dd5f265e07402e8543e9bdc9c /config/dansguardian/dansguardian.inc | |
parent | 940f2a25c862ae3cb891540b7f1dd12e7a71a9f7 (diff) | |
download | pfsense-packages-f1415041a0c45bd986772356dc72581fe716de99.tar.gz pfsense-packages-f1415041a0c45bd986772356dc72581fe716de99.tar.bz2 pfsense-packages-f1415041a0c45bd986772356dc72581fe716de99.zip |
dansguardian - fix some bugs and missing xml fields
Diffstat (limited to 'config/dansguardian/dansguardian.inc')
-rwxr-xr-x | config/dansguardian/dansguardian.inc | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/config/dansguardian/dansguardian.inc b/config/dansguardian/dansguardian.inc index 343c38b9..ab25c7ae 100755 --- a/config/dansguardian/dansguardian.inc +++ b/config/dansguardian/dansguardian.inc @@ -79,6 +79,8 @@ function sync_package_dansguardian() { $maxagechildren=($dansguardian['maxagechildren']?$dansguardian['maxagechildren']:"500"); $maxips=($dansguardian['maxips']?$dansguardian['maxips']:"0"); $preforkchildren=($dansguardian['preforkchildren']?$dansguardian['preforkchildren']:"10"); + $proxyip=($dansguardian['proxyip']?$dansguardian['proxyip']:"127.0.0.1"); + $proxyport=($dansguardian['proxyport']?$dansguardian['proxyport']:"127.0.0.1"); #general options $urlcachenumber=($dansguardian_config['urlcachenumber']?$dansguardian_config['urlcachenumber']:"1000"); @@ -118,6 +120,8 @@ function sync_package_dansguardian() { $reportlanguage=($dansguardian_log['report_language']?$dansguardian_log['report_language']:"ukenglish"); $showweightedfound=(preg_match('/showweightedfound/',$dansguardian_log['report_options'])?"on":"off"); $usecustombannedflash=(preg_match('/usecustombannedflash/',$dansguardian_log['report_options'])?"on":"off"); + if (file_exists('/usr/local/share/dansguardian/blockedflash.swf')) + $custombannedflashfile="custombannedflashfile = '/usr/local/share/dansguardian/blockedflash.swf'"; $usecustombannedimage=(preg_match('/usecustombannedimage/',$dansguardian_log['report_options'])?"on":"off"); $nonstandarddelimiter=(preg_match('/nonstandarddelimiter/',$dansguardian_log['report_options'])?"on":"off"); @@ -621,6 +625,20 @@ EOF; $count++; } + if ($user_xml==""){ + $user_xml .=<<<EOF + <field> + <name>Users</name> + <type>listtopic</type> + </field> + <field> + <fielddescr>Users</fielddescr> + <fieldname>info_checkbox</fieldname> + <type>checkbox</type> + <description><![CDATA[Dansguardian users are required only when you have more then one group.<br>All unauthenticated users or unlisted uses will match first filter group.]]></description> + </field> +EOF; + } #Create/update filtergroupslist file_put_contents($dansguardian_dir."/lists/filtergroupslist",$filtergroupslist,LOCK_EX); #Create/update userlist xml file @@ -671,8 +689,16 @@ EOF; conf_mount_rw(); write_config(); + + $dirs=array('/usr/local/etc/dansguardian/lists/bannedrooms/', + '/var/log/dansguardian'); + + foreach ($dirs as $dir) + if (!is_dir($dir)) + mkdir ($dir,0755,true); + #update file owner - mwexec("chown -R $daemonuser:$daemongroup /usr/loca/etc/dansguardian"); + mwexec("chown -R $daemonuser:$daemongroup /usr/local/etc/dansguardian"); mwexec("chown -R $daemonuser:$daemongroup /var/log/dansguardian"); #create config files @@ -695,8 +721,9 @@ EOF; #clamdscan.conf dansguardian file $cconf="/usr/local/etc/dansguardian/contentscanners/clamdscan.conf"; $cconf_file=file_get_contents($cconf); - if (!preg_match('/clamav/',$cconf_file)){ - file_put_contents($cconf, $cconf_file."\nclamdudsfile = '/var/run/clamav/clamd.sock'", LOCK_EX); + if (preg_match('/#clamdudsfile/',$cconf_file)){ + $cconf_file=preg_replace('/#clamdudsfile/','clamdudsfile',$cconf_file); + file_put_contents($cconf, $cconf_file, LOCK_EX); } #clamd conf file @@ -725,12 +752,7 @@ EOF; } } - $dirs=array('/usr/local/etc/dansguardian/lists/bannedrooms/', - '/var/log/dansguardian'); - foreach ($dirs as $dir) - if (!is_dir($dir)) - mkdir ($dir,0755,true); - + $script='/usr/local/etc/rc.d/dansguardian'; if($config['installedpackages']['dansguardian']['config'][0]['enable']){ $script_file=file_get_contents($script); |