32418e06734f07c35023d6bf97791260fbf0aaf6
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) $username = $_SESSION['userinfo']['username'];
28) 
29) $section = 'mysql_overview';
30) title('Neuer MySQL-Benutzer');
31) 
32) 
33) html_header('
34) <script type="text/javascript">
35) 
36)   function makePasswd() {
37)     var passwd = \'\';
38)     var chars = \'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\';
39)     for (i=0; i<15; i++) {
40)       var c = Math.floor(Math.random()*chars.length + 1);
41)       passwd += chars.charAt(c)
42)     }
43)     return passwd;
44)   }
45) 
46)   function setRandomPassword() 
47)   {
48)     pass = makePasswd();
49)     document.getElementById(\'newpass\').value = pass;
50)     document.getElementById(\'newpass_display\').value = pass;
51)     document.getElementById(\'newpass_display\').parentNode.style.display = \'block\';
52)   }
53) </script>');
54) 
55) 
56) $usernames = array();
57) foreach ($users as $user) {
58)   $usernames[] = $user['username'];
59) }
60) 
61) $suggestion = $username;
62) $count = 1;
63) while (in_array($suggestion, $usernames)) {
64)   $suggestion = $username.'_'.$count;
65)   $count++;
66) }
67) 
68) $form = '<h4>Benutzername</h4>
69) <input type="text" name="newuser" value="'.$suggestion.'" maxlength="16" />
70) <p>Bitte nur Kleinbuchstaben, Zahlen und Unterstrich verwenden. Der Benutzername muss mit Ihrem System-Benutzernamen beginnen.</p>
71) <p>Aufgrund einer Einschränkung des MySQL-Servers dürfen Benutzernamen nur maximal 16 Zeichen lang sein.</p>
72) <p><label for="description">Optionale Beschreibung dieses Benutzers:</label> <input type="text" name="description" id="description" /></p>
73) <h4>Passwort</h4>
Bernd Wurst Passwort-Erzeugung auch bei...

Bernd Wurst authored 11 years ago

74) <p><input onchange="document.getElementById(\'newpass_display\').parentNode.style.display=\'none\'" type="password" name="newpass" id="newpass" value="" /> <button type="button" onclick="setRandomPassword()">Passwort erzeugen</button></p>