#!/usr/bin/perl #use CGI qw(:all); #use CGI::Carp qw/fatalsToBrowser/; # working on refer ############################################## # index.cgi - e_Board v2.1 - released 07/25/98 # # This script runs a message board on your site. # It was inspired by Matt Wright's WWWBoard. # This script by Mike Bagneski - copyright 1998. # Do not redistribute. # # Achtung: Dieses Script ist NICHT Freeware! # # Modifiziert von Sven Sevke # http://www.Algarve-Kontakt.com ################################################## # CONFIGURATION SECTION $maxMsgNo = 330; # This is the complete path your eboard directory. # relativ auf dem Server! $htmlpath = '/www/sevke.net/www/sevke.net/algarve-kontakt/cgi/eboard'; # This is the URL of your eboard directory. $htmlurl = 'http://www.sevke.net/algarve-kontakt/cgi/eboard'; # This is the URL of the [Exit Board] link. $exiturl = 'http://blog.sevke.net'; # This is your admin password. $password = 'melina'; # END OF CONFIGURATION SECTION ################################################### # OPTIONS SECTION #Quoting-Zeichen $quotemark = '>'; # Uncomment one of the following, depending on how you want the # board to handle HTML. #$html = 'no'; # if you want all HTML removed from message #$html = 'show'; # if you want to display the code as text $html = 'allow'; # if you're nuts. # This is the length of each line of quoted text in the reply form. # You only need to change this if you change your textarea dimensions. $len = 60; # This is the default condition of the main message page. # Change to 'kompletter' if you want all messages displayed by default. # Standard-Wert: 'kompakter', also nur die Ausgangs-Nachricht $init_threads = 'kompletter'; # The number of seconds that a message is marked new. # The default is 24 hours. $newtime = 60*60*24*3; # The number of seconds old a topic is before it expires from current messages. # The default is 30 days. If you don't want current messages to auto-expire, # set to 0. $expiration1 = 0; # The number of seconds old a topic is before it expires from archived messages. # The default is 90 days. If you don't want archived messages to auto-expire, # set to 0. $expiration2 = 0; # Set to 'no' if you want expired current topics to be deleted. # Set to 'yes' to have them archived. $x2archive = 'yes'; # This is the HTML of your NEW marker. This can be an image if you want. $new = ' NEW'; # Sven Sevke - Januar 1999 # Hier geben Sie an, ob die Nachrichten-Köpfe um die Anzahl der Replies ergänzt werden sollen $count_replies = 'yes'; # Default-Wert ist 'yes', sonst 'no' # This is the term used in the form to denote quoted text. $wrote = 'hat geschrieben'; # This is the path to sendmail. It's usually the default. # Consult your provider if it isn't. $sendmail = '/usr/lib/sendmail'; # This is the admin's e-mail address. The admin will receive # a copy of each message, incluing IP and REMOTE HOST info. $sysadmin = 'sven.sevke@sevke.net'; $mail = 1; #Mail an Admin bei SUBSCRIBE/UNSUBSCRIBE # This is the HTMl for reply indentation. You can substitute # a transparent image if you want. $indent = '         '; # After initial testing, set this to 'yes'. # If your server allows file locking, this will reduce errors. $lockon = 'yes'; # This is the list of naughty words, and what you want to convert # them to. %naughty = (fuck => 'hug', shit => 'pudding', pecker => 'puppy', asshole => 'angel', bitch => 'nice person', cunt => 'stopwatch', ' cock' => ' earlobe', 'cock!' => 'socks!', cocksucker => 'sweetheart', pussy => 'portable wishwasher', ' tit' => ' toe'); # These are the names and locations of the gifs shown with the lists. $postimage = "$htmlurl/post.gif"; $replyimage = "$htmlurl/reply.gif"; # These are the names of the various files. No need to change them # unless you change the actual file names. # Sven Sevke - 01.02.1999: Admin-Template hinzugefügt $list_template = 'template/listtmp.txt'; $msg_template = 'template/msgtmp.txt'; $prev_template = 'template/pretmp.txt'; $error_template = 'template/errtmp.txt'; $subscribe_template = 'template/subtmp.txt'; $form_template = 'template/formtmp.txt'; $admin_template = 'template/admin.txt'; $banlist = 'banlist.txt'; $mlist = 'mlist.txt'; $alist = 'alist.txt'; $countfile = 'counter.txt'; # END OF OPTIONS SECTION ############################################ # Set to flush output select (STDOUT); $| = 1; ############################################ # get form data read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'}); if ($ENV{'QUERY_STRING'}) {$buffer = "$buffer\&$ENV{'QUERY_STRING'}"; } @pairs = split(/&/,$buffer); foreach $pair (@pairs){ ($name,$value) = split(/=/,$pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; if (($html eq 'no') or ($name eq 'subject') or ($name =~ /url/)){ $value =~ s/<.*?>//g; $value =~ s/"/"/g; }elsif($html eq 'show'){ $value =~ s//>/g; $value =~ s/"/"/g; } # Censor Naughty Words for(keys(%naughty)){ $value =~ s/$_/$naughty{$_}/gi; } $value = '' if(($name eq 'email') and ($value !~ /.*\@.*\..*/)); $value = '' if(($name =~ /url$/) and ($value !~ /.*tp:.*\..*/)); $FORM{$name} = $value; } $FORM{'threads'} = $init_threads unless $FORM{'threads'}; $FORM{'mode'} = 'aktuelle' unless $FORM{'mode'}; $FORM{'actionurl'} = $ENV{'SCRIPT_NAME'}; if($FORM{'mode'} =~ /aktuelle/){$FORM{'mode'} = 'aktuelle'} if($FORM{'mode'} ne 'archivierte') { open(LIST, "$htmlpath/$mlist"); flock LIST, 2 if $lockon eq 'yes'; @list = ; &expire1 if $expiration1; } else { open(LIST, "$htmlpath/$alist"); flock LIST, 2 if $lockon eq 'yes'; @list = ; &expire2 if $expiration2; } ######################################## # check for banned status $ip = $ENV{'REMOTE_HOST'}; open (BANLIST,"$htmlpath/$banlist"); @blist = ; close (BANLIST); foreach $bannedip (@blist) { chomp($bannedip); if ($ip =~ /$bannedip/) { print "Content-type: text/html\n\n"; print "\n"; print "

