home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.sunet.sepub/pictures
/
2014.11.ftp.sunet.se-pictures.tar
/
ftp.sunet.se
/
pub
/
pictures
/
ACiD-artpacks
/
www
/
mirrors
/
hirez
/
cgi-bin
/
discus
/
board-post-form.cgi
< prev
next >
Wrap
Text File
|
1999-02-12
|
5KB
|
137 lines
#!/usr/bin/perl
$discus_conf = '/usr/local/www/www.hirez.org/discus_admin_149349189/discus.conf';
#Discus board posting form script
#-------------------------------------------------------------------------------
# This script is copyright (c) 1998 by DiscusWare, LLC, all rights reserved.
# Its use is subject to the license agreement that can be found at the following
# URL: http://www.chem.hope.edu/discus/license
#-------------------------------------------------------------------------------
if (open (FILE, "$discus_conf")) {
@file = <FILE>;
close (FILE);
$evals = "";
foreach $line (@file) {
if ($line =~ /^(\w+)=(.*)/) {
$varname = $1;
$value = $2;
$value =~ s/'/\\'/g; $value =~ s/\r//g;
$evals .= "\$$varname='$value'; ";
}
}
eval($evals);
require "$admin_dir/source/src-board-subs-common";
} else {
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Script Execution Error</TITLE></HEAD>\n";
print "<BODY BGCOLOR=#ffffff TEXT=#000000>\n";
print "<H1>Script Execution Error</H1>\n";
print "Discus scripts could not execute because the discus.conf file\n";
print "could not be opened.";
print "<P>Reason: <FONT COLOR=#ff0000><B>$!</B></FONT>" if $!;
print "<P>This generally indicates a setup error of some kind.\n";
print "Consult the <A HREF=\"http://www.chem.hope.edu/discus/rc\">Discus ";
print "Resource Center</A> for troubleshooting information.</BODY></HTML>\n";
exit(0);
}
&parse_form;
&read_cookie;
if ($FORM{'HTTP_REFERER'} ne "") {
$_ = $FORM{'HTTP_REFERER'};
} else {
$_ = $ENV{'HTTP_REFERER'};
$FORM{'HTTP_REFERER'} = $ENV{'HTTP_REFERER'};
}
&extract($_);
&header;
($bgcolor,$text,$link,$vlink,$alink,$face,$size,$image) = &ex('extract_colorsonly', 1);
$strg = &JavaScript_prepare ($topic_name);
$str = "$L{BPFCREATETITLE}";
&ex('printuntil', 1, 1, $topic_number, $str);
print "<FORM Action=\"$script_url/board-post.$cgi_extension\" Method=Post NAME=userpass>\n";
print "<CENTER><FONT SIZE=+1><B>$str</B></FONT></CENTER>\n<HR>\n";
&ex('printuntil', 3, 3, $topic_number, $str, 0, 1);
print "<strong><A HREF=\"$message_url/board-topics.html\" onMouseOver=\"window.status = '$L{NBRETURN}", "$titlej $L{NBMAINPAGE}'; return true\">$title</A>:\n";
$file = "$topic_number/$topic_number.$ext";
print "<A HREF=\"$message_url/$file\" onMouseOver=\"window.status = '$L{NBRETURN} ", "$strg'; return true\">$topic_name</A>: " if -e "$message_dir/$file";
print "<A HREF=\"$script_url/board-auth.$cgi_extension?file=/$file\" onMouseOver=\"window.status = '$L{NBRETURN} ", "$strg'; return true\">$topic_name</A>: " if !-e "$message_dir/$file";
foreach $key (keys(%level_number)) {
$strg = "$L{NBRETURN} " . &JavaScript_prepare ($level_name{$key});
$file = "$topic_number/$level_number{$key}.$ext";
print "<A HREF=\"$message_url/$file" if -e "$message_dir/$file";
print "<A HREF=\"$script_url/board-auth.$cgi_extension?file=/$file" if !-e "$message_dir/$file";
print "\" onMouseOver=\"window.status = '$strg'; return true\">$level_name{$key}</A>: \n";
}
&ex('printuntil', 5, 5, $topic_number, $str, 0, 1);
open (FILE, "$admin_dir/posting.txt");
@file = <FILE>; close (FILE);
@file = grep(/\S/, @file);
if (grep(/^$topic_number:/, @file)) {
($line) = grep(/^$topic_number:/, @file);
$line =~ s/\s+$//;
@file = grep(!/^$topic_number:/, @file);
($tn, $ip, $usr, $mod, $pas) = split(/:/, $line);
$disabled = 1 if ($ip eq "" && $usr eq "" && $mod eq "" && $pas !~ /\S/);
}
print <<End_Of_File;
$L{BPFCREATETITLE}
</strong>
<HR>
End_Of_File
if ($disabled == 0) {
print <<End_Of_File;
<BR>
$L{BPFSUBJECT}
<P>
<TABLE><TR><TD>
<Input Type="Text" Name="subject" Size=53>
</TD></TR></TABLE><BR>
<INPUT type=hidden name="HTTP_REFERER" value="$FORM{'HTTP_REFERER'}">
<INPUT type=hidden name="new_conversation" value="1">
<P>
<HR>
End_Of_File
}
&ex('printuntil', 7, 13, $topic_number, $str, 0, 1);
if ($disabled == 1) {
$l = $L{BPPOSTINGDISABLEDDESCR};
$l =~ s/\%aopen/<A HREF="$script_url\/board-contact.$cgi_extension">/g;
$l =~ s/\%aclose/<\/A>/g;
print "<P><CENTER><TABLE BGCOLOR=#ffcccc><TR><TD><FONT FACE=\"$face\" SIZE=\"$size\" COLOR=000000><B>$l</B></FONT></TD></TR></TABLE>";
} else {
($template, $addfile) = &ex('determine_addmessage', $topic_number);
@file = split(/\n/, $addfile);
foreach $line (@file) {
$line .= "\n";
$line =~ s/<!-FONT-!>/<FONT FACE="$face" SIZE="$size">/g;
$line = "" if $line =~ m|FORM>|;
}
$flag = 0;
foreach $line (@file) {
if ($line =~ /<!-Conversation - LEAVE THIS HERE!-!>/) {
$flag = 1;
} elsif ($line =~ /<!-\/Identification/) {
$flag = 0;
} elsif ($line =~ /<!-Skip next line-!>/) {
$flag = 2+$flag;
} elsif ($flag >= 2) {
$flag -= 2;
} elsif ($line =~ /<!-Submit button included-!>/) {
$submit_included = 1;
} elsif ($line =~ m|^<!-Anon-!>|) {
next if $anon;
next if ($GLOBAL_OPTIONS{'anonymous'} == 0 && $GLOBAL_OPTIONS{'options_used'} == 1);
print $line;
} elsif ($flag == 1) {
print $line;
}
}
print "<HR>\n";
if ($submit_included == 0) {
print "<CENTER>\n";
print "<INPUT TYPE=\"submit\" Name=submit VALUE=\"$L{BPPREVIEWPOST}\">\n";
print "</CENTER><HR></FORM>\n";
}
}
&ex('printuntil', 15, 17, $topic_number, $str, 0, 1);
exit(0);