]> wagnertech.de Git - timetracker.git/blobdiff - mobile/expenses.php
Added an environment check for enabled libxml to address issue #67.
[timetracker.git] / mobile / expenses.php
index eeece00352eaf4dd2e11d6a95fa54fd7e9134870..ac565207ba3c04d3ac400b775a24faf8be970bfd 100644 (file)
@@ -42,6 +42,10 @@ if (!$user->isPluginEnabled('ex')) {
   header('Location: feature_disabled.php');
   exit();
 }
+if (!$user->exists()) {
+  header('Location: access_denied.php'); // Nobody to enter expenses for.
+  exit();
+}
 if ($user->behalf_id && (!$user->can('track_expenses') || !$user->checkBehalfId())) {
   header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
   exit();
@@ -65,9 +69,6 @@ if ($request->isPost() && $userChanged) {
   $user->setOnBehalfUser($user_id);
 } else {
   $user_id = $user->getUser();
-  // Handle a situation for no users in on behalf group.
-  if ($user->behalfGroup && $user_id == $user->id)
-    $user_id = null;
 }
 
 // Initialize and store date in session.