da2eaa6d6f8367bf912f8f72272dedd012cbf3e2
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) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 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) 
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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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

Bernd Wurst authored 12 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 12 years ago

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

Hanno authored 5 years ago

29)     if (!isset($subuser)) {
30)         system_failure('Der Account den Sie bearbeiten möchten wurde nicht gefunden!');
31)     }
32)     title("Zusätzlichen Admin-Zugang bearbeiten");
33)     $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

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

Hanno authored 5 years ago

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

Bernd Wurst authored 12 years ago

38) }
39) 
40) // Username davor entfernen
41) $subuser['username'] = str_replace($_SESSION['userinfo']['username'].'_', '', $subuser['username']);
42) 
bernd Berechtigungen für Subuser...

bernd authored 12 years ago

43) 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

44) 
45) 
46) $form = '<table>
47) <tr><td><strong><label for="username">Benutzername:</label></td><td>'.$_SESSION['userinfo']['username'].'_<input type="text" name="username" id="username" value="'.$subuser['username'].'" /></td></tr>
48) <tr><td><strong><label for="password">Passwort:</label></td><td><input type="password" name="password" id="password" value="" />'.$pwnotice.'</td></tr>
49) <tr><td style="vertical-align: top;">Berechtigungen:</td><td>';
bernd Lese Modul-Infos aus den in...

bernd authored 12 years ago

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

Bernd Wurst authored 12 years ago

51) foreach ($modinfo as $key => $desc) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

52)     $checked = in_array($key, $subuser['modules']) ? 'checked="checked "' : '';
53)     $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

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

bernd authored 12 years ago

55) $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>