019f36be3c3c52ccf9e9c47bc089345c7f14ee4f
bernd Su-Login für Admins

bernd authored 16 years ago

1) <?php
2) 
3) require_once('inc/debug.php');
4) 
5) require_once('session/start.php');
6) require_once('su.php');
7) 
8) require_role(ROLE_SYSADMIN);
9) 
10) if (isset($_POST['submit']))
11) {
12)   check_form_token('su_su');
13)   $id = (int) $_POST['destination'];
14)   $role = find_role($id, '', True);
15)   setup_session($role, $id);
16) 
17)   header('Location: ../../go/index/index.php');
18)   die();
19) }
20) 
21) 
22) 
23) $title = "Benutzer wechseln";
24) 
25) output('<h3>Benutzer wechseln</h3>
26) <p>Hiermit können Sie (als Admin) das Webinterface mit den Rechten eines beliebigen anderen Benutzers benutzen.</p>
27) <p>Benutzer auswählen: ');
28) 
29) $users = list_system_users();
30) $options = '';
31) foreach ($users as $user)
32) {
33)   $options .= "  <option value=\"{$user->uid}\">{$user->username} ({$user->uid})</option>\n";
34) }
35) 
36) output(html_form('su_su', 'su.php', '', '<select name="destination" size="1">
37) '.$options.'
38) </select>
39) <input type="submit" name="submit" value="zum Benutzer wechseln" />
40) '));
bernd XML-Fehler

bernd authored 16 years ago

41) output('</p><p>Kunde auswählen: ');
bernd Su-Login für Admins

bernd authored 16 years ago

42) 
43) $customers = list_customers();
44) $options = '';
45) foreach ($customers as $customer)
46) {
47)   $options .= "  <option value=\"{$customer->id}\">{$customer->id} - {$customer->name}</option>\n";
48) }
49) 
50) output(html_form('su_su', 'su.php', '', '<select name="destination" size="1">
51) '.$options.'
52) </select>
53) <input type="submit" name="submit" value="zum Kunden wechseln" />
54) '));
bernd XML-Fehler

bernd authored 16 years ago

55) output("</p><br />");