]> andersk Git - sql-web.git/blob - batch/drop_db.php
batch drop_db command
[sql-web.git] / batch / drop_db.php
1 <?php
2
3 require_once('../mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5 require_once('proc.lib.php');
6
7 require_once('batch.inc.php');
8
9 $Login = new Login($i_u, $i_p);
10 if (!$Login->canLogin()) die('-1,Login failed.');
11
12 $User = new User($Login->getUserID());
13 $myUsername = $User->getUsername();
14
15 if (substr($i_d,0,strlen($myUsername)+1) == $myUsername.DELIMETER) {
16         $i_d = explode(DELIMETER, $i_d);
17         array_shift($i_d);
18         $i_d = implode(DELIMETER, $i_d);
19 }
20 $i_d = sprintf("%s%s%s", $myUsername, DELIMETER, $i_d);
21
22 if (strlen($i_d)) {
23         list($msg1, $err1) = proc::drop($User, array("$i_d"=>'Yes'));
24         if (count($err1)) die('-3,'.implode(' ',$err1));
25         if (count($err1)==0) die('0,'.$i_d);
26 } else {
27         die('-2,Unspecified database.');
28 }
29
30 ?>
This page took 0.210793 seconds and 5 git commands to generate.