354c05a4ddd678c49bcbba458bffa7d13482139a
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

10) 
11) 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.
12) */
13) 
14) require_once('session/start.php');
15) require_once('inc/icons.php');
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 3 years ago

16) require_role([ROLE_SYSTEMUSER]);
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

17) 
18) global $prefix;
19) 
20) require_once('mysql.php');
21) 
22) $dbs = get_mysql_databases($_SESSION['userinfo']['uid']);
23) $users = get_mysql_accounts($_SESSION['userinfo']['uid']);
24) $username = $_SESSION['userinfo']['username'];
25) 
26) $section = 'mysql_overview';
27) title('Beschreibung ändern');
28) 
29) if (isset($_GET['db'])) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

30)     $thisdb = null;
31)     foreach ($dbs as $db) {
32)         if ($db['name'] == $_GET['db']) {
33)             $thisdb = $db;
34)         }
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

35)     }
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

36)     $form = '<p>Ändern Sie hier die Beschreibung der Datenbank <strong>' . $thisdb['name'] . '</strong>.</p>';
37)     $form .= '<p><input type="text" name="description" value="' . filter_output_html($thisdb['description']) . '" /></p>
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

38) <p><input type="submit" value="Speichern" /></p>';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

39)     output(html_form('mysql_description', 'save', "action=description&db={$thisdb['name']}", $form));
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

40) }
41) if (isset($_GET['username'])) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

42)     $thisuser = null;
43)     foreach ($users as $user) {
44)         if ($user['username'] == $_GET['username']) {
45)             $thisuser = $user;
46)         }
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

47)     }
Hanno Böck Spaces between string conca...

Hanno Böck authored 1 year ago

48)     $form = '<p>Ändern Sie hier die Beschreibung des DB-Benutzers <strong>' . $thisuser['username'] . '</strong>.</p>';
49)     $form .= '<p><input type="text" name="description" value="' . filter_output_html($thisuser['description']) . '" /></p>
Bernd Wurst Neue MySQL-Verwaltung

Bernd Wurst authored 11 years ago

50) <p><input type="submit" value="Speichern" /></p>';
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

51)     output(html_form('mysql_description', 'save', "action=description&username={$thisuser['username']}", $form));