import('ttUserHelper');
import('ttTeamHelper');
-// Access check.
-if (!ttAccessAllowed('view_own_charts') || !$user->isPluginEnabled('ch')) {
+// Access checks.
+if (!ttAccessAllowed('view_own_charts')) {
header('Location: access_denied.php');
exit();
}
+if (!$user->isPluginEnabled('ch')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
// Initialize and store date in session.
$cl_date = $request->getParameter('date', @$_SESSION['date']);
}
// If user has changed - set behalf_id accordingly in the session.
if ($request->getParameter('onBehalfUser')) {
- if($user->canManageTeam()) {
+ if($user->can('view_charts')) {
unset($_SESSION['behalf_id']);
unset($_SESSION['behalf_name']);
$chart_form = new Form('chartForm');
// User dropdown. Changes the user "on behalf" of whom we are working.
-if ($user->canManageTeam()) {
+if ($user->can('view_charts')) {
$user_list = ttTeamHelper::getActiveUsers(array('putSelfFirst'=>true));
if (count($user_list) > 1) {
$chart_form->addInput(array('type'=>'combobox',