Browse code

"back_to_admin" soll es einfacher machen, sich wieder einzuloggen

Bernd Wurst authored on 29/01/2013 09:11:45
Showing 1 changed files
... ...
@@ -15,17 +15,20 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
15 15
 */
16 16
 
17 17
 require_once('inc/debug.php');
18
+if (! isset($_SESSION['admin_user'])) {
19
+  session_destroy();
20
+  redirect($prefix.'go/su/su');
21
+  die();
22
+}
18 23
 
19
-if (isset($_SESSION['admin_user']) ) {
20
-  $admin_user = $_SESSION['admin_user'];
21
-  $role = find_role($admin_user, '', True);
22
-  if ($role & ROLE_SYSADMIN) {
23
-    setup_session($role, $admin_user);
24
-    unset($_SESSION['admin_user']);
25
-    header('Location: '.$prefix.'go/su/su');
26
-    die();
27
-  }
24
+$admin_user = $_SESSION['admin_user'];
25
+$role = find_role($admin_user, '', True);
26
+if ($role & ROLE_SYSADMIN) {
27
+  setup_session($role, $admin_user);
28
+  unset($_SESSION['admin_user']);
29
+  header('Location: '.$prefix.'go/su/su');
30
+  die();
28 31
 }
29
-system_failure('Unprivilleged action');
32
+
30 33
 
31 34