#!/usr/bin/perl ####################################################### # Locked Area Lite Version 3.2 Linux Stable # http://www.lockedarea.com/ # Originally Released: 1st September 1999 (v1.0) # Latest Release: 8th June 2003 (v3.2) ####################################################### # # COPYRIGHT NOTE: # Locked Area Lite may be used and modified by anyone so # long as they have a fully registered copy and this # copyright notice and the comments above remain intact. # By using this code you agree to indemnify Neil Skirrow # and LockedArea.com from any liability that might arise # from its use. Selling the code for this program without # prior written consent is expressly forbidden. In other # words, please ask first before you try and make money # off of our program. Obtain permission before # redistributing this software over the Internet or in # any other medium. In all cases copyright and header # must remain intact. We cannot be held responsible # for any harm this may cause. # ####################################################### use CGI qw(:standard); # Calls CGI.pm Library $query = new CGI; use Fcntl qw(:flock); # Calls File Locking Library ####################################################### # The above three lines are essential to the script, if # they are causing you an error, you don't have the # required modules to use Locked Area Lite v3.2 Linux. # Contact your web host and ask them to install them as # they are essential modules. ####################################################### # THIS FILE REQUIRES NO MANUAL MODIFICATION TO BE USED # WITH THE EXCEPTION OF THE PATH TO PERL ON THE TOP # LINE OTHERWISE ALL CONFIGURATION IS DONE FROM THE # ADMIN PANEL. ####################################################### require "variables.pl"; # Go and get the variables. print "Content-type: text/html\n\n"; $admin_main = $query->param('admin_main'); &admin_main if ($admin_main && $ENV{'REQUEST_METHOD'} eq "POST"); $remove_user = $query->param('remove_user'); &remove_user if ($remove_user && $ENV{'REQUEST_METHOD'} eq "POST"); $add_user = $query->param('add_user'); &add_user if ($add_user && $ENV{'REQUEST_METHOD'} eq "POST"); $update_config = $query->param('update_config'); &update_config if ($update_config && $ENV{'REQUEST_METHOD'} eq "POST"); $send_email = $query->param('send_email'); if ($send_email && $ENV{'REQUEST_METHOD'} eq "POST") { $subject = $query->param('subject'); $content = $query->param('content'); $footer = $query->param('footer'); &send_email($adminmail,$membersdb,$subject,$content,$footer,$mailprog); } &actions if ($ENV{'QUERY_STRING'}); &print_login if ($ENV{'REQUEST_METHOD'} eq "GET"); sub actions { my $enc_password = param("p"); my $action = param("a"); if ($enc_password eq $adminpassword) { if ($action eq "list") { &admin_list; } elsif ($action eq "remove") { &admin_remove; } elsif ($action eq "add") { &admin_add; } elsif ($action eq "email") { &admin_email; } elsif ($action eq "config") { &admin_config; } elsif ($action eq "main") { &admin_main2; } elsif ($action eq "stats") { &stats; } elsif ($action eq "stats_s") { &stats_s; } elsif ($action eq "stats_l") { &stats_l; } elsif ($action eq "stats_b") { &stats_b; } elsif ($action eq "stats_u") { &stats_u; } elsif ($action eq "stats_a") { &stats_a; } elsif ($action eq "stats_r") { &stats_r; } elsif ($action eq "stats_i") { &stats_i; } else { &print_login; } } else { &admin_login_failed; } } sub admin_list { my $enc_password = param("p"); &count_users; $font = ""; $efont = ""; &header; print "Top: List All Users
Currently $user_count Registered Members

\n"; print "\n"; $printnum="0"; my $start = param("n"); unless ($start) { $start="0"; } $records=$show_records; $records=$records-1; $finish=$start+$records; open (DATA, "$membersdb") || warn "Locked Area Error: Cannot open database file: $!"; @indata = ; close (DATA); foreach $entries (@indata){ ($name, $email, $username, $password, $extra, $date) = split(/\|/, $entries); if (("$printnum" <= "$finish") && ("$printnum" >= "$start")) { print "\n"; } $printnum++; } $finish1 = $finish+1; $finish2 = $start-$records-1; print qq~
$font Name $efont$font Email $efont$font Username $efont$font $extra_field_name $efont$font Date $efont
$font $name $efont$font $email $efont$font $username $efont$font"; if ($extra_url ne "1") { print " $extra "; } else { print " $extra "; } print "$efont$font $date $efont

