d7e046e70ba18543020d5ced4f1bcb1d2b3dc9d0
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
5) Written 2008-2013 by schokokeks.org Hosting, namely
6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
15) */
16) 
17) require_once('session/start.php');
18) require_once('inc/icons.php');
19) require_role(array(ROLE_SYSTEMUSER));
20) 
21) global $prefix;
22) 
23) require_once('mysql.php');
24) 
25) $dbs = get_mysql_databases($_SESSION['userinfo']['uid']);
26) $users = get_mysql_accounts($_SESSION['userinfo']['uid']);
27) 
28)   title("MySQL-Datenbanken");
29)   output('<p>Hier können Sie den Zugriff auf Ihre MySQL-Datenbanken verwalten. Die Einstellungen werden mit einer leichten Verzögerung (maximal 5 Minuten) in das System übertragen. Bitte beachten Sie, dass neue Zugänge also nicht umgehend funktionieren.</p>
30)   <p><strong>Hinweis:</strong> In dieser Matrix sehen Sie links die Datenbanken und oben die Benutzer, die Sie eingerichtet haben. In der Übersicht ist dargestellt, welcher Benutzer auf welche Datenbank Zugriff erhält. Klicken Sie auf die Symbole um die Zugriffsrechte zu ändern.</p>');
31) 
32)   $form = '
33)   <table>
34)   <tr><th>&#160;</th><th style="background-color: #729bb3; color: #fff;padding: 0.2em;" colspan="'.(count($users)+1).'">Benutzerkonten</th></tr>
35)   <tr><th style="background-color: #729bb3; color: #fff;padding: 0.2em; text-align: left;">Datenbanken</th>';
36) 
37)   foreach ($users as $user)
38)   {
39)     $username = $user["username"];
40)     //$username = str_replace('_', '_ ', $user['username']);
41)     $desc = '';
42)     if ($user['description']) {
43)       $desc = '<br /><span style="font-weight: normal; font-size: 80%; font-style: italic;">'.$user['description'].'</span>';
44)     } 
45)     $form .= "<th><span title=\"Erstellt: {$user['created']}\">{$username}</span>".$desc;
46)     $form .= "<br />".internal_link('description', other_icon("comment.png", 'Beschreibung ändern'), "username={$username}")."&#160;";
47)     $form .= internal_link("save", icon_delete("Benutzer »{$user['username']}« löschen"), "action=delete_user&user={$user['username']}")."</th>";
48)   }
49) 
50)   $servers = servers_for_databases();
51) 
52)   $formtoken = generate_form_token('mysql_permchange');
53) 
54)   foreach($dbs as $db)
55)   {
56)     $phpmyadmin = "https://mysql.{$servers[$db['name']]}/";
57)     $desc = '';
58)     if ($db['description']) {
59)       $desc = '<br /><span style="font-weight: normal; font-size: 80%; font-style: italic;">'.$db['description'].'</span>';
60)     } 
Bernd Wurst Symbole immer in der Zeile...

Bernd Wurst authored 11 years ago

61)     $form .= "<tr><td style=\"border: 0px; font-weight: bold; text-align: right;\"><span title=\"Erstellt: {$db['created']}\">{$db['name']}</span>".$desc."<br />";
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

62)     $form .= internal_link('description', other_icon("comment.png", 'Datenbank-Beschreibung ändern'), "db={$db['name']}")."&#160;";
63)     $form .= internal_link("save", icon_delete("Datenbank »{$db['name']}« löschen"), "action=delete_db&db={$db['name']}")."&#160;";
64)     $form .= "<a href=\"".$phpmyadmin."\">".other_icon("database_go.png", "Datenbank-Verwaltung über phpMyAdmin")."</a>";
Bernd Wurst Symbole immer in der Zeile...

Bernd Wurst authored 11 years ago

65)     $form .= "</td>";