// Check for POST and no in-forums spoofing
if($_SERVER[REQUEST_METHOD]!="POST"){fancydie("Trying to GET post.php?<meta http-equiv='refresh' content='0;url=.'>");}
// for capcode functions
$threadstopwhendone = false;
$loggedin = false;
###################
// capcode post
if ($_POST[pass]) {
$admin = file("shadow.cgi");
foreach ($admin as $line) { list($name, $pass, $level) = explode("<>", $line);
if (strtolower($_POST[name]) == $name) { if (md5($_POST[pass]) != $pass) fancydie("The password you supplied for that username is incorrect.");
$loggedin = true; break; }} if ($loggedin == false)
if ($level < 7500 && $setting[adminsonly] && $_POST[subj]) fancydie("You need a userlevel of 7500 to start a thread."); // admins-only threads...
if (!$_POST[subj] && !is_writable("$_POST[bbs]/dat/$_POST[id].dat")) {
if (
// Length checks
if (strlen($_POST[mesg]) == 0) fancydie("You didn't write a post?!");
if (strlen($_POST[mesg]) > 10000) fancydie("Thanks for your contribution, but it was too large.");
if (strlen($_POST[subj]) > 45) fancydie("Subject is too long!");
if (count(explode("<br>", $_POST[mesg])) > 100) fancydie("Your post has far too many lines in it!");
// check for ID and board
if (!$_POST[bbs]) fancydie("No board specified to post to!");
if (!$_POST[id]) fancydie("No thread ID specified to post to!");
if (!is_dir($_POST[bbs])) fancydie("Board specified does not exist.");
if (!$_POST[subj] && !is_file("$_POST[bbs]/dat/$_POST[id].dat")) fancydie("Thread ID specified does not exist.");
if ($_POST[subj] && is_file("$_POST[bbs]/dat/$_POST[id].dat")) fancydie ("Thread has already been created.");
// Tripcode mohel
if ($_POST[name]) { $censorme = false;
if (file_exists("mohel.cgi")) {
$mohel = file("mohel.cgi") or fancydie("Couldn't open mohel.cgi :(");
foreach ($mohel as $line) {
$line = trim($line);
if ($line{0} == '#') {
if ($line == '#'.$trip) $censorme = true;
} else {
if ($line == $_POST[name].'#'.$trip) $censorme = true;
}
}
if ($censorme == true) { echo "<b>Message from Mohel:</b> Your nickname was censored, for your own good.<p>"; $_POST[name]=""; $trip=''; }
}}
// anonymous, we love you!
if ($_POST[name] == "" && !$trip) $_POST[name] = $setting[nameless];
if ($threadstopwhendone) chmod ("$_POST[bbs]/dat/$_POST[id].dat", 0440);
RebuildThreadList($_POST[bbs], $_POST[id], $_POST[sage], false);
?>
<html><title>Success</title><meta http-equiv='refresh' content='1;url=<?=$setting[urltoforum]?><?=$_POST[bbs]?>/'>
<? readfile("skin/$setting[skin]/success.txt"); ?>
<br><small><a href='<?=$setting[urltoforum]?><?=$_POST[bbs]?>/'>Click here to be forwarded manually</a></small>
<hr>
Powered by Shiichan v.<?=$shiiversion?>