]> andersk Git - sql-web.git/blob - test.php
old admin stuff deleted
[sql-web.git] / test.php
1 <?php
2
3 require_once('mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5
6 include 'tpl/head.php';
7
8 function getManagedDBs($owner=null) {
9 //      $databases = array_keys(fetchRows(DBSelect('SHOW DATABASES'),'Database'));
10         $databases = array_keys(fetchRows(DBSelect('SELECT Name FROM DB'),'Name'));
11         $owners = array();
12         foreach($databases as $database) {
13                 if (stristr($database, DELIMETER)) {
14                         $exp = explode(DELIMETER, $database);
15                         $thisowner = array_shift($exp);
16                         if (!is_null($owner) && $thisowner!=$owner) { continue; }
17                         isset($owners[$thisowner]) || $owners[$thisowner] = array();
18                         $owners[$thisowner][] = $database;
19                 }
20         }
21         return $owners;
22 }
23
24 /*
25 $g = getManagedDBs();
26 print_r($g);
27 */
28
29 $User = new User($Login->getUserId());
30 print_r($User->getDBList());
31
32 include 'tpl/foot.php';
33 ?>
This page took 0.03338 seconds and 5 git commands to generate.