bernd commited on 2008-09-22 19:56:03
Zeige 4 geänderte Dateien mit 32 Einfügungen und 0 Löschungen.
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1159 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -151,6 +151,12 @@ echo '<p class="userinfo">Angemeldet als:<br />'; |
151 | 151 |
} |
152 | 152 |
echo '</p>'; |
153 | 153 |
} |
154 |
+ |
|
155 |
+if (isset($_SESSION['admin_user'])) { |
|
156 |
+ echo '<p class="admininfo">'; |
|
157 |
+ echo '<a href="'.$prefix.'go/su/back_to_admin">Zurück zu »'.$_SESSION['admin_user'].'«</a>'; |
|
158 |
+ echo '</p>'; |
|
159 |
+} |
|
154 | 160 |
?> |
155 | 161 |
|
156 | 162 |
</div> |
... | ... |
@@ -0,0 +1,17 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+require_once('inc/debug.php'); |
|
4 |
+ |
|
5 |
+if (isset($_SESSION['admin_user']) ) { |
|
6 |
+ $admin_user = $_SESSION['admin_user']; |
|
7 |
+ $role = find_role($admin_user, '', True); |
|
8 |
+ if ($role & ROLE_SYSADMIN) { |
|
9 |
+ setup_session($role, $admin_user); |
|
10 |
+ unset($_SESSION['admin_user']); |
|
11 |
+ header('Location: '.$prefix.'go/su/su'); |
|
12 |
+ die(); |
|
13 |
+ } |
|
14 |
+} |
|
15 |
+system_failure('Unprivilleged action'); |
|
16 |
+ |
|
17 |
+ |
... | ... |
@@ -12,6 +12,7 @@ if (isset($_GET['type'])) |
12 | 12 |
{ |
13 | 13 |
check_form_token('su_su_ajax', $_GET['formtoken']); |
14 | 14 |
$role = NULL; |
15 |
+ $admin_user = $_SESSION['userinfo']['username']; |
|
15 | 16 |
if ($_GET['type'] == 'customer') { |
16 | 17 |
$role = find_role($_GET['id'], '', True); |
17 | 18 |
setup_session($role, $_GET['id']); |
... | ... |
@@ -21,6 +22,7 @@ if (isset($_GET['type'])) |
21 | 22 |
} else { |
22 | 23 |
system_failure('unknown type'); |
23 | 24 |
} |
25 |
+ $_SESSION['admin_user'] = $admin_user; |
|
24 | 26 |
|
25 | 27 |
header('Location: ../../go/index/index'); |
26 | 28 |
die(); |
27 | 29 |