<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.71.4165 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.71.4166 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
// die ("Your browser's cookie functionality is turned off. Please turn it on.");
// }
-// Access check.
+// Access checks.
if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) {
header('Location: access_denied.php');
exit();
}
+if ($user->behalf_id && (!$user->can('track_time') || !$user->checkBehalfId())) {
+ header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
+ exit();
+}
+if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId()) {
+ header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to view on behalf.
+ exit();
+}
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
// Elements of timeRecordForm.
$form = new Form('timeRecordForm');
-if ($user->canManageTeam()) {
- $user_list = ttTeamHelper::getActiveUsers(array('putSelfFirst'=>true));
- if (count($user_list) > 1) {
+if ($user->can('track_time')) {
+ if ($user->can('track_own_time'))
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1,'include_self'=>true,'self_first'=>true);
+ else
+ $options = array('status'=>ACTIVE,'max_rank'=>$user->rank-1);
+ $user_list = $user->getUsers($options);
+ if (count($user_list) >= 1) {
$form->addInput(array('type'=>'combobox',
'onchange'=>'this.form.submit();',
'name'=>'onBehalfUser',