]> andersk Git - sql-web.git/blob - main.php
change password feature
[sql-web.git] / main.php
1 <?php
2
3 require_once('mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5
6 if (!isLoggedIn()) redirect('index');
7
8 $err1 = $msg1 = array();
9
10 $User = new User($Login->getUserID());
11
12 if (isPost()) {
13         if (isset($i_newdb)) {
14                 $dbname = $User->getUsername().DELIMETER.$i_newdb;
15                 if ($User->isOverQuota()) {
16                         $err1[] = 'You are over your quota. You may not add databases.';
17                 } elseif ($User->addDB($dbname)==false) {
18                         $err1[] = mysql_error();
19                 } else {
20                         $msg1[] = 'Database `'.$dbname.'` created.';
21                 }
22         }
23         if (isset($i_drop)) {
24                 $dropdbs = array_keys($i_drop);
25                 foreach($dropdbs as $dbname) {
26                         if ($User->delDB($dbname)) {
27                                 $msg1[] = 'Database `'.$dbname.'` dropped.';
28                         } else {
29                                 $err1[] = mysql_error();
30                         }
31                 }
32         }
33         if (!count($err1))
34                 $User->refresh();
35 }
36
37 $myDBs = $User->getDBList();
38
39 include 'tpl/main.php';
40
41 ?>
This page took 0.297132 seconds and 5 git commands to generate.