Skip to content

Commit

Permalink
Minor - format code, use api_get_user_id()
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Aug 3, 2017
1 parent 2bc3f22 commit 2ab2f84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions whoisonline.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
$social_right_content = '';
$whoisonline_list = '';
$social_search = '';
$userId = api_get_user_id();

// This if statement prevents users accessing the who's online feature when it has been disabled.
if ((api_get_setting('showonline', 'world') == 'true' && !$_user['user_id']) ||
((api_get_setting('showonline', 'users') == 'true' || api_get_setting('showonline', 'course') == 'true') && $_user['user_id'])
if ((api_get_setting('showonline', 'world') == 'true' && !$userId) ||
((api_get_setting('showonline', 'users') == 'true' ||
api_get_setting('showonline', 'course') == 'true') && $userId)
) {
if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) {
$user_list = who_is_online_in_this_course(
Expand Down Expand Up @@ -59,8 +61,7 @@
}
}
} else {
api_not_allowed();
exit;
api_not_allowed(true);
}

$tpl = new Template(get_lang('UsersOnLineList'));
Expand Down

0 comments on commit 2ab2f84

Please sign in to comment.