~; if ($finish2 ge 0) { print qq~ Previous $show_records Records ~; } if (($finish2 ge 0) && ($printnum gt $finish1)) { print " | \n"; } if ($printnum gt $finish1) { print qq~ Next $show_records Records ~; } print qq~

  Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub admin_add { my $enc_password = param("p"); &header; print qq~ Top: Add New Account
To add a new account to your member's area, please complete the below form.
This form has the same entry requirements as locked.cgi, all fields are required with the exception of the extra custom field if it has been set as optional. A welcome email will be sent when your click 'Create Account'.

Username:
Password:
Confirm Password:
Email Address:
Full Name:
$extra_field_name:
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub add_user { $username = $query->param('username'); $password = $query->param('password'); $password2 = $query->param('password2'); $email1 = $query->param('email'); $name = $query->param('name'); $extra1 = $query->param('extra'); $enc_password = $query->param('admin_password'); if ($enc_password eq $adminpassword) { $password1=$password; $usernameok = $username if (length($username) > 6); $passwordok = $password if (($password eq $password2) && (length($password) > 6)); $emailok = $email1; if ($extra_url eq "1") { $extra = $extra1 if (substr($extra1,0,7) eq 'http://'); # URL validation check if wanted. } else { $extra = $extra1 } # This checks all fields have been filled in. if ($extra_required eq "1") { unless ($usernameok && $passwordok && $emailok && $name && $extra) { &header; print qq~ Top: Add New Account Error
An error occured when trying to create the account.
    ~; print "
  • Either you didn't enter a username or it was less than 6 characters in length.
    " unless ($usernameok); print "" unless ($usernameok && $emailok); print "
  • Either you didn't enter a password or it was less than 6 characters in length.
    " unless ($passwordok); print "" unless ($usernameok && $emailok); print "
  • Either you didn't enter a email address or the email address you entered didn't match your confirm email address
    " unless ($emailok); print "" unless ($emailok && $agree); print "
  • You did not enter your full name.
    " unless ($name); print "" unless ($emailok && $agree); print "
  • You did not enter your $extra_field_name.
    " unless ($extra); print qq~

Username:
Password:
Confirm Password:
Email Address:
Full Name:
$extra_field_name:
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } } else { unless ($usernameok && $passwordok && $emailok && $name) { &header; print qq~ Top: Add New Account Error
An error occured when trying to create the account.
    ~; print "
  • Either you didn't enter a username or it was less than 6 characters in length.
    " unless ($usernameok); print "" unless ($usernameok && $emailok); print "
  • Either you didn't enter a password or it was less than 6 characters in length.
    " unless ($passwordok); print "" unless ($usernameok && $emailok); print "
  • Either you didn't enter a email address or the email address you entered didn't match your confirm email address
    " unless ($emailok); print "" unless ($emailok && $agree); print "
  • You did not enter your full name.
    " unless ($name); print qq~

Username:
Password:
Confirm Password:
Email Address:
Full Name:
$extra_field_name:
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } } # This checks if email address is in correct format. if ($emailok =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $emailok !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/) { &header; print qq~ Top: Add New Account Error
An error occured when trying to create the account.
  • The email address entered was in an incorrect format and was not accepted.

Username:
Password:
Confirm Password:
Email Address:
Full Name:
$extra_field_name:
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } $usernameok =~ s/\|//g; $passwordok =~ s/\|//g; $emailok =~ s/\|//g; $name =~ s/\|//g; $extra =~ s/\|//g; $usernameok =~ s/\://g; $passwordok =~ s/\://g; # Check is email address already has account. open (DATABASEM, "$membersdb"); @wholebasem = ; close (DATABASEM); foreach $olduserm (@wholebasem) { chomp ($olduserm); # db looks like username|password|email|etc... @userm = split(/\|/, $olduserm); # check for duplicate email address in members db if ($emailok eq $userm[1]) { &header; print qq~ Top: Add New Account Error
An error occured when trying to create the account.
  • An account already exists for this email address with the username, $userm[2].

Username:
Password:
Confirm Password:
Email Address:
Full Name:
$extra_field_name:
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } # Checks for duplicate username in members db if ($usernameok eq $userm[2]) { &header; print qq~ Top: Add New Account Error
An error occured when trying to create the account.
  • An account already exists with the username you have chosen.

