|
|
|
@ -6,6 +6,13 @@ |
|
|
|
|
* This script initiates a video conference session, calling the BigBlueButton API. |
|
|
|
|
*/ |
|
|
|
|
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables |
|
|
|
|
$isGlobal = isset($_GET['global']) ? true : false; |
|
|
|
|
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false; |
|
|
|
|
|
|
|
|
|
// If global setting is used then we delete the course sessions (cidReq/id_session) |
|
|
|
|
if ($isGlobalPerUser || $isGlobal) { |
|
|
|
|
$cidReset = true; |
|
|
|
|
} |
|
|
|
|
require_once __DIR__.'/config.php'; |
|
|
|
|
|
|
|
|
|
$plugin = BBBPlugin::create(); |
|
|
|
@ -14,8 +21,6 @@ $roomTable = Database::get_main_table('plugin_bbb_room'); |
|
|
|
|
|
|
|
|
|
$htmlHeadXtra[] = api_get_js_simple(api_get_path(WEB_PLUGIN_PATH).'bbb/resources/utils.js'); |
|
|
|
|
|
|
|
|
|
$isGlobal = isset($_GET['global']) ? true : false; |
|
|
|
|
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false; |
|
|
|
|
$action = isset($_GET['action']) ? $_GET['action'] : ''; |
|
|
|
|
$userId = api_get_user_id(); |
|
|
|
|
|
|
|
|
@ -212,11 +217,13 @@ if ($conferenceManager) { |
|
|
|
|
|
|
|
|
|
if (!empty($roomData)) { |
|
|
|
|
$roomId = $roomData['id']; |
|
|
|
|
Database::update( |
|
|
|
|
$roomTable, |
|
|
|
|
['out_at' => api_get_utc_datetime()], |
|
|
|
|
['id = ? ' => $roomId] |
|
|
|
|
); |
|
|
|
|
if (!empty($roomId)) { |
|
|
|
|
Database::update( |
|
|
|
|
$roomTable, |
|
|
|
|
['out_at' => api_get_utc_datetime()], |
|
|
|
|
['id = ? ' => $roomId] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
@ -239,11 +246,13 @@ if ($conferenceManager) { |
|
|
|
|
|
|
|
|
|
if (!empty($roomData)) { |
|
|
|
|
$roomId = $roomData['id']; |
|
|
|
|
Database::update( |
|
|
|
|
$roomTable, |
|
|
|
|
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE], |
|
|
|
|
['id = ? ' => $roomId] |
|
|
|
|
); |
|
|
|
|
if (!empty($roomId)) { |
|
|
|
|
Database::update( |
|
|
|
|
$roomTable, |
|
|
|
|
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE], |
|
|
|
|
['id = ? ' => $roomId] |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$message = Display::return_message( |
|
|
|
@ -293,17 +302,19 @@ if ($conferenceManager) { |
|
|
|
|
|
|
|
|
|
$i = 0; |
|
|
|
|
foreach ($roomData as $item) { |
|
|
|
|
$roomId = $roomData['id']; |
|
|
|
|
if (0 == $i) { |
|
|
|
|
Database::update( |
|
|
|
|
$roomTable, |
|
|
|
|
['out_at' => api_get_utc_datetime()], |
|
|
|
|
['id = ? ' => $roomId] |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
Database::update($roomTable, ['close' => BBBPlugin::ROOM_CLOSE], ['id = ? ' => $roomId]); |
|
|
|
|
} |
|
|
|
|
$roomId = $item['id']; |
|
|
|
|
if (!empty($roomId)) { |
|
|
|
|
if ($i == 0) { |
|
|
|
|
Database::update( |
|
|
|
|
$roomTable, |
|
|
|
|
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE], |
|
|
|
|
['id = ? ' => $roomId] |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
Database::update($roomTable, ['close' => BBBPlugin::ROOM_CLOSE], ['id = ? ' => $roomId]); |
|
|
|
|
} |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$message = Display::return_message( |
|
|
|
@ -367,6 +378,15 @@ if (false === $bbb->isGlobalConference() && |
|
|
|
|
if ($conferenceManager) { |
|
|
|
|
$groups = GroupManager::get_groups(); |
|
|
|
|
} else { |
|
|
|
|
if (!empty($groupId)) { |
|
|
|
|
$groupInfo = GroupManager::get_group_properties($groupId); |
|
|
|
|
if ($groupInfo) { |
|
|
|
|
$isSubscribed = GroupManager::is_user_in_group(api_get_user_id(), $groupInfo); |
|
|
|
|
if (false === $isSubscribed) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$groups = GroupManager::getAllGroupPerUserSubscription( |
|
|
|
|
api_get_user_id(), |
|
|
|
|
api_get_course_int_id(), |
|
|
|
|