bernd commited on 2007-08-09 20:20:29
Zeige 6 geänderte Dateien mit 31 Einfügungen und 25 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@612 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -20,18 +20,18 @@ if ($_POST['password1'] != '') |
20 | 20 |
if ($result == NULL) |
21 | 21 |
input_error('Das bisherige Passwort ist nicht korrekt!'); |
22 | 22 |
elseif ($_POST['password2'] != $_POST['password1']) |
23 |
- input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!'); |
|
23 |
+ input_error('Die Bestätigung ist nicht identisch mit dem neuen Passwort!'); |
|
24 | 24 |
elseif ($_POST['password2'] == '') |
25 |
- input_error('Sie müssen das neue Passwort zweimal eingeben!'); |
|
25 |
+ input_error('Sie müssen das neue Passwort zweimal eingeben!'); |
|
26 | 26 |
elseif ($_POST['old_password'] == '') |
27 | 27 |
input_error('Altes Passwort nicht angegeben!'); |
28 | 28 |
elseif (($check = strong_password($_POST['password1'])) !== true) |
29 | 29 |
input_error("Das Passwort ist zu einfach (cracklib sagt: {$check})!"); |
30 | 30 |
else |
31 | 31 |
{ |
32 |
- if ($result === ROLE_SYSTEMUSER) |
|
32 |
+ if ($result & ROLE_SYSTEMUSER) |
|
33 | 33 |
set_systemuser_password($_SESSION['userinfo']['uid'], $_POST['password1']); |
34 |
- elseif ($result === ROLE_CUSTOMER) |
|
34 |
+ elseif ($result & ROLE_CUSTOMER) |
|
35 | 35 |
set_customer_password($_SESSION['customerinfo']['customerno'], $_POST['password1']); |
36 | 36 |
else |
37 | 37 |
system_failure("WTF?! (\$result={$result})"); |
... | ... |
@@ -50,9 +50,7 @@ if ($_SESSION['role'] & ROLE_SYSTEMUSER) |
50 | 50 |
|
51 | 51 |
output('<h3>Passwort ändern</h3> |
52 | 52 |
<p>Hier können Sie Ihr Passwort ändern.</p> |
53 |
-<form method="post" action="'.($debugmode ? '?debug' : '').'"> |
|
54 |
-'.generate_form_token('index_chpass').' |
|
55 |
-<table> |
|
53 |
+'.html_form('index_chpass', 'chpass.php', '', '<table> |
|
56 | 54 |
<tr> |
57 | 55 |
<td>bisheriges Passwort:</td> <td><input type="password" name="old_password" value="" /></td> |
58 | 56 |
</tr> |
... | ... |
@@ -66,9 +64,9 @@ output('<h3>Passwort ändern</h3> |
66 | 64 |
<tr> |
67 | 65 |
<td> </td><td><input type="submit" value="Speichern" /></td> |
68 | 66 |
</tr> |
69 |
-</table> |
|
70 |
-</form> |
|
67 |
+</table>')); |
|
68 |
+ |
|
69 |
+ |
|
71 | 70 |
|
72 |
-'); |
|
73 | 71 |
|
74 | 72 |
?> |
... | ... |
@@ -121,7 +121,7 @@ if ($output_something) |
121 | 121 |
<tr><th style="background-color: #729bb3; color: #fff;padding: 0.2em; text-align: left;">Datenbanken</th>'; |
122 | 122 |
|
123 | 123 |
foreach ($users as $user) |
124 |
- $form .= "<th>{$user}<br /><a href=\"?".($debugmode ? 'debug&': '')."action=delete_user&user={$user}\"><img border=\"0\" src=\"{$prefix}images/delete.png\" title=\"Benutzer »{$user}« löschen\" alt=\"löschen\" /></a></th>"; |
|
124 |
+ $form .= "<th>{$user}<br /><a href=\"?".($debugmode ? 'debug&': '')."action=delete_user&user={$user}\"><img src=\"{$prefix}images/delete.png\" title=\"Benutzer »{$user}« löschen\" alt=\"löschen\" /></a></th>"; |
|
125 | 125 |
$form .= '<th><input type="text" name="new_user" size="10" value="" /></th></tr> |
126 | 126 |
'; |
127 | 127 |
|
... | ... |
@@ -129,7 +129,7 @@ if ($output_something) |
129 | 129 |
|
130 | 130 |
foreach($dbs as $db) |
131 | 131 |
{ |
132 |
- $form .= "<tr><td style=\"border: 0px; font-weight: bold; text-align: right;\">{$db} <a href=\"?".($debugmode ? 'debug&': '')."action=delete_db&db={$db}\"><img border=\"0\" src=\"{$prefix}images/delete.png\" title=\"Datenbank »{$db}« löschen\" alt=\"löschen\" /></a></td>"; |
|
132 |
+ $form .= "<tr><td style=\"border: 0px; font-weight: bold; text-align: right;\">{$db} <a href=\"?".($debugmode ? 'debug&': '')."action=delete_db&db={$db}\"><img src=\"{$prefix}images/delete.png\" title=\"Datenbank »{$db}« löschen\" alt=\"löschen\" /></a></td>"; |
|
133 | 133 |
foreach ($users as $user) |
134 | 134 |
$form .= '<td style="text-align: center;"><input type="checkbox" id="'.$db.'_'.$user.'" name="access['.$db.'][]" value="'.$user.'" '.(get_mysql_access($db, $user) ? 'checked="checked" ' : '')." /></td>"; |
135 | 135 |
$form .= "</tr>\n"; |
... | ... |
@@ -141,8 +141,7 @@ if ($output_something) |
141 | 141 |
$form .= '<td style="text-align: center;"><input type="checkbox" id="new_'.$user.'" name="access[new][]" value="'.$user.'" /></td>'; |
142 | 142 |
$form .= '</tr> |
143 | 143 |
</table> |
144 |
- <br /> |
|
145 |
- <input type="submit" value="Speichern" /><br />'; |
|
144 |
+ <p><input type="submit" value="Speichern" /></p>'; |
|
146 | 145 |
|
147 | 146 |
|
148 | 147 |
output(html_form('mysql_databases', 'databases.php', '', $form)); |
... | ... |
@@ -150,18 +149,20 @@ if ($output_something) |
150 | 149 |
$users = get_mysql_accounts($_SESSION['userinfo']['uid']); |
151 | 150 |
|
152 | 151 |
|
153 |
- $form = ' |
|
154 |
- <label for="username">Benutzername:</label> <select name="mysql_username" id="username" height="1"> |
|
152 |
+ $form = '<div> |
|
153 |
+ <label for="username">Benutzername:</label> <select name="mysql_username" id="username"> |
|
155 | 154 |
'; |
156 | 155 |
foreach ($users as $user) |
157 | 156 |
$form .= "<option value=\"{$user}\">{$user}</option>\n"; |
158 | 157 |
$form .= '</select> |
159 |
- <label for="password">Passwort:</label> <input type="password" name="mysql_password" id="password" /> <input type="submit" value="Setzen" />'; |
|
158 |
+ <label for="password">Passwort:</label> <input type="password" name="mysql_password" id="password" /> <input type="submit" value="Setzen" /> |
|
159 |
+</div> |
|
160 |
+'; |
|
160 | 161 |
|
161 | 162 |
output('<h4>Passwort ändern</h4> |
162 | 163 |
<p>Hier können Sie das Passwort eines MySQL-Benutzeraccounts ändern bzw. neu setzen</p> |
163 | 164 |
|
164 |
- <p>'.html_form('mysql_databases', 'databases.php', 'action=change_pw', $form).'</p>'); |
|
165 |
+ '.html_form('mysql_databases', 'databases.php', 'action=change_pw', $form)); |
|
165 | 166 |
|
166 | 167 |
} |
167 | 168 |
|
... | ... |
@@ -24,7 +24,7 @@ $title = "Benutzer wechseln"; |
24 | 24 |
|
25 | 25 |
output('<h3>Benutzer wechseln</h3> |
26 | 26 |
<p>Hiermit können Sie (als Admin) das Webinterface mit den Rechten eines beliebigen anderen Benutzers benutzen.</p> |
27 |
-<p>Benutzer auswählen: '); |
|
27 |
+'); |
|
28 | 28 |
|
29 | 29 |
$users = list_system_users(); |
30 | 30 |
$options = ''; |
... | ... |
@@ -33,12 +33,13 @@ foreach ($users as $user) |
33 | 33 |
$options .= " <option value=\"{$user->uid}\">{$user->username} ({$user->uid})</option>\n"; |
34 | 34 |
} |
35 | 35 |
|
36 |
-output(html_form('su_su', 'su.php', '', '<select name="destination" size="1"> |
|
36 |
+output(html_form('su_su', 'su.php', '', '<p>Benutzer auswählen: |
|
37 |
+<select name="destination" size="1"> |
|
37 | 38 |
'.$options.' |
38 | 39 |
</select> |
39 | 40 |
<input type="submit" name="submit" value="zum Benutzer wechseln" /> |
41 |
+</p> |
|
40 | 42 |
')); |
41 |
-output('</p><p>Kunde auswählen: '); |
|
42 | 43 |
|
43 | 44 |
$customers = list_customers(); |
44 | 45 |
$options = ''; |
... | ... |
@@ -47,12 +48,13 @@ foreach ($customers as $customer) |
47 | 48 |
$options .= " <option value=\"{$customer->id}\">{$customer->id} - {$customer->name}</option>\n"; |
48 | 49 |
} |
49 | 50 |
|
50 |
-output(html_form('su_su', 'su.php', '', '<select name="destination" size="1"> |
|
51 |
+output(html_form('su_su', 'su.php', '', '<p>Kunde auswählen: |
|
52 |
+<select name="destination" size="1"> |
|
51 | 53 |
'.$options.' |
52 | 54 |
</select> |
53 | 55 |
<input type="submit" name="submit" value="zum Kunden wechseln" /> |
56 |
+</p> |
|
54 | 57 |
')); |
55 |
-output("</p><br />"); |
|
56 | 58 |
|
57 | 59 |
|
58 | 60 |
|
... | ... |
@@ -8,6 +8,7 @@ require_role(ROLE_CUSTOMER); |
8 | 8 |
|
9 | 9 |
|
10 | 10 |
$title = "System-Benutzeraccounts"; |
11 |
+$section = "systemuser_accounts"; |
|
11 | 12 |
|
12 | 13 |
$account = get_account_details($_GET['uid']); |
13 | 14 |
|
... | ... |
@@ -24,9 +25,10 @@ output(html_form('systemuser_edit', 'save.php', 'action=edit', ' |
24 | 25 |
<tr><td>Passwort:</td><td><input type="password" name="newpass" value="" /><br /><span style="font-size:85%;">(Bitte leer lassen um das Passwort nicht zu ändern!)</span></td></tr> |
25 | 26 |
<tr><td>Wiederholung:</td><td><input type="password" name="newpass2" value="" /></td></tr> |
26 | 27 |
</table> |
27 |
-<br /> |
|
28 |
+<p> |
|
28 | 29 |
<input type="hidden" name="uid" value="'.$account['uid'].'" /> |
29 | 30 |
<input type="submit" name="submit" value="Speichern" /> |
31 |
+</p> |
|
30 | 32 |
')); |
31 | 33 |
|
32 | 34 |
|
... | ... |
@@ -6,7 +6,7 @@ $role = $_SESSION['role']; |
6 | 6 |
|
7 | 7 |
if ($role & ROLE_CUSTOMER) |
8 | 8 |
{ |
9 |
- $menu["systemuser"] = array("label" => "Benutzeraccounts", "file" => "accounts.php", "weight" => 30); |
|
9 |
+ $menu["systemuser_accounts"] = array("label" => "Benutzeraccounts", "file" => "accounts.php", "weight" => 30); |
|
10 | 10 |
} |
11 | 11 |
|
12 | 12 |
if (empty($menu)) |
13 | 13 |