From: Joe Presbrey Date: Mon, 14 May 2007 17:23:57 +0000 (+0000) Subject: batch drop_db command X-Git-Url: http://andersk.mit.edu/gitweb/sql-web.git/commitdiff_plain/c8e671a81e15ec77a12c53fd432fa45c807ba59a batch drop_db command git-svn-id: svn://presbrey.mit.edu/sql/web/dev@132 a142d4bd-2cfb-0310-9673-cb33a7e74f58 --- diff --git a/batch/drop_db.php b/batch/drop_db.php new file mode 100755 index 0000000..121eb28 --- /dev/null +++ b/batch/drop_db.php @@ -0,0 +1,30 @@ +canLogin()) die('-1,Login failed.'); + +$User = new User($Login->getUserID()); +$myUsername = $User->getUsername(); + +if (substr($i_d,0,strlen($myUsername)+1) == $myUsername.DELIMETER) { + $i_d = explode(DELIMETER, $i_d); + array_shift($i_d); + $i_d = implode(DELIMETER, $i_d); +} +$i_d = sprintf("%s%s%s", $myUsername, DELIMETER, $i_d); + +if (strlen($i_d)) { + list($msg1, $err1) = proc::drop($User, array("$i_d"=>'Yes')); + if (count($err1)) die('-3,'.implode(' ',$err1)); + if (count($err1)==0) die('0,'.$i_d); +} else { + die('-2,Unspecified database.'); +} + +?>