X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/c2b4a52bc12c6ee6204fd03d1d1b2534b7249554..e304b6c8564a6c3f2a3c6e68a0f5e9c7db817a65:/clients.php diff --git a/clients.php b/clients.php index 177bd61e..6bf48097 100644 --- a/clients.php +++ b/clients.php @@ -31,7 +31,7 @@ import('form.Form'); import('ttTeamHelper'); // Access checks. -if (!ttAccessAllowed('manage_clients')) { +if (!(ttAccessAllowed('view_own_clients') || ttAccessAllowed('manage_clients'))) { header('Location: access_denied.php'); exit(); } @@ -40,8 +40,14 @@ if (!$user->isPluginEnabled('cl')) { exit(); } -$smarty->assign('active_clients', ttTeamHelper::getActiveClients($user->group_id, true)); -$smarty->assign('inactive_clients', ttTeamHelper::getInactiveClients($user->group_id, true)); +if($user->can('manage_clients')) { + $active_clients = ttTeamHelper::getActiveClients($user->group_id, true); + $inactive_clients = ttTeamHelper::getInactiveClients($user->group_id, true); +} else + $active_clients = $user->getAssignedClients(); + +$smarty->assign('active_clients', $active_clients); +$smarty->assign('inactive_clients', $inactive_clients); $smarty->assign('title', $i18n->get('title.clients')); $smarty->assign('content_page_name', 'clients.tpl'); $smarty->display('index.tpl');