dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
bernd back-to-admin feature

bernd authored 16 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 2 years 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 2 years 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) */
bernd back-to-admin feature

bernd authored 16 years ago

13) 
14) require_once('inc/debug.php');
Bernd Wurst "back_to_admin" soll es ein...

Bernd Wurst authored 11 years ago

15) if (! isset($_SESSION['admin_user'])) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

16)     session_destroy();
17)     redirect($prefix.'go/su/su');
18)     die();
Bernd Wurst "back_to_admin" soll es ein...

Bernd Wurst authored 11 years ago

19) }
bernd back-to-admin feature

bernd authored 16 years ago

20) 
Bernd Wurst "back_to_admin" soll es ein...

Bernd Wurst authored 11 years ago

21) $admin_user = $_SESSION['admin_user'];
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

22) $role = find_role($admin_user, '', true);
Bernd Wurst "back_to_admin" soll es ein...

Bernd Wurst authored 11 years ago

23) if ($role & ROLE_SYSADMIN) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

24)     setup_session($role, $admin_user);
25)     unset($_SESSION['admin_user']);
26)     header('Location: '.$prefix.'go/su/su');
27)     die();
Bernd Wurst Generelle Su-Möglichkeit fü...

Bernd Wurst authored 9 years ago

28) } elseif ($role & ROLE_CUSTOMER) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

29)     setup_session($role, $admin_user);
30)     unset($_SESSION['admin_user']);
31)     header('Location: '.$prefix.'go/su/su_customer');
32)     die();