Sorry, Sie sind von dem Diskussionsforum ausgeschlossen worden.

\n"; print ""; exit; } } if (exists($FORM{'post'})){ if(($FORM{'name'}) and ($FORM{'subject'}) and ($FORM{'body'})){ &post; exit; }else{ &error; exit; } } if (exists($FORM{'preview'})){ if(($FORM{'name'}) and ($FORM{'subject'}) and ($FORM{'body'})){ &preview; exit; }else{ &error; exit; } } if (exists($FORM{'message'})){ open(MESSAGE, "$htmlpath/messages/$FORM{'message'}.txt"); @data = ; close(MESSAGE); $message = $FORM{'message'}; print "Content-type: text/html\n\n"; &view; exit; } if (exists($FORM{'admin'})){ &password; exit; } # Sven Sevke - 01.02.1999 # Administration if (exists($FORM{'password'})){ if($FORM{'password'} ne $password){ $FORM{'admin'} = $FORM{'admmessage'}; &password; exit; }elsif($FORM{'admincommand'} eq 'count') { &adminCountReplies; }elsif($FORM{'admincommand'} eq 'delete') { &delete; }elsif($FORM{'admincommand'} eq 'archive') { &delete; } } if (exists($FORM{'subform'})){ open(SUBSCRIBE, "$htmlpath/$subscribe_template"); @lines = ; close(SUBSCRIBE); chomp(@lines); print "Content-type: text/html\n\n"; foreach $line (@lines){ $line =~ s/\*boardurl\*/$ENV{'SCRIPT_NAME'}\?threads=$FORM{'threads'}&mode=$FORM{'mode'}/; $line =~ s/\*actionurl\*/$FORM{'actionurl'}/; print "$line\n" if $line !~ // and $line ne ''; } exit; } if(exists($FORM{'subscription'})){ if($FORM{'subaddress'} =~ /@/){ &subscribe; } } ##################################################### # View Main Page (default) open(TEMPLATE, "$htmlpath/$list_template"); @lines =