Username:
Password:
Confirm Password:
Email Address:
Full Name:
$extra_field_name:
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } } &get_date; # Encrypts password, opens db, locks it, writes to it, closes it. Adds user to members.db basically. $db_password = crypt($passwordok, "La"); open (DATABASE, ">>$membersdb") || warn "Locked Area Error: Cannot open database file: $!"; flock (DATABASE, LOCK_EX) || warn "Locked Area Error: Cannot flock database. $!"; print DATABASE "$name|$emailok|$usernameok|$db_password|$extra|$date\n"; close (DATABASE); # Encrypts password, opens password file, locks it, writes to it, closes it. Adds user to password file basically. $lasalt = &salt; $enc_password1 = crypt($passwordok, "$lasalt"); open (HTPASSWD, ">>$htpasswd") || warn "Locked Area Error: Cannot open htpasswd file: $!"; flock (HTPASSWD, LOCK_EX) || warn "Locked Area Error: Cannot flock htpasswd file. $!"; print HTPASSWD "$usernameok:$enc_password1\n"; close (HTPASSWD); # Send welcome email. require "mails.pl"; &header; print qq~ Top: Account Created Successfully
The account has been successfully created.

Username: $usernameok
Password: $passwordok
Email Address: $emailok
Full Name: $name
$extra_field_name: $extra

  Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } else { &admin_login_failed; } } sub admin_remove { my $enc_password = param("p"); &header; print qq~ Top: Remove Account
Please enter a username to remove that users account. This will permanantly remove the account.

Username: 
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub remove_user { $remove_username = $query->param('remove_username'); $enc_password = $query->param('admin_password'); if ($enc_password eq $adminpassword) { open (DATA, "$membersdb") || warn "Locked Area Error: Cannot open database file: $!"; @indata = ; close (DATA); foreach $entries (@indata){ ($name, $email, $username, $password, $extra, $date) = split(/\|/, $entries); if ($username eq $remove_username) { $found = 1; last; } } unless ($found) { &header; print qq~ Top: Account Removal Failed
Username, $user was not found in the database.
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } open (WRITEDATA, ">$membersdb") || warn "Locked Area Error: Cannot open database file: $!"; flock (WRITEDATA, LOCK_EX) || warn "Locked Area Error: Cannot flock database. $!"; foreach $memberline (@indata) { ($name, $email, $username, $password, $extra, $date) = split(/\|/, $memberline); if ($username eq $remove_username) { } else { print WRITEDATA $memberline; } } close (WRITEDATA); open (READHT, "$htpasswd"); @htpw = ; close (READHT); open (WRITEHT, ">$htpasswd") || warn "Locked Area Error: Cannot open password file: $!"; flock (WRITEHT, LOCK_EX) || warn "Locked Area Error: Cannot flock password file. $!"; foreach $passline (@htpw) { ($htuser, $htpass) = split(/\:/, $passline); if ($htuser eq $remove_username) { } else { print WRITEHT $passline; } } close (WRITEHT); &header; print qq~ Top: Account Removed
The following account(s) have been removed:

$remove_username Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } else { &admin_login_failed; } } sub admin_email { my $enc_password = param("p"); &header; print qq~ Top: Bulk Email Users
To send a bulk mailing to all your member's, please complete the below form and click 'Submit'. If you want to include data from the member's database in your mailing, you can do so using the following tags which may be used in the message subject, main content and footer text.
Username: <%Username%>
Full Name: <%Name%>
Email Address: <%Email%>
Custom Field, $extra_field_name: <%Extra%>
Registration Date: <%Date%>

Message Subject:
Message Content:

Footer:

When you click Submit the above message will be sent to all the email addresses in your members database.  If you receive an error from this script upon clicking Submit do not click again, if you are a member of your own member's area, check your email.  You will probably find that the emails have been sent but the server has timed out your request to use this cgi script.  If you do receive the email then all users should have, otherwise try running another mailing. If it fails repeatedly please contact your system administrator.

Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub send_email { $enc_password = $query->param('admin_password'); my ($username); my ($email); my ($name); my ($date); my ($extra); if ($enc_password eq $adminpassword) { my ($adminmail,$membersdb,$subject,$content,$footer,$mailprog) = @_; $asubject=$subject; $acontent=$content; $afooter=$footer; $email_count = 0; open (DATA, "$membersdb") || warn "Locked Area Error: Cannot open database file: $!"; @indata = ; close (DATA); foreach $entries (@indata){ $subject=$asubject; $content=$acontent; $footer=$afooter; ($name, $email, $username, $password, $extra, $date) = split(/\|/, $entries); $subject =~ s/<%Username%>/$username/g; $subject =~ s/<%Email%>/$email/g; $subject =~ s/<%Name%>/$name/g; $subject =~ s/<%Date%>/$date/g; $subject =~ s/<%Extra%>/$extra/g; $content =~ s/<%Username%>/$username/g; $content =~ s/<%Email%>/$email/g; $content =~ s/<%Name%>/$name/g; $content =~ s/<%Date%>/$date/g; $content =~ s/<%Extra%>/$extra/g; $footer =~ s/<%Username%>/$username/g; $footer =~ s/<%Email%>/$email/g; $footer =~ s/<%Name%>/$name/g; $footer =~ s/<%Date%>/$date/g; $footer =~ s/<%Extra%>/$extra/g; open (MAILEM, "|$mailprog -t") or &dienice("Can't access $mailprog!\n"); print MAILEM "To: $email\n"; print MAILEM "From: $adminmail\n"; print MAILEM "Subject: $subject\n\n"; print MAILEM qq~$content\n$footer\nUsername: $username~; close (MAILEM); $email_count++; } &header; print qq~ Top: $email_count Emails Sent
The following message has been sent:

Subject: $subject
Content:
$content
$footer

Please note, the data from the member's db you see in the above message is that of the last user to be emailed. Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } else { &admin_login_failed; } } sub admin_config { my $enc_password = param("p"); &header; print qq~ Top: Configuration

~; if ($extra_url eq "1"){ print "\n"; } else { print "\n"; } print qq~ ~; if ($extra_required eq "1"){ print "\n"; } else { print "\n"; } print qq~ ~; if ($newmemberemail eq "1"){ print "\n"; } else { print "\n"; } print qq~ ~; if ($removeemail eq "1"){ print "\n"; } else { print "\n"; } print qq~ ~; if ($login_style eq "1"){ print "\n"; } else { print "\n"; } print qq~ ~; if ($signup_status eq "Online"){ print "\n"; } else { print "\n"; } print qq~
Member's Area Name:
The name of your member's area.
e.g. LockedArea.com Member's Area.
Members Database:
The location of your members database.  It must be a full path and must end with a filename.
e.g. /home/username/dir/members.db
Password File:
The location of your password file for use with your .htaccess file.  It's recommended you call this .htpasswd.  You must enter a full path that ends with a filename.
e.g. /home/username/members/.htpasswd
Htaccess File:
The location of your .htaccess file.  This must be in your member's area directory.  You must enter a full path that ends with a filename.
e.g. /home/username/members/.htaccess
Extra Field Name:
The last field on the locked.cgi registration form is optional.  It doesn't have to be a URL field if you don't want it to be.  Please enter the name for this field.
e.g. Occupation or Comments.
Extra Field URL?
Do you wish to use the extra field in the locked.cgi registration form to record URLs?  If so, tick this and all entries will be verified as starting with http://. If you wish to use the url format checking you must set the field as required below.
Extra Field Required?
Do you want the extra field to be required? This means during registration, the registra must enter a value for this field.  If so, please select/tick the below tickbox. You must select this option if you wish to use the url format checking.
Mail Program:
The location of sendmail on your web server.
e.g. /usr/sbin/sendmail
New Member Email:
Do you wish to be notified by email every time a user registers?  Tick for yes.
User Remove Email:
Do you wish to be notified every time a user deletes their account?  Tick for yes.
Admin Name:
The name of the administrator for your member's area.  This name is included in all outgoing email.
Admin Email Address:
The email address of the administrator.  This email address is used as the sender of all email sent by this script. YOU MUST PUT A \ BEFORE THE \@ SIGN!
e.g. you\@yourname.com
Administrator Password:
If you do not wish to change your password, leave this field blank.  If you wish to change it enter your new password here.
Records to List:
When listing all accounts in the 'List Users' section of the admin panel, how many records would you like to view per/page?
Images URL:
The URL to the directory with the Locked Area Lite images in.  You must enter a full URL but do not end it with a trailing slash.
e.g. http://www.yourdomain.com/images
CGI-Bin URL:
The URL to the directory with the Locked Area Lite cgi script in.  You must enter a full URL but do not end it with a trailing slash.
e.g. http://www.yourdomain.com/cgi-bin/la
Members Area URL:
The URL to your member's area.  Do not start it with http:// (miss that part off) but you can end it with a trailing slash or filename if you wish.
e.g. www.yourdomain.com/members/index.html
Terms and Conditions:
The terms and conditions displayed on your registration page.  You may use HTML tags.

Table Header Colour:
The colour used for the headers in locked.cgi.  i.e. the top bar that is grey by default.
Table Main Colour:
The colour used for the main tables in locked.cgi.
i.e. the cells with forms in.
Font Face:
The font face used for body text.
Font Colour:
The font colour used for body text.
Font Size:
The font size used for body text.
Font Note Size:
The font size used to display small note text.  Not used very much, it's best to set one size smaller than standard font size.
Font Header Face:
The font face used for the text in the top header.
Font Header Size:
The font face used for the text in the top header.
Font Header Colour:
The font colour user for the text in the top header.
Login.cgi Style/Version:
Which version of Locked Area Lite login.cgi do you wish to run, version 1 or 2. If Version 1 fails or causes a the pop-up window to appear after entering correct login details, try Version 2.
Signup Status:
Do you want the registration form to be open to new registrations?  Tick for online/yes.

Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub update_config { $enc_password = $query->param('enc_password'); $sitename = $query->param('sitename'); $membersdb = $query->param('membersdb'); $htpasswd = $query->param('htpasswd'); $htaccess = $query->param('htaccess'); $extra_field_name = $query->param('extra_field_name'); $extra_url = $query->param('extra_url'); $extra_required = $query->param('extra_required'); $mailprog = $query->param('mailprog'); $newmemberemail = $query->param('newmemberemail'); $removemail = $query->param('removeemail'); $adminname = $query->param('adminname'); $adminmail = $query->param('adminmail'); $adminpassword1 = $query->param('adminpassword'); $imageurl = $query->param('imageurl'); $cgiurl = $query->param('cgiurl'); $membersurl = $query->param('membersurl'); $tbheadercolor = $query->param('tbheadercolor'); $tbmaincolor = $query->param('tbmaincolor'); $fontface = $query->param('fontface'); $fontcolor = $query->param('fontcolor'); $fontsize = $query->param('fontsize'); $fontnotesize = $query->param('fontnotesize'); $fontheaderface = $query->param('fontheaderface'); $fontheadersize = $query->param('fontheadersize'); $fontheadercolor = $query->param('fontheadercolor'); $terms = $query->param('terms'); $show_records = $query->param('show_records'); $signup_status = $query->param('signup_status'); $login_style = $query->param('login_style'); if ($adminpassword1 ne "") { $adminpassword1 = crypt($adminpassword1, "La"); } else { $adminpassword1 = $adminpassword; } if ($extra_url eq "") { $extra_url = 0; } else { $extra_url = $extra_url; } if ($extra_required eq "") { $extra_required = 0; } else { $extra_required = $extra_required; } if ($newmemberemail eq "") { $newmemberemail = 0; } else { $newmemberemail = $newmemberemail; } if ($removemail eq "") { $removemail = 0; } else { $removemail = $removemail; } if ($show_records eq "") { $signup_status = 25; } if ($signup_status eq "") { $signup_status = 0; } else { $signup_status = $signup_status; } if ($enc_password eq $adminpassword) { open (CON, ">variables.pl") || warn "Locked Area Error: Cannot open variables.pl file: $!"; flock (CON, LOCK_EX) || warn "Locked Area Error: Cannot flock variables.pl. $!"; print CON "# Variables.pl File. Best not to touch this.\n"; print CON "\$sitename = \"$sitename\";\n"; print CON "\$membersdb = \"$membersdb\";\n"; print CON "\$htpasswd = \"$htpasswd\";\n"; print CON "\$htaccess = \"$htaccess\";\n"; print CON "\$extra_field_name = \"$extra_field_name\";\n"; print CON "\$extra_url = \"$extra_url\";\n"; print CON "\$extra_required = \"$extra_required\";\n"; print CON "\$mailprog = \"$mailprog\";\n"; print CON "\$newmemberemail = \"$newmemberemail\";\n"; print CON "\$removeemail = \"$removemail\";\n"; print CON "\$adminname = \"$adminname\";\n"; print CON "\$adminmail = '$adminmail';\n"; print CON "\$adminpassword = \"$adminpassword1\";\n"; print CON "\$imageurl = \"$imageurl\";\n"; print CON "\$cgiurl = \"$cgiurl\";\n"; print CON "\$membersurl = \"$membersurl\";\n"; print CON "\$tbheadercolor = \"$tbheadercolor\";\n"; print CON "\$tbmaincolor = \"$tbmaincolor\";\n"; print CON "\$fontface = \"$fontface\";\n"; print CON "\$fontcolor = \"$fontcolor\";\n"; print CON "\$fontsize = \"$fontsize\";\n"; print CON "\$fontnotesize = \"$fontnotesize\";\n"; print CON "\$fontheaderface = \"$fontheaderface\";\n"; print CON "\$fontheadersize = \"$fontheadersize\";\n"; print CON "\$fontheadercolor = \"$fontheadercolor\";\n"; print CON "\$terms = qq~\n$terms\n~;\n"; print CON "\$show_records = \"$show_records\";\n"; print CON "\$signup_status = \"$signup_status\";\n"; print CON "\$login_style = \"$login_style\";\n"; print CON "1;\n"; close (CON); &header; print qq~ Top: Configuration Updated
Your configuration file has now been updated. Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } else { &admin_login_failed; } } sub stats { my $enc_password = param("p"); &call_stats; &header; print qq~ Top: Statistics
Notice:
If your statistics are blank it's because you're not calling logger.cgi from your member's area html using SSI tags! Please read below:

logger.cgi is a simple little script that will display a Welcome [username] message when loaded into the member's area using SSI tags.  It also records details about the visitor to a log file.  This log file can be read here in the administration panel.
To call logger.cgi into your member's area html just place the following tag anywhere in your member's area html.

<!--#exec cgi="/cgi-bin/logger.cgi"-->

If you didn't install the scripts into your cgi-bin, just modify the path.  You must use a relative url.  e.g. /dir/dir/logger.cgi or /cgi-bin/logger.cgi, not a full path or url.  You may find that you need to use the extension .shtml to use SSI tags in your html.  If you're not sure, contact your system administrator or have a look at your web host's FAQ page, most good hosts have them.

Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_s { my $enc_password = param("p"); &call_stats; &header; print "
\n"; print "\n"; print "\n"; foreach $element (sort {$dates{$b} <=> $dates{$a}} keys %dates) { $dpercent = sprintf("%2.1f",100*$dates{$element}/$numofrecs); print "\n"; } $avg = sprintf("%2.1f",$numofrecs/(scalar (keys %dates))); print "\n"; print qq~

All Dates
%QtyDate
$dpercent\%$dates{$element}$element
Average Number of Accesses per Day:$avg
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_l { my $enc_password = param("p"); &call_stats; &header; print "
\n"; print "\n"; print "\n"; foreach $element (sort {$usernames{$b} <=> $usernames{$a}} keys %usernames) { if ($usernames{$element} > $leachnum) { print "\n"; } } print qq~
Suspected Leechers
AccessesUsername
$usernames{$element}$element
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_b { my $enc_password = param("p"); &call_stats; &header; print "
\n"; $count = 0; print "\n"; print "\n"; foreach $element (sort {$browsers{$b} <=> $browsers{$a}} keys %browsers) { $count++; break if ($count > 10); $bpercent = sprintf("%2.1f",100*$browsers{$element}/$numofrecs); print "\n"; } print qq~

Browsers
Rank%QtyBrowser
$count$bpercent\%$browsers{$element}$element
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_u { my $enc_password = param("p"); &call_stats; &header; print "
\n"; $count = 0; print "\n"; print "\n"; foreach $element (sort {$usernames{$b} <=> $usernames{$a}} keys %usernames) { $count++; break if ($count > 10); $upercent = sprintf("%2.1f",100*$usernames{$element}/$numofrecs); print "\n"; } print qq~
Users
Rank%QtyUsername
$count$upercent\%$usernames{$element}$element
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_a { my $enc_password = param("p"); &call_stats; &header; print "This features lists all the ips, browsers etc that have been logged. It may take a while to load!!\n"; print "
\n"; print "\n"; print "\n"; foreach $element (sort {$usernames{$b} <=> $usernames{$a}} keys %usernames) { $upercent = sprintf("%2.1f",100*$usernames{$element}/$numofrecs); print "\n"; } print "
All Users
%QtyUsername
$upercent\%$usernames{$element}$element
"; print "
\n"; print "\n"; print "\n"; foreach $element (sort {$ips{$b} <=> $ips{$a}} keys %ips) { $ipercent = sprintf("%2.1f",100*$ips{$element}/$numofrecs); print "\n"; } print "

All IP Addresses
%QtyIP
$ipercent\%$ips{$element}$element
"; print "
\n"; print "\n"; print "\n"; foreach $element (sort {$referrers{$b} <=> $referrers{$a}} keys %referrers) { $rpercent = sprintf("%2.1f",100*$referrers{$element}/$numofrecs); print "\n"; } print "

All Referrers
%QtyURL
$rpercent\%$referrers{$element}$element
"; print "
\n"; print "\n"; print "\n"; foreach $element (sort {$browsers{$b} <=> $browsers{$a}} keys %browsers) { $bpercent = sprintf("%2.1f",100*$browsers{$element}/$numofrecs); print "\n"; } print qq~

All Browsers
%QtyBrowser
$bpercent\%$browsers{$element}$element
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_r { my $enc_password = param("p"); &call_stats; &header; print "
\n"; $count = 0; print "\n"; print "\n"; foreach $element (sort {$referrers{$b} <=> $referrers{$a}} keys %referrers) { $count++; break if ($count > 10); $rpercent = sprintf("%2.1f",100*$referrers{$element}/$numofrecs); print "\n"; } print qq~

Referrers
Rank%QtyURL
$count$rpercent\%$referrers{$element}$element
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub stats_i { my $enc_password = param("p"); &call_stats; &header; print "
\n"; $count = 0; print "\n"; print "\n"; foreach $element (sort {$ips{$b} <=> $ips{$a}} keys %ips) { $count++; break if ($count > 10); $ipercent = sprintf("%2.1f",100*$ips{$element}/$numofrecs); print "\n"; } print qq~

IP Addresses
Rank%QtyIP
$count$ipercent\%$ips{$element}$element
Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub admin_main { $admin_password = $query->param('admin_password'); $enc_password = crypt($admin_password, "La"); if ($enc_password eq $adminpassword) { print qq~ Locked Area Lite v3.2 Linux Stable Administration Panel Please wait while we redirect you to the admininistration panel.
If you are not redirected in the next 5 seconds, please click here. ~; } else { &admin_login_failed; } } sub admin_main2 { my $enc_password = param("p"); $uptime = `uptime`; &count_users; &header; print qq~
Welcome to the Locked Area Lite v3.2 Linux Stable Administration Panel.  From here you can manage your member's area and it's member's.  To begin please select a link from the left select menu.
Member's Area Information
Current Member's:$user_count
Signup Form Status:$signup_status

Locked Area Lite Details
Version No.3.2 Linux Stable
Latest Version:

Rate Locked Area Lite
HotScripts.com
The CGI Resource Index

10 - Great / 0 - Poor
Select Menu
Main
List Users
Add New User
Delete Users
Bulk Email
Statistics

Configuration
My Member's Area

LockedArea.com
Member's Area
Support Forum
Add-Ons

Main : List Users : Add User : Delete Users : Bulk Email : Configuration : Statistics : My Member's Area ~; &footer; exit; } sub print_login { print qq~ Locked Area Lite v3.2 Administration Panel
Locked Area Lite v3.2 Linux Stable
To login to the Locked Area Lite v3.2 Administration Panel, please enter your password below and click login. Please note, all failed attempts are logged.
 

Password:

Powered by Locked Area Lite v3.2 Linux Stable, a product of LockedArea.com.
Copyright © 1999 - 2003 Neil Skirrow and LockedArea.com, All Rights Reserved.

 

 

~; exit; } sub admin_login_failed { $password = $query->param('admin_password'); $time = localtime(time); $ip = $ENV{'REMOTE_ADDR'}; $ref = $ENV{'HTTP_REFERER'}; $browser = $ENV{'HTTP_USER_AGENT'}; open (DATABASE, ">>failed_logins.log") || warn "Locked Area Error: Cannot open failed logins log file: $!"; flock (DATABASE, LOCK_EX) || warn "Locked Area Error: Cannot flock failed logins log. $!"; print DATABASE "$ip|$ref|$browser|$password|$time\n"; close (DATABASE); print qq~ Locked Area Lite v3.2 Administration Panel
Locked Area Lite v3.2 Linux Stable
The password you tried to login with was incorrect, please feel free to try again but note, all failed attempts are logged as was this failed attempt.
 

Password:

Powered by Locked Area Lite v3.2 Linux Stable, a product of LockedArea.com.
Copyright © 1999 - 2003 Neil Skirrow and LockedArea.com, All Rights Reserved.

 

 

~; exit; } sub call_stats { if (-e "userlog.txt") { open(FILE, "userlog.txt") || warn "Locked Area Error Can't open user log: $!"; @buffer = ; close(FILE); $numofrecs = 0; foreach $element (@buffer) { $numofrecs++; ($u,$i,$r,$b,$d) = split(/\|/, $element); ($x,$m,$w,$t,$y) = split(/\ /, $d); $usernames{$u}++; $ips{$i}++; $referrers{$r}++; $browsers{$b}++; $dates{$w."-".$m."-".$y}++; } } else { &header; print "Unable to read userlog.txt file.\n"; &footer; exit; } } sub count_users { $user_count="0"; open (UC, "$membersdb") || warn "Locked Area Error: Cannot open database file: $!"; @uc =; close (UC); foreach $uc (@uc) { $user_count++; } } # Generates random salt. sub salt { my ($maxlen) = $_[0] || 2; my (@vowel) = (qw (a a 2 e e e 3 i i i o o o u u 6 ai au ay ea ee eu ia ie io oa oi oo oy)); my (@consonant) = (qw (b c d f 2 h j k l m 6 p qu 8 s t v w x 9 th st sh ph ng nd)); my ($salt) = ""; srand; my ($vowelnext) = int(rand(2)); # Initialise to 0 or 1 (ie true or false) do { if ($vowelnext) { $salt .= $vowel[rand(@vowel)]; } else { $salt .= $consonant[rand(@consonant)]; } $vowelnext = !$vowelnext; } until length($salt) >= $maxlen; return $salt; } # Generates the date for database use specifically. sub get_date { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); @months = ("01","02","03","04","05","06","07","08","09","10","11","12"); @digits = split(//,$sec); $size = @digits; if ($size == 1) { $sec = "0$sec"; } @digits = split(//,$min); $size = @digits; if ($size == 1) { $min = "0$min"; } $year=$year+1900; @digits = split(//,$mday); $size = @digits; if ($size == 1) { $mday = "0$mday"; } $date = "@months[$mon]/$mday/$year"; } sub header { # Please do not remove the below. It causes no harm to you. print qq~ Locked Area Lite v3.2 Linux Stable Administration Panel
 
~; } sub footer { # The below copyright notice may not be modified in anyway! It is too remain at all times and be visible in all HTML generated by Locked Area Lite. print qq~
Locked Area Lite v3.2 Linux Stable Locked Area Lite for Linux

Powered by Locked Area Lite v3.2 Linux Stable, a product of LockedArea.com.
Copyright © 1999 - 2003 Neil Skirrow and LockedArea.com, All Rights Reserved.

 

 

~; # The above copyright notice may not be modified in anyway! It is too remain at all times and be visible in all HTML generated by Locked Area Lite. # Removing the copyright note, text and link back is a criminal offence and a breech of the contract you have with LockedArea.com. Doing so will result in legal action! }