Browse code

Setze lastlogin nur bei Nicht-Admin-Logins

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1919 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on 12/02/2011 07:58:16
Showing 2 changed files
... ...
@@ -13,6 +13,7 @@ if (isset($_GET['type']))
13 13
   check_form_token('su_su_ajax', $_GET['formtoken']);
14 14
   $role = NULL;
15 15
   $admin_user = $_SESSION['userinfo']['username'];
16
+  $_SESSION['admin_user'] = $admin_user;
16 17
   if ($_GET['type'] == 'customer') {
17 18
     $role = find_role($_GET['id'], '', True);
18 19
     setup_session($role, $_GET['id']);
... ...
@@ -22,7 +23,6 @@ if (isset($_GET['type']))
22 23
   } else {
23 24
     system_failure('unknown type');
24 25
   }
25
-  $_SESSION['admin_user'] = $admin_user;
26 26
 
27 27
   header('Location: ../../go/index/index');
28 28
   die();
... ...
@@ -258,7 +258,9 @@ function setup_session($role, $useridentity)
258 258
   {
259 259
     $info = get_customer_info($useridentity);
260 260
     $_SESSION['customerinfo'] = $info;
261
-    set_customer_lastlogin($info['customerno']);
261
+    if (!isset($_SESSION['admin_user'])) {
262
+      set_customer_lastlogin($info['customerno']);
263
+    }
262 264
     logger(LOG_INFO, "session/start", "login", "logged in customer no »{$info['customerno']}«");
263 265
   }
264 266
   if ($role & ROLE_MAILACCOUNT)