e21f00ce44d9b7ff1e1df44d162ceefe2ff2b64b
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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 1 year ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 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 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 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) 
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

14) require_role(ROLE_SYSTEMUSER);
15) include('subuser.php');
16) 
17) $section = 'subusers_subusers';
18) 
19) if (isset($_GET['subuser'])) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

20)     $list = list_subusers();
21)     foreach ($list as $x) {
22)         if ($x['id'] == $_GET['subuser']) {
23)             $subuser = $x;
24)         }
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

25)     }
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

26)     if (!isset($subuser)) {
27)         system_failure('Der Account den Sie bearbeiten möchten wurde nicht gefunden!');
28)     }
29)     title("Zusätzlichen Admin-Zugang bearbeiten");
30)     $pwnotice = ' <em>(Wenn Sie hier nichts eingeben, wird das alte Passwort beibehalten)</em>';
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

31) } else {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

32)     $subuser = empty_subuser();
33)     title("Zusätzlichen Admin-Zugang erstellen");
34)     $pwnotice = '';
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

35) }
36) 
37) // Username davor entfernen
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

38) $subuser['username'] = str_replace($_SESSION['userinfo']['username'] . '_', '', $subuser['username']);
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

39) 
bernd Berechtigungen für Subuser...

bernd authored 12 years ago

40) output('<p>Ein zusätzlicher Admin-Zugang darf die hier bestimmten Module dieses Webinterfaces mit den selben Möglichkeiten wie Sie selbst benutzen. Erlauben sie den Zugriff nur vertrauenswürdigen Dritten!</p>');
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

41) 
42) 
43) $form = '<table>
Hanno Böck more HTML fixes

Hanno Böck authored 3 months ago

44) <tr><td><strong><label for="username">Benutzername:</label></strong></td><td>' . $_SESSION['userinfo']['username'] . '_<input type="text" name="username" id="username" value="' . $subuser['username'] . '" /></td></tr>
45) <tr><td><strong><label for="password">Passwort:</label></strong></td><td><input type="password" name="password" id="password" value="" autocomplete="new-password">' . $pwnotice . '</td></tr>
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

46) <tr><td style="vertical-align: top;">Berechtigungen:</td><td>';
bernd Lese Modul-Infos aus den in...

bernd authored 12 years ago

47) $modinfo = available_modules();
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

48) foreach ($modinfo as $key => $desc) {
Hanno Böck more HTML fixes

Hanno Böck authored 3 months ago

49)     $checked = in_array($key, $subuser['modules']) ? 'checked="checked"' : '';
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

50)     $form .= '<input type="checkbox" name="modules[]" id="' . $key . '" value="' . $key . '" ' . $checked . '/> <label for="' . $key . '">' . $desc . '</label><br />';
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

51) }
bernd Berechtigungen für Subuser...

bernd authored 12 years ago

52) $form .= '<br /><em>(Nicht alle Berechtigungen haben alleinstehend eine Wirkung. Eventuell müssen Sie mehrere Berechtigungen erlauben um einen Effekt zu erhalten.)</em></td></tr>
Bernd Wurst Subusers-Modul in einer ers...

Bernd Wurst authored 12 years ago

53) <tr><td colspan="2"><input type="submit" value="Speichern" /></td></tr>
54) 
55) </table>';
56)