6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
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) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

17)   header('Location: ../../go/index/index');
bernd Su-Login für Admins

bernd authored 16 years ago

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>
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

27) ');
bernd Su-Login für Admins

bernd authored 16 years ago

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) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

36) output(html_form('su_su', 'su', '', '<p>Benutzer auswählen:
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

37) <select name="destination" size="1">
bernd Su-Login für Admins

bernd authored 16 years ago

38) '.$options.'
39) </select>
40) <input type="submit" name="submit" value="zum Benutzer wechseln" />
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

41) </p>
bernd Su-Login für Admins

bernd authored 16 years ago

42) '));
43) 
44) $customers = list_customers();
45) $options = '';
46) foreach ($customers as $customer)
47) {
48)   $options .= "  <option value=\"{$customer->id}\">{$customer->id} - {$customer->name}</option>\n";
49) }
50) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

51) output(html_form('su_su', 'su', '', '<p>Kunde auswählen:
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

52) <select name="destination" size="1">
bernd Su-Login für Admins

bernd authored 16 years ago

53) '.$options.'
54) </select>
55) <input type="submit" name="submit" value="zum Kunden wechseln" />
bernd Viele XHTML-Fehler korrigie...

bernd authored 16 years ago

56) </p>