.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "dansguardian 3pm" .TH dansguardian 3pm "2009-05-10" "perl v5.10.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Dansguardian \- Simple module for administer dansguardian's control files. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Dansguardian; \& \& # Make the objet $dg using the contructor new() \& \& my $dg = Dansguardian\->new(dir => \*(Aq/etc/dansguardian\*(Aq, group_dir => \*(Aq/etc/dansguardian/lists\*(Aq); \& \& # Save IP\*(Aqs banned in array \& \& my @banned_ips = $dg\->get(\*(Aqbannediplist\*(Aq); \& print "The IP address $_ is banned!!\en" foreach @banned_ips; \& \& # Add exception web site \& \& my $site = \*(Aqmogaal.com\*(Aq; \& $dg\->set(file => \*(Aqexceptionsitelist\*(Aq, add => $site, comment => "Is not porn site"); \& \& # Remove banned IP \& \& my $ip_free = \*(Aq192.168.0.2\*(Aq; \& $dg\->remove(file => \*(Aqbannediplist\*(Aq, line => $ip_free); \& \& # list sites banned \& \& my @sites_banned = $dg\->get(\*(Aqbannedsitelist\*(Aq); \& print "The site $_ is banned!!\en" foreach @sites_banned; \& \& # list dansguardian\*(Aqs config directory and the current group directory \& \& print "Dansguardian\*(Aqs config directory is " . $dg\->group() . " and " . $dg\->dir() . " is the current group directory\en"; \& \& # Change group directory; \& \& $dg\->group("/etc/dansguardian/chiefs"); \& print "Dansguardian\*(Aqs config directory is " . $dg\->dir() . " and " . $dg\->group() . " is the current group directory\en"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\*(L"DansGuardian is an award winning Open Source web content filter which currently runs on Linux, FreeBSD, OpenBSD, NetBSD, Mac \s-1OS\s0 X, HP-UX, and Solaris. It filters the actual content of pages based on many methods including phrase matching, \s-1PICS\s0 filtering and \s-1URL\s0 filtering. It does not purely filter based on a banned list of sites like lesser totally commercial filters.\*(R" .PP Dansguardian Perl module is small module for administer dansguardian's content control files. It let you add, remove and get information from files control across methods. .SH "METHODS" .IX Header "METHODS" Dansguardian perl module provides some basic methods for administer control files, with it you can add, remove and get information about \s-1IP\s0's blocked, sites denies, \s-1IP\s0 exception and other information. .SS "new (constructor)" .IX Subsection "new (constructor)" .Vb 1 \& $dg = Dansguardian\->new([%attributes]) .Ve .PP The constructor will create an object. It accepts a list of key => value pairs: .IP "dir => 'dansguardian/config/directory'" 3 .IX Item "dir => 'dansguardian/config/directory'" If you don't set up a config directory for dansguardian the module will set up default value: /etc/dansguardian .IP "group_dir => 'path/to/group_dir/directory'" 3 .IX Item "group_dir => 'path/to/group_dir/directory'" Same that dir hash, and the default value is: /etc/dansguardian/lists .ie n .SS "$dg\->group([$group_dir]);" .el .SS "\f(CW$dg\fP\->group([$group_dir]);" .IX Subsection "$dg->group([$group_dir]);" If group method don't have attribute: the function return array with dansguardian current group directory. Is possible change the group directory setting up \f(CW$group_dir\fR variable. .ie n .SS "$dg\->dir([$config_dir]);" .el .SS "\f(CW$dg\fP\->dir([$config_dir]);" .IX Subsection "$dg->dir([$config_dir]);" If dir method don't have attribute: the function return array with dansguardian current config directory. Is possible change the group directory setting up \f(CW$group_dir\fR variable. .ie n .SS "$dg\->set(%attributes);" .el .SS "\f(CW$dg\fP\->set(%attributes);" .IX Subsection "$dg->set(%attributes);" set method must have hash attributes. So, it accepts a list of key => value pairs: .IP "file => '\s-1FILE\s0'" 3 .IX Item "file => 'FILE'" The \s-1FILE\s0 value is the file (locate inside current group dir) where you wish add information. For example: If you want add site to exception. .Sp .Vb 1 \& $dg\->set(file => \*(Aqexceptionsitelist\*(Aq, add => $site, comment => "Is not porn site"); .Ve .Sp This line will add \f(CW$site\fR to /etc/dansguardian/lists/exceptioniplist assuming that /etc/dansguardian/lists is current group directory .IP "add => '\s-1INFORMATION\s0'" 3 .IX Item "add => 'INFORMATION'" The 'add' value is the information to add in dansguardian control file. For example: If you need add one \s-1IP\s0 for bannediplist control file, then assign '\s-1IP\s0' value for add hash key. .IP "comment => '\s-1OPTIONAL\s0 \s-1COMMENT\s0'" 3 .IX Item "comment => 'OPTIONAL COMMENT'" .PP This key is optional but very usefull for reading control files. It add comment at final line, after the 'add' value. .ie n .SS "$dg\->remove($file)" .el .SS "\f(CW$dg\fP\->remove($file)" .IX Subsection "$dg->remove($file)" remove method must have one hash attribute with keys: .IP "file => '\s-1FILE\s0'" 3 .IX Item "file => 'FILE'" The \s-1FILE\s0 value is the file (locate inside current group dir) where you wish remove information. .IP "line => 'LINE/IP/SITE/whatever'" 3 .IX Item "line => 'LINE/IP/SITE/whatever'" The value of hash key line is the information for remove in dansguardian control file. For example: For remove \s-1IP\s0 address from bannediplist control file you must add '\s-1IP\s0' like value of line hash key. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 1 \& $dg\->remove(file => \*(Aqbannediplist\*(Aq, line => \*(Aq192.168.24.76\*(Aq); .Ve .ie n .SS "$dg\->get($file)" .el .SS "\f(CW$dg\fP\->get($file)" .IX Subsection "$dg->get($file)" Get method return an array data with information inside content control file. The incoming parameter is the control file name. Example: .PP .Vb 2 \& @ips_banned = $dg\->get(\*(Aqbannediplist\*(Aq) \& print "The IP address $_ is banned!!\en" foreach @banned_ips; .Ve .SH "BUGS" .IX Header "BUGS" The package don't have been bugs reported. If you find one notice me. .SH "AUTHOR" .IX Header "AUTHOR" Alejandro Garrido Mota . .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (c) 2007 Alejandro Garrido Mota. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \s-1LICENSE\s0 file included with this module. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP The full text of the license can be found in the \s-1LICENSE\s0 file included with this module.