]>
Commit | Line | Data |
---|---|---|
b43ab1a6 JP |
1 | <?php |
2 | ||
997305cf JP |
3 | require_once('mitsql.cfg.php'); |
4 | require_once('mitsql.lib.php'); | |
5 | ||
88b7d384 JP |
6 | include 'tpl/head.php'; |
7 | ||
377015e0 | 8 | function getManagedDBs($owner=null) { |
88b7d384 JP |
9 | // $databases = array_keys(fetchRows(DBSelect('SHOW DATABASES'),'Database')); |
10 | $databases = array_keys(fetchRows(DBSelect('SELECT Name FROM DB'),'Name')); | |
377015e0 JP |
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 | } | |
997305cf | 23 | |
88b7d384 | 24 | /* |
377015e0 JP |
25 | $g = getManagedDBs(); |
26 | print_r($g); | |
88b7d384 JP |
27 | */ |
28 | ||
29 | $User = new User($Login->getUserId()); | |
30 | print_r($User->getDBList()); | |
997305cf | 31 | |
88b7d384 JP |
32 | include 'tpl/foot.php'; |
33 | ?> |