X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/e7b081c97f2f2cfa69ca8df99afdeb8506eff726..e560c531255da8d1fa40295c58cc5c4b1bb4e9d3:/week.php diff --git a/week.php b/week.php index f1dc7889..741a2bb4 100644 --- a/week.php +++ b/week.php @@ -47,6 +47,14 @@ if (!$user->isPluginEnabled('wv')) { header('Location: feature_disabled.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 work on behalf. + exit(); +} // Initialize and store date in session. $cl_date = $request->getParameter('date', @$_SESSION['date']); @@ -203,8 +211,12 @@ class WeekViewCellRenderer extends DefaultCellRenderer { $form = new Form('weekTimeForm'); if ($user->can('track_time')) { - $user_list = ttTeamHelper::getActiveUsers(array('putSelfFirst'=>true)); - if (count($user_list) > 1) { + 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',