Browse code

remove whitespace in empty lines

Hanno authored on26/06/2018 23:36:40
Showing1 changed files
... ...
@@ -92,7 +92,7 @@ if (count($dbs) > 0) {
92 92
 } else {
93 93
     $form .= '<p><em>Bisher gibt es noch keine Datenbanken.</em></p>';
94 94
 }
95
- 
95
+
96 96
 $form .= '<p><input type="submit" name="submit" value="Speichern"/><p>';
97 97
 
98 98
 
Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on26/06/2018 13:58:19
Showing1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 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 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 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.
... ...
@@ -55,19 +55,19 @@ html_header('
55 55
 
56 56
 $usernames = array();
57 57
 foreach ($users as $user) {
58
-  $usernames[] = $user['username'];
58
+    $usernames[] = $user['username'];
59 59
 }
60 60
 
61 61
 $suggestion = $username;
62 62
 $count = 1;
63 63
 while (in_array($suggestion, $usernames)) {
64
-  $suggestion = $username.'_'.$count;
65
-  $count++;
64
+    $suggestion = $username.'_'.$count;
65
+    $count++;
66 66
 }
67 67
 
68 68
 $hint = 'Der MySQL-Benutzername muss entweder <strong>'.$username.'</strong> lauten oder mit <strong>'.$username.'_</strong> beginnen.';
69 69
 if (in_array($username, $usernames)) {
70
-  $hint = 'Der MySQL-Benutzername muss mit <strong>'.$username.'_</strong> beginnen.';
70
+    $hint = 'Der MySQL-Benutzername muss mit <strong>'.$username.'_</strong> beginnen.';
71 71
 }
72 72
 
73 73
 
... ...
@@ -81,20 +81,19 @@ $form = '<h4>Benutzername</h4>
81 81
 <p style="display: none;">Automatisch erzeugtes Passwort: <input id="newpass_display" type="text" readonly="readonly" /></p>
82 82
 <h4>Berechtigungen</h4>';
83 83
 if (count($dbs) > 0) {
84
-  $form .= '<p>Auf welche der bisher vorhandenen Datenbanken darf dieser Benutzer zugreifen?</p>';
85
-  foreach ($dbs as $db) {
86
-    $desc = '';
87
-    if ($db['description']) {
88
-      $desc = ' - <em>'.$db['description'].'</em>';
84
+    $form .= '<p>Auf welche der bisher vorhandenen Datenbanken darf dieser Benutzer zugreifen?</p>';
85
+    foreach ($dbs as $db) {
86
+        $desc = '';
87
+        if ($db['description']) {
88
+            $desc = ' - <em>'.$db['description'].'</em>';
89
+        }
90
+        $form .= '<p><input type="checkbox" id="access_'.$db['name'].'" name="access[]" value="'.$db['name'].'" /> <label for="access_'.$db['name'].'">'.$db['name'].$desc.'</label></p>';
89 91
     }
90
-    $form .= '<p><input type="checkbox" id="access_'.$db['name'].'" name="access[]" value="'.$db['name'].'" /> <label for="access_'.$db['name'].'">'.$db['name'].$desc.'</label></p>';
91
-  }
92 92
 } else {
93
-  $form .= '<p><em>Bisher gibt es noch keine Datenbanken.</em></p>';
93
+    $form .= '<p><em>Bisher gibt es noch keine Datenbanken.</em></p>';
94 94
 }
95 95
  
96 96
 $form .= '<p><input type="submit" name="submit" value="Speichern"/><p>';
97 97
 
98 98
 
99 99
 output(html_form('mysql_newuser', 'save', 'action=newuser', $form));
100
-
Browse code

Copyright year update

Bernd Wurst authored on13/01/2018 06:07:05
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Zeige deutlich an, welche MySQL-Namen erlaubt sind. Und zeige eine unübersehbare Fehlermeldung an wenn etwas nicht stimmt.

Bernd Wurst authored on12/03/2014 05:09:01
Showing1 changed files
... ...
@@ -65,9 +65,15 @@ while (in_array($suggestion, $usernames)) {
65 65
   $count++;
66 66
 }
67 67
 
68
+$hint = 'Der MySQL-Benutzername muss entweder <strong>'.$username.'</strong> lauten oder mit <strong>'.$username.'_</strong> beginnen.';
69
+if (in_array($username, $usernames)) {
70
+  $hint = 'Der MySQL-Benutzername muss mit <strong>'.$username.'_</strong> beginnen.';
71
+}
72
+
73
+
68 74
 $form = '<h4>Benutzername</h4>
69 75
 <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>
76
+<p>Bitte nur Kleinbuchstaben, Zahlen und Unterstrich verwenden. '.$hint.'</p>
71 77
 <p>Aufgrund einer Einschränkung des MySQL-Servers dürfen Benutzernamen nur maximal 16 Zeichen lang sein.</p>
72 78
 <p><label for="description">Optionale Beschreibung dieses Benutzers:</label> <input type="text" name="description" id="description" /></p>
73 79
 <h4>Passwort</h4>
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on08/02/2014 05:45:07
Showing1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2013 by schokokeks.org Hosting, namely
5
+Written 2008-2014 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Passwort-Erzeugung auch beim Ändern des MySQL-Passworts

Bernd Wurst authored on13/03/2013 11:19:19
Showing1 changed files
... ...
@@ -71,7 +71,7 @@ $form = '<h4>Benutzername</h4>
71 71
 <p>Aufgrund einer Einschränkung des MySQL-Servers dürfen Benutzernamen nur maximal 16 Zeichen lang sein.</p>
72 72
 <p><label for="description">Optionale Beschreibung dieses Benutzers:</label> <input type="text" name="description" id="description" /></p>
73 73
 <h4>Passwort</h4>
74
-<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>
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>
75 75
 <p style="display: none;">Automatisch erzeugtes Passwort: <input id="newpass_display" type="text" readonly="readonly" /></p>
76 76
 <h4>Berechtigungen</h4>';
77 77
 if (count($dbs) > 0) {
Browse code

Neue MySQL-Verwaltung

Bernd Wurst authored on28/02/2013 15:51:12
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,94 @@
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>
74
+<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>
75
+<p style="display: none;">Automatisch erzeugtes Passwort: <input id="newpass_display" type="text" readonly="readonly" /></p>
76
+<h4>Berechtigungen</h4>';
77
+if (count($dbs) > 0) {
78
+  $form .= '<p>Auf welche der bisher vorhandenen Datenbanken darf dieser Benutzer zugreifen?</p>';
79
+  foreach ($dbs as $db) {
80
+    $desc = '';
81
+    if ($db['description']) {
82
+      $desc = ' - <em>'.$db['description'].'</em>';
83
+    }
84
+    $form .= '<p><input type="checkbox" id="access_'.$db['name'].'" name="access[]" value="'.$db['name'].'" /> <label for="access_'.$db['name'].'">'.$db['name'].$desc.'</label></p>';
85
+  }
86
+} else {
87
+  $form .= '<p><em>Bisher gibt es noch keine Datenbanken.</em></p>';
88
+}
89
+ 
90
+$form .= '<p><input type="submit" name="submit" value="Speichern"/><p>';
91
+
92
+
93
+output(html_form('mysql_newuser', 'save', 'action=newuser', $form));
94
+