# NOTE NOT PASTING FULL CODE JUST RELEVANT PARTS #module Gatekeeper allows for a standard password and user #access method for PUCK access. package Gatekeeper; use DBI; use Digest::MD5 qw(md5_hex); #time to lock out users who have failed login 3 times #in seconds my $lockout_time = 180; #number of attempts before system locks users out my $max_failed_login_attempts = 3; #html error strings that are used for creating blocked login #pages for the end user to see my $login_blocked = " Login Blocked please wait 3 minutes and try again<\/font>"; my $username_malformed = " Re-enter username<\/font>"; my $password_malformed = " Re-enter password<\/font>"; my $username_invalid = " Username not found<\/font>"; my $password_invalid = " Password not found<\/font>"; my $password_blank = " Please enter password<\/font>"; my $username_blank = " Please enter username<\/font>"; #constructor sub new { my $self = {}; $self->{user_id} = undef; $self->{login_valid} = undef; $self->{error_type} = undef; $self->{html_error_string } = undef; bless( $self ); return( $self ); } sub get_html_error_string { my $self = shift; return( $self->{html_error_string} ); } sub get_error_type { my $self = shift; return( $self->{error_type} ); } sub get_password_valid { my $self = shift; return( $self->{login_valid} ); } sub get_user_id { my $self = shift; return( $self->{user_id} ); }