$ids = $streamline->id; $dash = "-"; $meetingid = $meeting . $dash . $course . $dash . $ids; $meetingRunningUrl = bigbluebuttonbn_getIsMeetingRunningURL($meetingid, $bbbsession['url'], $bbbsession['salt']); $recordingsURL = bigbluebuttonbn_getRecordingsArray($meetingid, $bbbsession['url'], $bbbsession['salt']); $end_meeting_url = end_meeting(); $userID = $USER->id; $context = context_module::instance($cm->id); $context = context_course::instance($COURSE->id); $roles = get_user_roles($context, $USER->id, true); $participants = $streamline->participants; if ($streamline->participants == null || $streamline->participants == "[]") { //The room that is being used comes from a previous version $moderator = has_capability('mod/streamline:moderate', $context); } else { $moderator = bigbluebuttonbn_is_moderator($userID, $roles, $participants); } $administrator = has_capability('moodle/category:manage', $context); //104.155.215.138 $ipaddress = trim($CFG->ServerURLforBigBlueButton); $variable2 = substr($ipaddress, 0, strpos($ipaddress, "b")); $variable = trim(trim($variable2), '/') . '/'; $moodle_dir = $CFG->wwwroot; //Determine if user is the teacher $teacher_role = user_has_role_assignment($USER->id, 3); if ($teacher_role == 1) { $teacher = true; } else { $teacher = false; } //Determine if the meeting has ended based on on the 'meetingended' field in the DB
bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_ACTIVITY_VIEWED, $bigbluebuttonbn, $context, $cm); //////////////////////////////////////////////// ///// BigBlueButton Session Setup Starts ///// //////////////////////////////////////////////// // BigBluebuttonBN activity data $bbbsession['bigbluebuttonbn'] = $bigbluebuttonbn; // User data $bbbsession['username'] = fullname($USER); $bbbsession['userID'] = $USER->id; $bbbsession['roles'] = get_user_roles($context, $USER->id, true); // User roles if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { //The room that is being used comes from a previous version $bbbsession['moderator'] = has_capability('mod/bigbluebuttonbn:moderate', $context); } else { $bbbsession['moderator'] = bigbluebuttonbn_is_moderator($bbbsession['userID'], $bbbsession['roles'], $bigbluebuttonbn->participants); } $bbbsession['administrator'] = has_capability('moodle/category:manage', $context); $bbbsession['managerecordings'] = $bbbsession['administrator'] || has_capability('mod/bigbluebuttonbn:managerecordings', $context); // BigBlueButton server data $bbbsession['endpoint'] = bigbluebuttonbn_get_cfg_server_url(); $bbbsession['shared_secret'] = bigbluebuttonbn_get_cfg_shared_secret(); // Server data $bbbsession['modPW'] = $bigbluebuttonbn->moderatorpass; $bbbsession['viewerPW'] = $bigbluebuttonbn->viewerpass; // Database info related to the activity $bbbsession['meetingdescription'] = $bigbluebuttonbn->intro; $bbbsession['welcome'] = $bigbluebuttonbn->welcome; if (!isset($bbbsession['welcome']) || $bbbsession['welcome'] == '') { $bbbsession['welcome'] = get_string('mod_form_field_welcome_default', 'bigbluebuttonbn'); }
//This is valid before v2.7 add_to_log($course->id, 'streamline', 'view', 'view.php?id=$cm->id', $streamline->name, $cm->id); } else { //This is valid after v2.7 bigbluebuttonbn $event = \mod_streamline\event\bigbluebuttonbn_activity_viewed::create(array('context' => $context, 'objectid' => $streamline->id)); $event->trigger(); } //User data $bbbsession['username'] = get_string('fullnamedisplay', 'moodle', $USER); $bbbsession['userID'] = $USER->id; $bbbsession['roles'] = get_user_roles($context, $USER->id, true); if ($streamline->participants == null || $streamline->participants == "[]") { //The room that is being used comes from a previous version $moderator = has_capability('mod/streamline:moderate', $context); } else { $moderator = bigbluebuttonbn_is_moderator($bbbsession['userID'], $bbbsession['roles'], $streamline->participants); } $administrator = has_capability('moodle/category:manage', $context); //Validates if the BigBlueButton server is running //BigBlueButton server data $bbbsession['salt'] = trim($CFG->BigBlueButtonSaltKey); $bbbsession['url'] = trim(trim($CFG->ServerURLforBigBlueButton), '/') . '/'; $serverVersion = bigbluebuttonbn_getServerVersion($bbbsession['url']); if (!isset($serverVersion)) { //Server is not working if ($administrator) { print_error($bbbsession['url'] . 'view_error_unable_join', 'streamline', $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); } else { if ($moderator) { print_error('view_error_unable_join_teacher', 'streamline', $CFG->wwwroot . '/course/view.php?id=' . $streamline->course); } else {
if ($g != '0') { $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID . '[' . $g . ']', $modPW, $endpoint, $shared_secret)); } else { $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $endpoint, $shared_secret)); } redirect('index.php?id=' . $id); } } foreach ($bigbluebuttonbns as $bigbluebuttonbn) { $cm = get_coursemodule_from_id('bigbluebuttonbn', $bigbluebuttonbn->coursemodule, 0, false, MUST_EXIST); //User roles if ($bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]") { //The room that is being used comes from a previous version $moderator = has_capability('mod/bigbluebuttonbn:moderate', $context); } else { $moderator = bigbluebuttonbn_is_moderator($USER->id, get_user_roles($context, $USER->id, true), $bigbluebuttonbn->participants); } $administrator = has_capability('moodle/category:manage', $context); if (groups_get_activity_groupmode($cm) > 0) { $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, $administrator || $moderator, $course, $bigbluebuttonbn, (object) array('id' => 0, 'name' => get_string('allparticipants'))); $groups = groups_get_activity_allowed_groups($cm); if (isset($groups)) { foreach ($groups as $group) { $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, $administrator || $moderator, $course, $bigbluebuttonbn, $group); } } } else { $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, $administrator || $moderator, $course, $bigbluebuttonbn); } } echo $OUTPUT->header();