X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=clients.php;h=a299d3061a2780d23c9f65e25be268d64d485686;hb=cabf2460445f26eded09e7d2c9c8cda97e8db593;hp=f02d4b951c7fa558d2e714647b7e69eb17adbb52;hpb=3222579993343da856339c1474d9d4b9a752167e;p=timetracker.git diff --git a/clients.php b/clients.php index f02d4b95..a299d306 100644 --- a/clients.php +++ b/clients.php @@ -29,15 +29,27 @@ require_once('initialize.php'); import('form.Form'); import('ttTeamHelper'); +import('ttGroupHelper'); -// Access check. -if (!ttAccessAllowed('manage_clients') || !$user->isPluginEnabled('cl')) { +// Access checks. +if (!(ttAccessAllowed('view_own_clients') || ttAccessAllowed('manage_clients'))) { header('Location: access_denied.php'); exit(); } +if (!$user->isPluginEnabled('cl')) { + header('Location: feature_disabled.php'); + exit(); +} +// End of access checks. + +if($user->can('manage_clients')) { + $active_clients = ttGroupHelper::getActiveClients(true); + $inactive_clients = ttGroupHelper::getInactiveClients(true); +} else + $active_clients = $user->getAssignedClients(); -$smarty->assign('active_clients', ttTeamHelper::getActiveClients($user->team_id, true)); -$smarty->assign('inactive_clients', ttTeamHelper::getInactiveClients($user->team_id, true)); -$smarty->assign('title', $i18n->getKey('title.clients')); +$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');