if ($user->behalf_id && (!$user->can('view_charts') || !$user->checkBehalfId())) {
header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
exit();
if ($user->behalf_id && (!$user->can('view_charts') || !$user->checkBehalfId())) {
header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user.
exit();