#!/usr/bin/perl ############################################################### # index.cgi - AutoGuestbook_db v2.52 - released 12/16/99 # # This script runs a guestbook on your site. # This script by Anatoli Vichniakov - copyright 1998. # ############################################################### # CONFIGURATION SECTION ############################################################### # Path to directory. $datapath = '/var/www/html/sc/gb'; # This is the URL version of the path above. $dataurl = 'http://www.shieldcam.com/gb'; # Password to access log file. $password = 'willchange'; # The name of database file. # You may rename before go on public. $datafile = 'datafile.txt'; # This is a log file. # You may rename before go on public. $log_file = 'guestlog.html'; # This is a ban list file containing IPs of banned users. # You may rename before go on public. $ban_file = 'banlist.txt'; # Write to log file. $uselog = 'yes'; # If you want the full log set if to 'yes'. $fullog = 'yes'; # Maximum number of records to show on the guestbook main page. $max_records = 5; # After initial testing, set this to 'yes', # if your server allows file locking, this will reduce errors. $lockon = 'no'; # This is the adjustment to your displayed hour. $timefix = 0; # This is the time zone of your displayed time. $zone = 'ET'; # Location of e-mail program. $mail_program = '/usr/sbin/sendmail'; # Set to 'yes', if you want to get notification via e-mail. $notification = 'yes'; # E-mail where to send notification. $sitemail = 'hanse@shieldcam.com'; # Subject that would be sent to webmaster with new posting. $subject_notify = 'You have new entry to Guestbook'; # Set to 'yes', if you want to send e-mail to user who posted the message. $remote_mail = 'no'; # Subject that would be sent to user after posting. $subject_mail_user = 'Automatic response from Guestbook on Amnesia.net. Here is what you posted in our Guestbook.'; # First(main) page template file. $guestbook_template = 'template/guestbook.txt'; # Add record template file. $adrecord_template = 'template/adrecord.txt'; # Format message template file. $message_template = 'template/message.txt'; # Preview template file $preview_template = 'template/prrecord.txt'; # Edit message template file. $remtext_template = 'template/remtext.txt'; # Search template file. $search_template = 'template/search.txt'; # This is the name of template file containing the page for banned guests. $exitban_template = 'template/exitban.txt'; ################## guestbook archive service ################### # A number of records to show on the archive page. $records_archive = 9999; # Archive page template file. $archive_template = 'template/archive.txt'; ################### guestbook e-mail service #################### # Set to 'yes' if you want to enable e-mail service. $mail_service = 'yes'; # Subject in the e-mail form. $subject = 'Everyday Demo guestbook e-mail service at Amnesia.net'; # Time interval between e-mail sendings(sec.*min.*hours*days). $mail_time = 60*60*24; # Mail List Service config file. $mailservice = 'mservice.txt'; # This is a file containing users e-mail addresses. # You may rename before go on public. $mail_list = 'maillist.txt'; # E-mail subject template file. $mail_subject = 'template/mailsubj.txt'; # E-mail list body template file. $mailrec_template = 'template/mailrec.txt'; # If no function entry template file. $no_function_template = 'template/noregfun.txt'; # If no name or e-mail entry template file. $no_register_template = 'template/noregist.txt'; # Successful addition to mailing list template file. $add_to_list = 'template/adtolist.txt'; # Successful addition to mailing list html template file. $add_user = 'template/useraded.txt'; # Successful removal from mailing list template file. $remove_from_list = 'template/remvlist.txt'; # Successful removal from mailing list html template file. $remove_user = 'template/userremv.txt'; # END OF CONFIGURATION. ############################################################### # OPTIONS SECTION # The program can create backup copy of database file every time # e-mail list service runs. For this option you need e-mail service enabled. # Do you want backup? ('yes', 'no') $backup = 'yes'; # The name of backup file. $backupfile = 'datafile.bak'; # This is the list of naughty words, and what you want to convert them to. %badwords = (fuck => 'hug', shit => 'pudding', pecker => 'puppy', asshole => 'angel', bitch => 'nice person', cunt => 'stop watch', ' cock' => ' earlobe', 'cock!' => 'socks!', cocksucker => 'sweetheart', pussy => 'portable wishwasher', ' tit' => ' toe'); ################ define additional variables ################## # Body tag config $bodytag='
'; # END OF OPTIONS SECTION # You do not need to change anything below. ############################################################### # Load the CGI.pm module into the program use CGI qw (:standard); use CGI::Carp qw(fatalsToBrowser); $q = new CGI; # Set variables for flock function $EXCLUSIVE = 2; $UNLOCK = 8; # Get the Date for Entry $now_string = localtime; @thetime = split(/ +/,$now_string); @theclock = split(/:/,$thetime[3]); $hour = $theclock[0]; $hour += $timefix; $hour -= 24 if ($hour >= 24); $hour += 24 if ($hour < 0); $xm = ($hour > 11) ? 'pm' : 'am'; $hour = 12 if ($hour == 0); $hour -= 12 if ($hour > 12); $date_local = "$thetime[0] $thetime[1] $thetime[2] $hour:$theclock[1]$xm $zone"; ############################################################### # Get the info from the calling Web page and store the # results in the appropriate variables ############################################################### $action = $q->param(action); $post = $q->param(post); $preview = $q->param(preview); $realname = $q->param(realname); $realname = '' unless ($realname); $user_email = $q->param(user_email); $user_email = '' unless ($user_email); $user_email = '' unless ($user_email =~ /.*\@.*\..*/); $open = '<'; $open = '' unless ($user_email); $close = '>'; $close = '' unless ($user_email); $comments = $q->param(comments); $comments = '' unless ($comments); $comments =~ s/\cM//g; $comments =~ s/\n\n//g;
$comments =~ s/\n/ \ \ \ \n";
if ($error_index == 1) {
print "$email is already on the list. \n";
# Log the same e-mail.
&log('same_email') if ($uselog eq 'yes');
} elsif ($error_index == 2) {
print "Could not find $email in this list \n";
# Log can not remove - no email.
&log('no_email') if ($uselog eq 'yes');
} else {
print "Error Unknown \n";
# Log the Error Unknown.
&log('error_unknown') if ($uselog eq 'yes');
} # End of if.
print "Back\n";
print "
\
/g;
# Censor bad words
for(keys(%badwords)){
$realname =~ s/$_/$badwords{$_}/gi;
}
for(keys(%badwords)){
$user_email =~ s/$_/$badwords{$_}/gi;
}
for(keys(%badwords)){
$comments =~ s/$_/$badwords{$_}/gi;
}
###############################################################
# Check what task to execute and proceed
###############################################################
# First of all check if guest is not in the ban list.
&check_ban;
if($preview) {
# Log the error.
&log('no_name') if (($uselog eq 'yes') and (!$realname));
# Check if username exists.
&add_record("(You did not enter your Name.)", "realname") unless ($realname);
# Log the error.
&log('no_comments') if (($uselog eq 'yes') and (!$comments));
# Check if user email exists.
&add_record("(You did not enter your Text.)", "comments") unless ($comments);
# Preview the message.
&preview;
# Log the preview.
&log('preview') if (($uselog eq 'yes') and ($fullog eq 'yes'));
exit;
}
if($post) {
# Check if admin loging in.
# Log the admin access.
&log('admin_log') if (($uselog eq 'yes') and ($fullog eq 'yes') and ($realname eq $password));
&admin if ($realname eq $password);
# Log the error.
&log('no_name') if (($uselog eq 'yes') and (!$realname));
# Check if username exists.
&add_record("(You did not enter your Name.)", "realname") unless ($realname);
# Log the error.
&log('no_comments') if (($uselog eq 'yes') and (!$comments));
# Check if user email exists.
&add_record("(You did not enter your Text.)", "comments") unless ($comments);
# Preview the message.
&post;
# Remove tags.
$realname =~ s/<.*?>//g;
$comments =~ s/<.*?>//g;
# Notify webmaster.
&mail_webmaster if ($notification eq 'yes');
# Send e-mail to user.
&mail_user if (($remote_mail eq 'yes') and ($user_email));
# Log the new entry.
&log('entry') if ($uselog eq 'yes');
# Return to the main page.
print "Location: $dataurl/index.html\n\n";
exit;
}
elsif($action =~ /add_record/i){
# Add the record to database.
&add_record("(Do not forget to enter your Name and your text.)", "realname");
}
elsif($action =~ /edit_text/i){
$num_message = $q->param(num_message);
# Admin functions to edit and delete current record.
&edit_text;
exit;
}
elsif($action =~ /search_form/i){
# Get the number of pages in the archive(and open database).
&pages_in_archive;
# Load the search form.
&search_form;
# Log the search page was loaded.
&log('load_search') if (($uselog eq 'yes') and ($fullog eq 'yes'));
exit;
}
elsif($action =~ /search_database/i){
# Get the number of pages in the archive(and open database).
&pages_in_archive;
# Search function.
$search_for = $q->param('search_for');
$search_field = $q->param('search_field');
$search_for = "\." if $search_for eq "";
&search_database($search_for);
$count = @results;
if($count < 1) {
&no_match;
} else {
&multiple_match;
}
exit;
}
elsif($action =~ /remove_text/i){
$pwd = $q->param('pwd');
# Log the access denied.
&log('access_denied') if (($uselog eq 'yes') and ($pwd ne $password));
&access_denied unless ($pwd eq $password);
$search_for = $q->param('num_message');
$search_field = 'counter';
&search_database($search_for);
&delete_record;
# Log the delete entry.
&log('delete') if ($uselog eq 'yes');
exit;
}
elsif($action =~ /modify_record/i){
$pwd = $q->param('pwd');
# Log the access denied.
&log('access_denied') if (($uselog eq 'yes') and ($pwd ne $password));
&access_denied unless ($pwd eq $password);
$num_message = $q->param('num_message');
&modify_record;
# Log the edit entry.
&log('edit') if ($uselog eq 'yes');
exit;
}
elsif($action =~ /archive/i){
# Load archive.
$page = $q->param('page');
$page = 0 unless ($page);
&archive($page);
# Log the archive was loaded.
&log('load_archive') if (($uselog eq 'yes') and ($fullog eq 'yes'));
exit;
}
elsif($action =~ /addremove/i){
# Subscribe and unsubscribe to mailing list.
if ($mail_service eq 'yes') {
$addremove_choice = $q->param('addremove_choice');
$name = $q->param('name');
$email = $q->param('email');
# Check for valid e-mail address.
$email = '' unless ($email =~ /.*\@.*\..*/);
# Log the no_register_what.
&log('no_register_what') if (($uselog eq 'yes') and (!$addremove_choice) and ($fullog eq 'yes'));
&no_register_what unless $addremove_choice;
# Log the no name for register.
&log('no_register') if (($uselog eq 'yes') and (!$name) and ($fullog eq 'yes'));
&no_register unless $name;
# Log the no email for register.
&log('no_register') if (($uselog eq 'yes') and (!$email) and ($fullog eq 'yes'));
&no_register unless $email;
&add_remove;
} else {
&no_mail_service;
# Log the no_mail_service.
&log('no_mail_service') if (($uselog eq 'yes') and ($fullog eq 'yes'));
exit;
}
}
elsif($action =~ /view_log/i){
# View log file.
&view_log;
exit;
}
elsif($action =~ /clear_log/i){
# Clear log file.
&clear_log;
exit;
}
elsif($action =~ /view_ban_list/i){
# View ban file.
&view_ban_list;
exit;
}
elsif($action =~ /update_ban_list/i){
# Update ban file.
$banlist = $q->param('banlist');
&update_ban_list;
exit;
}
elsif($action =~ /view_mail_list/i){
# View mail file.
&view_mail_list;
exit;
}
elsif($action =~ /update_mail_list/i){
# Update mail file.
$maillist = $q->param('maillist');
&update_mail_list;
exit;
}
elsif($action =~ /ban_current/i){
# Ban oner of current message.
$pwd = $q->param('pwd');
# Log the access denied.
&log('access_denied') if (($uselog eq 'yes') and ($pwd ne $password));
&access_denied unless ($pwd eq $password);
$current_ip = $q->param('current_ip');
&ban_current_user;
# Log a user was banned.
&log('banned') if (($uselog eq 'yes') and ($fullog eq 'yes'));
exit;
}
elsif($action =~ /modify_database/i){
# Modify database file.
$database_size = $q->param('database_size');
# Open database file.
&open_database;
# Leave one line if request is higher or equal to number of records.
if ($database_size >= $num_lines) {
$database_size = $num_lines;
}
elsif ($database_size <= 0) {
$database_size = 0;
}
&do_modify_database;
&admin;
exit;
}
# Print the default page.
else {
# Check if it is a time to send mail list.
&mailservice if ($mail_service eq 'yes');
# Check if a database file is not empty(server error).
$database_backup = $datapath."/".$backupfile;
&check_database if (($mail_service eq 'yes') and (-e $database_backup));
# Check the time-line.
&send_maillist if (($time_to_mail < $^T) and ($mail_service eq 'yes'));
&do_backup if (($time_to_mail < $^T) and ($mail_service eq 'yes') and ($backup eq 'yes'));
# Get the number of pages in the archive(and open database).
&pages_in_archive;
&print_default;
# Log the visit.
&log('visit') if (($uselog eq 'yes') and ($fullog eq 'yes'));
exit;
}
exit;
###############################################################
# Subroutines
###############################################################
###############################################################
# Load the default page
###############################################################
sub print_default {
# Open template file.
&open_template($guestbook_template);
# Print the header of HTML file.
print $q->header;
# Write the line of HTML file.
foreach $line (@lines){
$line =~ s/\*add_record\*/$ENV{'SCRIPT_NAME'}\?action=add_record/g;
$line =~ s/\*search\*/$ENV{'SCRIPT_NAME'}\?action=search_form/g;
$line =~ s/\*load_archive\*/$ENV{'SCRIPT_NAME'}\?action=archive&page=$pages_archive/g;
$line =~ s/\*path\*/$dataurl/g;
print "$line\n";
} # End of foreach.
# Limit the $max_records if not acceptable.
if ($max_records > $num_lines) {$max_records = $num_lines}
# Print all messages from database.
for ($i = 0; $i < $max_records; $i++) {
foreach $stuff (@data[$i]) {
chomp($stuff);
($msg_counter[$i], $current_name[$i], $current_email[$i], $current_date[$i], $current_time[$i], $current_ip[$i], $current_comments[$i]) = split(/\|/,$stuff);
# Open template file to format the message.
open(DATA, "$datapath/$message_template") or die "Error opening message_template: $!\n";
@data_template = ;
close(DATA);
chomp(@data_template);
# Format the message.
foreach $data_template (@data_template){
$data_template =~ s/\*path\*/$dataurl/g;
$data_template =~ s/\*number\*/$msg_counter[$i]/g;
$data_template =~ s/\*realname\*/$current_name[$i]/g;
if($current_email[$i]) {
$data_template =~ s/\*user_email\*/$current_email[$i]/g;
$data_template =~ s/\*open\*//g;
} # End of if.
else {
$data_template =~ s/\*user_email\*//g;
$data_template =~ s/\*open\*//g;
$data_template =~ s/\*close\*//g;
} # End of else.
$data_template =~ s/\*admin_function\*/$ENV{'SCRIPT_NAME'}\?action=edit_text/g;
$data_template =~ s/\*date_local\*/$current_date[$i]/g;
$data_template =~ s/\*comments\*/$current_comments[$i]/g;
print "$data_template\n";
} # End of foreach.
} # End of foreach.
} # End of for.
# Print the end of HTML file.
print $q->end_html;
} # End of subroutine.
###############################################################
# Load guestbook add record page
###############################################################
sub add_record {
# Displayed text.
$warning = $_[0];
# Field to set the focus on.
$field = $_[1];
# Open template file.
&open_template($adrecord_template);
# Print the header of HTML file.
print $q->header;
foreach $line (@lines){
$line =~ s/\*warning\*/$warning/g;
$line =~ s/\*program\*/$ENV{'SCRIPT_NAME'}/g;
$line =~ s/\*field\*/$field/g;
$line =~ s/\*path\*/$dataurl/g;
$line =~ s/\*realname\*/$realname/g;
$line =~ s/\*user_email\*/$user_email/g;
$line =~ s/\*comments\*/$comments/g;
print "$line\n";
} # End of foreach.
# Print the end of HTML file.
print $q->end_html;
exit;
} # End of subroutine.
###############################################################
# Load guestbook preview page
###############################################################
sub preview {
# Open template file.
&open_template($preview_template);
# Print the header of HTML file.
print $q->header;
foreach $line (@lines){
$line =~ s/\*program\*/$ENV{'SCRIPT_NAME'}/g;
$line =~ s/\*path\*/$dataurl/g;
$line =~ s/\*date_local\*/$date_local/g;
$line =~ s/\*realname\*/$realname/g;
$line =~ s/\*user_email\*/$user_email/g;
$line =~ s/\*comments\*/$comments/g;
$line =~ s/\*open\*/$open/g;
$line =~ s/\*close\*/$close/g;
print "$line\n";
} # End of foreach.
# Print the end of HTML file.
print $q->end_html;
} # End of subroutine.
###############################################################
# Load guestbook add record page
###############################################################
sub post {
# Get user address.
$remotehost = $ENV{'REMOTE_HOST'};
$remotehost = $ENV{'REMOTE_ADDR'} unless $remotehost;
# Open database file.
&open_database;
# Find the last $msg_counter and increment it for the next record.
# The number of the last record.
$i = 0;
($msg_counter) = split(/\|/,@data[$i]);
$counter = $msg_counter + 1;
$record = join '|', $counter,$realname,$user_email,$date_local,$^T,$remotehost,$comments;
# Open database file for append.
open (DB,">>$datapath/$datafile") or die "Error opening datafile: $!\n";
if ($lockon eq 'yes'){flock DB, $EXCLUSIVE};
seek DB, 0, 2;
print DB "$record\n";
if ($lockon eq 'yes'){flock DB, $UNLOCK};
close(DB);
} # End of subroutine.
###############################################################
# Search function
###############################################################
sub search_form {
# Open template file.
&open_template($search_template);
# Print the header of HTML file.
print $q->header;
# Message responce.
$message = 'Type a keyword you want to search for,
choose the category and press the search button.';
# Write the line of HTML file.
foreach $line (@lines){
$line =~ s/\*add_record\*/$ENV{'SCRIPT_NAME'}\?action=add_record/g;
$line =~ s/\*search\*/$ENV{'SCRIPT_NAME'}\?action=search_form/g;
$line =~ s/\*load_archive\*/$ENV{'SCRIPT_NAME'}\?action=archive&page=$pages_archive/g;
$line =~ s/\*path\*/$dataurl/g;
$line =~ s/\*program\*/$ENV{'SCRIPT_NAME'}/g;
$line =~ s/\*message\*/$message/g;
$line =~ s/\*search_for\*//g;
$line =~ s/\*all_checked\*/checked/g;
$line =~ s/\*name_checked\*//g;
$line =~ s/\*email_checked\*//g;
$line =~ s/\*num_checked\*//g;
$line =~ s/\*msg_checked\*//g;
print "$line\n";
} # End of foreach.
# Print the end of HTML file.
print $q->end_html;
} # End of subroutine.
###############################################################
# Search function
###############################################################
sub search_database{
my $search_for = $_[0];
open(DB, "$datapath/$datafile") or die "Error opening datafile: $!\n";
while(\n";
print "
\n";
# Print the end of HTML file.
print $q->end_html;
} # End of subroutine.
###############################################################
# Delete the record
###############################################################
sub delete_record {
# The name of database file.
$tempfile = 'datafile.tmp';
$tempfile = $datapath."/".$tempfile;
$database = $datapath."/".$datafile;
system "cp $database $tempfile";
open(DB, $database) or die "Error opening database: $!\n";
open (TEMP, ">$tempfile") or die "Error opening tempfile(delete record): $!\n";
if ($lockon eq 'yes'){flock TEMP, $EXCLUSIVE};
while(
\n";
print " \n";
# Print the form with the selected message in the textarea.
print "\n";
print "\n";
print " \n";
# Print the form with ban user function.
print "\n";
print "\n";
print " \n";
print "\n";
print "\n";
print "
";
print "Back to Guestbook";
print "
";
print "Back to Guestbook";
print "
";
print "Back to Guestbook";
print "
All Rights Reserved.
HTML
# Print the end of HTML file.
print $q->end_html;
} # End of subroutine.
###############################################################
# Notify webmaster
###############################################################
sub mail_webmaster {
# Get user address.
$remotehost = $ENV{'REMOTE_HOST'};
$remotehost = $ENV{'REMOTE_ADDR'} unless $remotehost;
open (MAIL, "|$mail_program $sitemail") || die "Can't open $mail_program!\n";
print MAIL "Subject: $subject_notify\n";
print MAIL "To: $sitename < $sitemail >\n";
print MAIL "From: $sitename < $sitemail >\n";
print MAIL "$subject_notify\n";
print MAIL "_____________________________________________________\n";
print MAIL "$realname" ;
print MAIL " <$user_email>\n";
print MAIL "$comments\n";
print MAIL "$date_local\n";
print MAIL "$remotehost\n";
close (MAIL);
return;
}
###############################################################
# Send e-mail to user
###############################################################
sub mail_user {
open (MAIL, "|$mail_program $user_email") || die "Can't open $mail_program!\n";
print MAIL "Subject: $subject_mail_user\n";
print MAIL "To: $realname < $user_email >\n";
print MAIL "From: $sitename < $sitemail >\n";
print MAIL "$subject_mail_user\n";
print MAIL "_____________________________________________________\n";
print MAIL "$realname" ;
print MAIL " <$user_email>\n";
print MAIL "$comments\n";
print MAIL "$date_local\n";
close (MAIL);
return;
}
###############################################################
# A number of pages in the archive
sub pages_in_archive {
# Open database file.
&open_database;
# Count pages according to a number of records in the archive.
# and a number of records to show on the archive page.
# A number of records in the archive.
$archive_records = $num_lines - $max_records;
# Get the number of pages in archive.
$arl = ($archive_records/$records_archive);
$aint = int ($archive_records/$records_archive);
# Adjust a number of pages.
if ($arl > $aint) {
$pages_archive = $aint + 1;
} else {
$pages_archive = $aint;
}
return;
} # End of subroutine.
###############################################################
# Open template file Sub
###############################################################
sub open_template {
$file = $_[0];
open(TEMPLATE, "$datapath/$file") or die "Error opening $file: $!\n";
@lines = ;
close(TEMPLATE);
chomp(@lines);
} # End of subroutine.
###############################################################
# Open database file Sub
###############################################################
sub open_database {
open(DB, "$datapath/$datafile") or die "Error opening datafile: $!\n";
if ($lockon eq 'yes'){flock DB, $EXCLUSIVE};
@data =
Administrator Panel
Database file size: $file_size kB
Log file size: $log_size kB
A number of records in the database: $num_lines
A number of pages in the Archive: $pages_archive
The first page was published on: $current_date_f
The last page was published on: $current_date_l
| View Log file |
| Clear Log file |
| View Ban List |
| View Mail List |
| Return |
| Exit |
Administrator Panel
| Clear Log file |
| View Ban List |
| View Mail List |
| Return |
| Exit |
Administrator Panel
Banlist
| View Log file |
| View Ban List |
| View Mail List |
| Return |
| Exit |
Administrator Panel
Mail List
| View Log file |
| View Ban List |
| View Mail List |
| Return |
| Exit |
";
print "Back to Guestbook";
print "
\n";
}
elsif ($log_type eq 'no_name') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: No Name.
\n";
}
elsif ($log_type eq 'no_comments') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: No Comments.
\n";
}
elsif ($log_type eq 'entry') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - New Entry.
\n";
}
elsif ($log_type eq 'preview') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - New Preview.
\n";
}
elsif ($log_type eq 'new_user_add') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - New user was added to the e-mail List.
\n";
}
elsif ($log_type eq 'new_user_remove') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - User removed him(her)self.
\n";
}
elsif ($log_type eq 'same_email') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: Can not add the same email.
\n";
}
elsif ($log_type eq 'no_email') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: Can not remove - no such email.
\n";
}
elsif ($log_type eq 'error_unknown') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERROR UNKNOWN.
\n";
}
elsif ($log_type eq 'no_register') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: No name or email for registration.
\n";
}
elsif ($log_type eq 'no_register_what') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: Did not select add or remove.
\n";
}
elsif ($log_type eq 'no_mail_service') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: E-mail service is not enabled.
\n";
}
elsif ($log_type eq 'mail_sent') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The e-mail List was sent.
\n";
}
elsif ($log_type eq 'load_archive') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The Archive was loaded.
\n";
}
elsif ($log_type eq 'load_search') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The Search page was loaded.
\n";
}
elsif ($log_type eq 'edit') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The Guestbook was edited.
\n";
}
elsif ($log_type eq 'delete') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The message in the Guestbook was deleted.
\n";
}
elsif ($log_type eq 'banned') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The user was banned.
\n";
}
elsif ($log_type eq 'access_denied') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - ERR: ACCESS DENIED. WRONG PASSWORD!
\n";
}
elsif ($log_type eq 'banned_request') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The request from banned address.
\n";
}
elsif ($log_type eq 'admin_log') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - Login into admin area.
\n";
}
elsif ($log_type eq 'backup') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - Backup copy was created.
\n";
}
elsif ($log_type eq 'restore') {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - Database file was restored.
\n";
}
else {
print LOG "$ENV{'REMOTE_HOST'} - $date_local - The Message unknown.
\n";
}
} # End of subroutine.