import('ttUserHelper');
import('ttGroupHelper');
import('DateAndTime');
+import('ttTimeHelper');
import('ttExpenseHelper');
// Access checks.
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();
$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.
if ($selected_date->after($browser_today))
$err->add($i18n->get('error.future_date'));
}
+ if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired'));
// Finished validating input data.
// Prohibit creating entries in locked range.