Add setting "allow_online_users_by_status" see BT#15971

In order to show online counter by profile.
pull/2981/head
Julio Montoya 6 years ago
parent 7a692eed73
commit e6b7f3941f
  1. 15
      main/inc/lib/banner.lib.php
  2. 7
      main/install/configuration.dist.php

@ -222,6 +222,21 @@ function accessToWhoIsOnline()
$access = true;
}
if ($access === true) {
$profileList = api_get_configuration_value('allow_online_users_by_status');
if (!empty($profileList) && isset($profileList['status'])) {
$userInfo = api_get_user_info();
if ($userInfo['is_admin']) {
$userInfo['status'] = PLATFORM_ADMIN;
}
$profileList = $profileList['status'];
$access = false;
if (in_array($userInfo['status'], $profileList)) {
$access = true;
}
}
}
return $access;
}

@ -1289,6 +1289,13 @@ requires extension "php-soap" sudo apt-get install php-soap
// Hide course sidebar
//$_configuration['hide_course_sidebar'] = true;
// Allow online users by user profile
// 1 = COURSEMANAGER (teacher)
// 5 = STUDENT
// 11 = PLATFORM_ADMIN
// Example: The online users will be available only for teachers and students.
//$_configuration['allow_online_users_by_status'] = ['status' => [1, 5]];
// KEEP THIS AT THE END
// -------- Custom DB changes
// Add user activation by confirmation email

Loading…
Cancel
Save