From a079fa409a73daae8465928b8855268a40c9b17c Mon Sep 17 00:00:00 2001 From: octo Date: Sat, 16 Apr 2005 08:38:01 +0000 Subject: [PATCH] Added configuration options to pod in Onis::Users Added configuration options to pod in Onis::Data::Core --- lib/Onis/Data/Core.pm | 60 ++++++++++++++++++++++++++++++++++++++++++++------- lib/Onis/Users.pm | 14 +++++++++++- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/lib/Onis/Data/Core.pm b/lib/Onis/Data/Core.pm index 0eb9230..d1e3fef 100644 --- a/lib/Onis/Data/Core.pm +++ b/lib/Onis/Data/Core.pm @@ -58,6 +58,45 @@ our %NickToNick = (); our %NickToIdent = (); our %IdentToNick = (); +=head1 CONFIGURATION OPTIONS + +=over 4 + +=item B: I; + +Sets the amount of unsharping onis should do. Valid options are I, +I, I and I. + +=over 4 + +=item I + +does not do any unsharping. + +=item I + +Leaves IP-addresses as they are. The deepest subdomains containing numbers have +those numbers removed. So C becomes +C. + +=item I + +Removes the last byte from IP-adresses. So C<84.56.107.131> becomes +C<84.56.107.*>. Hostnames have the deepest subdomains removed if they contain +numers, so C becomes C<*.arcor-ip.net> while +C is not modified. This is the default and recommended +behavior. + +=item I + +Handles IP-addresses as I. Hostnames have all subdomains removed, so +C becomes C<*.t-dialin.net> and C +becomes C<*.franken.de>. + +=back + +=cut + our $UNSHARP = 'MEDIUM'; if (get_config ('unsharp')) { @@ -78,11 +117,19 @@ if (get_config ('unsharp')) } } +=item B: I; + +Sets the name of the channel. This is mostly automatically figured out, use +this if onis doesn't get it right or you want another name.. + +=back + +=cut + # TODO # - lastrun -# - total lines -my $VERSION = '$Id: Core.pm,v 1.14 2004/10/31 15:00:32 octo Exp $'; +my $VERSION = '$Id$'; print STDERR $/, __FILE__, ": $VERSION" if ($::DEBUG); return (1); @@ -224,8 +271,6 @@ Takes an ident (i.e. a user-host-pair, e.g. I or I) and "unsharps it". The unsharp version is then returned. -What unsharp exactly does is described in the F. - =cut sub unsharp @@ -515,8 +560,7 @@ Returns the name of the channel we're generating stats for. sub get_channel { - my $chan = '#unknown' - ; + my $chan = '#unknown'; if (get_config ('channel')) { $chan = get_config ('channel'); @@ -537,9 +581,9 @@ sub get_channel } # Fix network-safe channel named (RFC 2811) - if ($chan =~ m/^![A-Z0-9]{5}.+/) + if ($chan =~ m/^![A-Z0-9]{5}(.+)/) { - $chan =~ s/[A-Z0-9]{5}//; + $chan = '!' . $1; } return ($chan); diff --git a/lib/Onis/Users.pm b/lib/Onis/Users.pm index 89c6caa..8699be7 100644 --- a/lib/Onis/Users.pm +++ b/lib/Onis/Users.pm @@ -45,13 +45,25 @@ our $IdentToName = {}; our $NameToIdent = {}; -my $VERSION = '$Id: Users.pm,v 1.2 2004/08/01 13:45:27 octo Exp $'; +my $VERSION = '$Id$'; print STDERR $/, __FILE__, ": $VERSION" if ($::DEBUG); read_config (); return (1); +=head1 CONFIGURATION OPTIONS + +=over 4 + +=item B: I; + +Sets the file from which to read the user configuration. + +=back + +=cut + sub read_config { my $config_file = 'users.conf'; -- 2.11.0