See Release Notes
Long Term Support Release
1 <?php 2 // This file is part of Moodle - http://moodle.org/ 3 // 4 // Moodle is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // Moodle is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 16 17 /** 18 * Guest access implementation 19 * 20 * @package mod_bigbluebuttonbn 21 * @copyright 2022 onwards, Blindside Networks Inc 22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 23 * @author Laurent David (laurent [at] call-learning [dt] fr) 24 */ 25 26 use mod_bigbluebuttonbn\form\guest_login; 27 use mod_bigbluebuttonbn\local\exceptions\server_not_available_exception; 28 use mod_bigbluebuttonbn\local\proxy\bigbluebutton_proxy; 29 use mod_bigbluebuttonbn\meeting; 30 use mod_bigbluebuttonbn\plugin; 31 32 require(__DIR__.'/../../config.php'); 33 global $PAGE, $OUTPUT, $DB, $SITE; 34 // Note here that we do not use require_login as the $CFG->forcelogin would prevent guest user from accessing this page. 35 $PAGE->set_course($SITE); // Intialise the page and run through the setup. 36 $uid = required_param('uid', PARAM_ALPHANUMEXT); 37 38 $bbid = $DB->get_field('bigbluebuttonbn', 'id', ['guestlinkuid' => trim($uid)]); 39 if (empty($bbid)) { 40 throw new moodle_exception('guestaccess_activitynotfound', 'mod_bigbluebuttonbn'); 41 } 42 $instance = \mod_bigbluebuttonbn\instance::get_from_instanceid($bbid); 43 // Prevent access to this page if the guest access has been disabled on this instance. 44 if (!$instance->is_guest_allowed()) { 45 throw new moodle_exception('guestaccess_feature_disabled', 'mod_bigbluebuttonbn'); 46 } 47 48 // Get the guest matching guest access link. 49 $PAGE->set_url('/mod/bigbluebuttonbn/guest.php', ['uid' => $uid]); 50 $title = $instance->get_course()->shortname . ': ' . format_string($instance->get_meeting_name()); 51 $PAGE->set_title($title); 52 $PAGE->set_heading($title); 53 $PAGE->set_pagelayout('standard'); 54 $form = new guest_login(null, ['uid' => $uid, 'instance' => $instance]); 55 // Specific for the tests: we allow to set the password in the form here. 56 if (defined('BEHAT_SITE_RUNNING')) { 57 $form->set_data(['password' => optional_param('password', '', PARAM_RAW)]); 58 } 59 60 if ($data = $form->get_data()) { 61 $username = $data->username; 62 try { 63 $meeting = new meeting($instance); 64 // As the meeting doesn't exist, we raise an exception. 65 if (!empty($meeting->get_meeting_info()->createtime)) { 66 $url = $meeting->get_guest_join_url($username); 67 redirect($url); 68 } else { 69 \core\notification::add( 70 get_string('guestaccess_meeting_not_started', 'mod_bigbluebuttonbn'), 71 \core\output\notification::NOTIFY_ERROR 72 ); 73 } 74 } catch (server_not_available_exception $e) { 75 bigbluebutton_proxy::handle_server_not_available($instance); 76 } 77 } 78 echo $OUTPUT->header(); 79 echo $form->render(); 80 echo $OUTPUT->footer();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body