The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Config::Eggdrop::Userfile - parse userfiles generated by Eggdrop

SYNOPSIS

If you want to read from a file handle, you can use something like this:

  use Config::Eggdrop::Userfile;
  open my $fh, '<', '/path/to/eggdrop/userfile';
  my $parsed = Config::Eggdrop::Userfile::parse_file $fh;

Or, provided that you have a userfile read into $content, you can read from a string:

  use Config::Eggdrop::Userfile;
  my $parsed = Config::Eggdrop::Userfile::parse_string $content;

DESCRIPTION

This is a fairly simple regex-based parser module for Eggdrop userfiles. Eggdrop userfiles contain information (including passwords) about eggdrop partyline user accounts.

Functions

These functions are in @EXPORT_OK.

parse_file()

Parses a file from a file handle and returns a hashref with the following layout:

   {
      'botnetnick' => 'foo', # eggdrop nickname as mentioned in the comment in line 1
      'invites' => { # invites configured in the bot
          '#foo' => [...],
          '#bar' => [...],
          'global' => [...]
      },
      'version' => 'v1.6.21', # eggdrop version
      'bans' => { # bans configured in the bot
          '#foo' => [...],
          '#bar' => [...]
      },
      'lines' => 25, # number of lines in this user file
      'exempts' => { # ban exempts configured in the bot
          '#foo' => [...],
          'global' => [ # global exempts (on all channels)
               {
                  'hostmask' => '*!something@something', # exempt hostmask
                  'creator' => 'someone', # handle of the person who created this exempt
                  'sticky' => 1, # sticky exempt?
                  'reason' => 'paranoia',
                  'last' => 1366930011,
                  'expire' => 0,
                  'perm' => 1 # permanent exempt?
               },
               ...
          ],
          ...
      },
      'users' => {
          'somebody' => { # eggdrop handle as lowercase
              'case' => 'SomeBodY', # correct case of the handle as stored in the user file
              'created' => 1356108279,
              'hosts' => [
                  '*!*@example.com',
                  ...
              ],
              'pass' => 'encrypted password',
              'channels' => {
                  '#foo' => {
                       'flags' => 'lo', # channel flags
                       'laston' => 1367584282 # when were they last on this channel
                  },
                  ...
              },
              'flags' => '', # global flags
              'laston' => {
                      'time' => 1367584282, # global laston time
                      'channel' => '#foo' # on which channel were they seen?
              }
          },
      }
   };

Depending on the entries present in the user file, some of these indexes may be undefined.

parse_string()

Does the same, but takes its input from a string

AUTHOR

Moritz Wilhelmy <mw@barfooze.de>

SEE ALSO

Authen::Passphrase::EggdropBlowfish for authenticating against Eggdrop passwords.

COPYRIGHT

Copyright © 2013-2015 by Moritz Wilhelmy

This module may be copied and distributed under the same terms as perl 5 itself.

DEVELOPMENT

See the development homepage at https://bitbucket.org/wilhelmy/p5-config-eggdrop-userfile/ for recent changes.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 353:

Non-ASCII character seen before =encoding in '©'. Assuming UTF-8