if (is_a($res, 'PEAR_Error'))
return false;
while ($val = $res->fetchRow()) {
- $isClient = in_array('track_own_time', explode(',', $val['rights'])) ? 0 : 1; // Clients do not have data entry right.
+ $isClient = in_array('track_own_time', explode(',', $val['rights'])) ? 0 : 1; // Clients do not have track_own_time right.
if ($isClient)
continue; // Skip adding clients.
$user_list[] = $val;
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.69.4156 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.69.4157 | 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>
{if $user->id == $user_id}
<tr>
<td align="right">{$i18n.form.users.role}:</td>
- <td>{$user->role_name} {if $user->can('swap_roles')}<a href="swap_roles.php">{$i18n.form.profile.swap_roles}</a>{/if}</td>
+ <td>{$user->role_name} {if $can_swap}<a href="swap_roles.php">{$i18n.form.profile.swap_roles}</a>{/if}</td>
</tr>
{/if}
<tr>
exit();
}
-
-
$cl_id = $request->getParameter('id');
$expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser());
import('form.Form');
import('ttPredefinedExpenseHelper');
-// Access check.
-if (!ttAccessAllowed('manage_advanced_settings') || !$user->isPluginEnabled('ex')) {
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('ex')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
import('form.Form');
import('ttPredefinedExpenseHelper');
-// Access check.
-if (!ttAccessAllowed('manage_advanced_settings') || !$user->isPluginEnabled('ex')) {
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('ex')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_predefined_expense_id = (int)$request->getParameter('id');
$predefined_expense = ttPredefinedExpenseHelper::get($cl_predefined_expense_id);
import('form.Form');
import('ttPredefinedExpenseHelper');
-// Access check.
-if (!ttAccessAllowed('manage_advanced_settings') || !$user->isPluginEnabled('ex')) {
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('ex')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$predefined_expense_id = (int) $request->getParameter('id');
import('form.Form');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('manage_advanced_settings') || !$user->isPluginEnabled('ex')) {
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('ex')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$form = new Form('predefinedExpensesForm');
import('ttProjectHelper');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('manage_projects') || (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode)) {
+// Access checks.
+if (!ttAccessAllowed('manage_projects')) {
header('Location: access_denied.php');
exit();
}
+if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$users = ttTeamHelper::getActiveUsers();
foreach ($users as $user_item)
import('form.Form');
import('ttProjectHelper');
-// Access check.
-if (!ttAccessAllowed('manage_projects') || (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode)) {
+// Access checks.
+if (!ttAccessAllowed('manage_projects')) {
header('Location: access_denied.php');
exit();
}
+if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_project_id = (int)$request->getParameter('id');
$project = ttProjectHelper::get($cl_project_id);
import('ttProjectHelper');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('manage_projects') || (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode)) {
+// Access checks.
+if (!ttAccessAllowed('manage_projects')) {
header('Location: access_denied.php');
exit();
}
+if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+ header('Location: feature_disabled.php');
+ exit();
+}
$cl_project_id = (int)$request->getParameter('id');
import('form.Form');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('track_own_time') || (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode)) {
+// Access checks.
+if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) {
header('Location: access_denied.php');
exit();
}
+if (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode) {
+ header('Location: feature_disabled.php');
+ exit();
+}
if($user->canManageTeam()) {
$active_projects = ttTeamHelper::getActiveProjects($user->team_id);
import('ttTeamHelper');
import('ttTimeHelper');
-// Access check.
-if (!ttAccessAllowed('manage_advanced_settings') || !$user->isPluginEnabled('mq')) {
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('mq')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
// Start and end fallback values for the Year dropdown.
$yearStart = 2015;
import('ttTeamHelper');
// Access check.
-if (!ttAccessAllowed('view_own_reports')) {
+if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports'))) {
header('Location: access_denied.php');
exit();
}
import('ttReportHelper');
// Access check.
-if (!ttAccessAllowed('view_own_reports')) {
+if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports'))) {
header('Location: access_denied.php');
exit();
}
import('ttClientHelper');
// Access check.
-if (!ttAccessAllowed('view_own_reports')) {
+if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports'))) {
header('Location: access_denied.php');
exit();
}
import('ttTaskHelper'); // TODO: remove this?
import('ttRoleHelper');
-// Access check.
+// Access checks.
if (!ttAccessAllowed('manage_roles')) {
header('Location: access_denied.php');
exit();
header('Location: access_denied.php');
exit();
}
+
$assigned_rights = explode(',', $role['rights']);
$available_rights = array_diff($user->rights, $assigned_rights);
import('form.Form');
import('ttUserHelper');
-// Access check.
+// Access checks.
if (!ttAccessAllowed('swap_roles')) {
header('Location: access_denied.php');
exit();
}
-
-$users = ttTeamHelper::getUsersForSwap();
+$users_for_swap = ttTeamHelper::getUsersForSwap();
+if (!is_array($users_for_swap) || sizeof($users_for_swap) == 0) {
+ header('Location: access_denied.php');
+ exit();
+}
if ($request->isPost()) {
$cl_id = $request->getParameter('swap_with');
}
$form = new Form('swapForm');
-$form->addInput(array('type'=>'combobox','name'=>'swap_with','style'=>'width: 250px;','data'=>$users,'datakeys'=>array('id','name')));
+$form->addInput(array('type'=>'combobox','name'=>'swap_with','style'=>'width: 250px;','data'=>$users_for_swap,'datakeys'=>array('id','name')));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->get('button.submit')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel')));
}
} // isPost
+$can_swap = false;
+if ($user->id == $user_id && $user->can('swap_roles')) {
+ $users_for_swap = ttTeamHelper::getUsersForSwap();
+ if (is_array($users_for_swap) && sizeof($users_for_swap) > 0)
+ $can_swap = true;
+}
+
$rates = ttProjectHelper::getRates($user_id);
$smarty->assign('rates', $rates);
$smarty->assign('auth_external', $auth->isPasswordExternal());
$smarty->assign('active_roles', $active_roles);
+$smarty->assign('can_swap', $can_swap);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.userForm.name.focus();handleClientControl();"');
$smarty->assign('user_id', $user_id);