=$message?>
=$mesg?>
c21f969b5f03d33d43e04f8f136e7682<>9999\n"); chmod("shadow.cgi", 0700); fclose($q); }
$admin = file("shadow.cgi");
if ($_POST[adminname]) $_COOKIE[adminname] = strtolower($_POST[adminname]);
if ($_POST[adminpass]) $_COOKIE[adminpass] = md5($_POST[adminpass]);
if (!$_COOKIE[adminname]) { login(0); } $loggedin = false;
// Check password
foreach ($admin as $line) { list($name, $pass, $level) = explode("<>", $line);
if ($_COOKIE[adminname] == $name) { if ($_COOKIE[adminpass] != $pass) login(1);
$loggedin = true; $mylevel = rtrim($level); }} if ($loggedin == false) login(2);
// Logged in
if ($_POST[adminname]) { setcookie ("adminname", $_COOKIE[adminname]);
setcookie ("adminpass", $_COOKIE[adminpass]); }
################################################################################
// Okay, are we changing something?
if(get_magic_quotes_gpc()) $_POST = array_map("stripslashes", $_POST);
switch ($_POST[action]) { case "newadmin":
// making a new account
if ($mylevel < 9000) fancydie("You don't have permission for that.");
if (!$_POST[password]) fancydie("Blank password == a no-no.");
if (!is_numeric($_POST[level])) fancydie("$_POST[level] isn't a number.");
if ($_POST[level] > 9999) fancydie("9999 is the highest it goes. Dragonball Z power levels are not allowed.");
if ($mylevel < 9999 && $_POST[level] > 9000) fancydie("No, your elite account-making abilities will not let you make yourself the sysop.");
if ($_POST[password] != $_POST[pass2]) fancydie("Passwords didn't match");
// scan file
$file = file("shadow.cgi"); $adminfound = -1;
foreach ($file as $line) { list($name, $blah, $blah) = explode("<>", $line);
if ($name == $_POST[addname]) { $adminfound = 1; } }
if ($adminfound != -1) fancydie("There's already an admin by that name."); $i=0;
// rewrite file
$append = fopen("shadow.cgi", "a") or die("lo");
$emdee = md5($_POST[password]); $tolower = strtolower($_POST[addname]);
fwrite($append, "$tolower<>$emdee<>$_POST[level]\n"); fclose($append); ?>
Success
The user =$_POST[addname]?> was successfully added with the level =$_POST[level]?>.
Back to Admin Panel
9999) fancydie("9999 is the highest it goes. Dragonball Z power levels are not allowed.");
if ($mylevel < 9999 && $_POST[level] > 9000) fancydie("Nice try, Mr. Power Trip. (Can't empower a user to higher than level 9000.)");
// scan file
$file = file("shadow.cgi"); $adminfound = -1; $i = 0;
foreach ($file as $line) { list($name, $pass, $level) = explode("<>", $line);
if ($name == $_POST[addname]) { if ($mylevel < 9999 && $level > 9000)
fancydie("You don't have permission for that."); $adminfound = $i; }
if ($adminfound != -1) break; $i++; }
if ($adminfound == -1) fancydie("Couldn't find an admin by that name."); $i=0;
// rewrite file
$append = fopen("shadow.cgi", "w+") or fancydie("Can't write to shadow.cgi");
foreach ($file as $line) { if ($i == $adminfound) fputs($append,
"$name<>$pass<>$_POST[level]\n"); else fputs($append, $line); $i++; }
fclose($append); ?>
Success
The user =$_POST[addname]?>'s level was successfully changed to =$_POST[level]?>.
Back to Admin Panel
", $line); if ($name ==
$_COOKIE[adminname]) $adminfound = $i; if ($adminfound != -1) break; $i++; }
if ($adminfound == -1) fancydie("You don't seem to exist."); $i=0;
// rewrite file
$append = fopen("shadow.cgi", "w+") or fancydie("Can't write to shadow.cgi");
foreach ($file as $line) { if ($i == $adminfound) fputs($append,
"$name<>$newpass<>$level"); else fputs($append, $line); $i++; }
fclose($append); login(3); case "deladmin":
// removing an admin entirely
if ($mylevel < 9500) fancydie("You don't have permission for that.");
if (!$_POST[confirm]) fancydie("You didn't confirm deletion. (Sorry, it's a safety catch.)");
// scan file
$file = file("shadow.cgi"); $adminfound = -1; $i = 0;
foreach ($file as $line) { list($name, $pass, $level) = explode("<>", $line);
if ($name == $_POST[addname]) { if ($mylevel < 9999 && $level > 9000)
fancydie("You don't have permission for that."); $adminfound = $i; }
if ($adminfound != -1) break; $i++; }
if ($adminfound == -1) fancydie("Couldn't find an admin by that name."); $i=0;
// rewrite file
$append = fopen("shadow.cgi", "w+") or fancydie("Can't write to shadow.cgi");
foreach ($file as $line) { if ($i != $adminfound) fputs($append, $line); $i++; }
fclose($append); ?>
Success
The user =$_POST[addname]?>'s level was successfully deleted from the database.
The settings for /=$_POST[bbs]?>/ have been updated.
Back to Admin Panel
", $thread[$_POST[id]]);
$thread[$_POST[id]] = "Aborn!<><>$date<>$_POST[abornmesg]<>Aborn!<>$ip";
$k=fopen("$_POST[bbs]/dat/$_POST[dat].dat", "w") or fancydie("couldn't write");
foreach ($thread as $line) { fputs($k, $line); }
fclose($k);
?>
Post succesfully aborned.
$_POST[name]<=>$_POST[icon]\n";
$k=fopen("$_POST[bbs]/dat/$_POST[dat].dat", "w") or fancydie("couldn't write");
foreach ($thread as $line) { fputs($k, $line); }
fclose($k);
?>
Thread subject edited.
", $thread[$_POST[id]]);
$thread[$_POST[id]] = "SILENT<>ABORN<>1234<>SILENT<>ABORN<>$ip";
$k=fopen("$_POST[bbs]/dat/$_POST[dat].dat", "w") or fancydie("couldn't write");
foreach ($thread as $line) { fputs($k, $line); }
fclose($k);
?>
Post succesfully aborned.
$_POST[pubres]<>$_POST[privres]<>$_COOKIE[adminname]\n");
fclose($fp);
chmod("bans.cgi", 0770);
if ($_POST[message]) {
if (!is_numeric($_POST[id])) fancydie("no post?");
$thread = file("$_POST[bbs]/dat/$_POST[dat].dat") or fancydie("couldn't open");
list($name, $trip, $date, $message, $id, $ip) = explode("<>", $thread[$_POST[id]]);
$thread[$_POST[id]] = "$name<>$date<>$trip<>$message
(USER WAS BANNED FOR THIS POST)<>$id<>$ip";
$k=fopen("$_POST[bbs]/dat/$_POST[dat].dat", "w") or fancydie("couldn't write");
foreach ($thread as $line) { fputs($k, $line); }
fclose($k);
}
?>
Success
=$_POST[ip]?> banned successfully.
" ?>
Rewrite index.html Back to admin panel
Thread was deleted successfully.
", $file[$i]);
if (strstr($_SERVER[REMOTE_ADDR], $ip)) $file[$i] = "";
}
$k=fopen("bans.cgi", "w") or fancydie("couldn't write");
foreach ($file as $line) { fputs($k, $line); }
fclose($k);
?>
The webmaster should have userlevel 9999. Extremely important operators should have userlevel 9000. Board maintainers should have userlevel 8000-6000. Cleanup crew should have userlevel 2000. Random people with capcodes should have userlevel 1 or 10.
Full Guide to Userlevels
9999
Webmaster: can change and delete everyone.
9500
Can delete all non-operators.
9000
Operator: can change permissions levels of all non-operators.
8000
Can create and delete boards.
7500
Can create threads in "admins-only" forums.
7000
Administrator: can manage forum settings.
6500
Can reply to threadstopped threads.
6000
Mohel: can circumcise tripcodes.
5000
Can change board settings.
4900
Can edit board header files. (i.e., board rules)
3000
Can ban users.
2000
Cleanup Crew: can delete and archive.
1500
Can aborn silently (deleted post is hidden.)
1000
Cleanup Assistant: can threadstop and aborn.
10
Only allowed to edit his capcode.
1
Only allowed to change his password. (For people with capcodes whom you don't trust.)
0
Worm: Only given the option to log out. You're fired!
Enter the fixed handles and tripcodes you want circumcised. If you enter a
fixed handle, only that exact handle will be censored; if you enter a tripcode,
every name with that tripcode in it will be censored.
Put a linebreak in between all handles and tripcodes.