838077f18b71321a685c84329342e6a711d22d09
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) 
5) Written 2008-2012 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) 
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'])) {
23)   $list = list_subusers();
24)   foreach ($list as $x) {
25)     if ($x['id'] == $_GET['subuser']) {
26)       $subuser = $x;
27)     }
28)   }
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>';
34) } else {
35)   $subuser = empty_subuser();
36)   title("Zusätzlichen Admin-Zugang erstellen");
37)   $pwnotice = '';
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) {
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 />';
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>