-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.php
69 lines (54 loc) · 2.25 KB
/
reset.php
1
<?php/*================================================== GONE FISHING v1.0 April 2001 Nigel Gilbert [email protected]====================================================*//* resets the game in case the fish stock has been exhausted etc. Leaves the players,but resets their bank balances to the starting value. Deletes all log entries and resets thefish stock.Included by admin.php*/include("common.inc");include("defines.inc");html_header("Gone Fishing! administration");?><H2>Gone Fishing! administration</H2><blockquote><?php $password = $_POST['password']; $type = $_POST['type']; if ($password <> "firma") { /* rather low security password feature! */ alert("Bad password"); } else { $db = db_open(); switch ($type) { case "Reset": db_write("UPDATE people SET logintime=null, balance=10000"); db_write("INSERT INTO log (name) VALUES( '***RESET BALANCES***')"); break; case "Restart": db_write("DELETE FROM people WHERE email = ''"); db_write("DELETE FROM people WHERE type = 'agent'"); db_write("UPDATE people SET logintime=NULL, lastoptime=NULL, balance=10000"); db_write("DELETE FROM sea"); db_write("DELETE FROM log"); db_write("DELETE FROM msgs"); db_write("INSERT INTO people (name, boat, balance, logintime, email, type) VALUES ('$phantomName', 'Marie Celeste', 10000, now(), '$admin_mail', 'agent')"); db_write("DELETE FROM phantoms"); db_write("INSERT INTO phantoms (name, code) VALUES ('$phantomName', '$phantomCode')"); break; } db_write("INSERT INTO sea (time, stock, price, maintenance) VALUES (now(), 100000, 10.0, $maintenance)"); echo "<P>Game " . ($type == "Reset" ? "reset." : "restarted.</P>"); }?><form method=get action="admin.html"> <input type=submit name=return value="Return to administration page"></form><?php html_footer();?>