NAME

Auth.pm - A module to handle sessions for IRC::Bot.

SYNOPSIS

use IRC::Bot::Auth
my $seen = IRC::Bot::Auth->new();

# later on...

# Check to see if $nick has existing session
sub on_public {
  my ( $kernel, $who, $where, $msg ) = @_[ KERNEL, ARG0, ARG1, ARG2 ];
  my $nick = ( split /!/, $who )[0];

  # Do Stuff...

  my $check = $auth->is_auth( $nick );
  if ( $check != 1 ) {
      # Do stuff...
  }
  else {
      # Denied
  }

}

DESCRIPTION

Provides session handling for IRC::Bot.

METHODS

  1. is_auth() takes one argument, users nick, and checks to see if they are authed. Returns 0 if authed, 1 if otherwise.

    Use like so:

    my $check = $auth->is_auth( $nick );
  2. get_ses() takes a nickname as an argument. Checks to see if user is authed and returns data from session.

    Use like so:

    $auth->get_ses( $nick );
  3. auth_set() Sets users session. Takes a nick for an argument, sets session time at one hour.

    Use like so:

    $auth->auth_set( $nick );
  4. de_auth() clears the session, takes a nick for an argument.

    Use like so:

    $auth->de_auth( $nick );

AUTHOR

Benjamin Smith (DeFyance) defyance@just-another.net

SEE ALSO

POE::Component::IRC Cache::FileCache