Ejemplo n.º 1
0
        // (there should be only one at a time, as createMeeting checks for that first
        if (!empty($meetings)) {
            foreach ($meetings as $meeting) {
                if ($meeting['status'] == 1) {
                    $selectedMeeting = $meeting;
                }
            }
        }
        if (!empty($selectedMeeting)) {
            $url = $om->joinMeeting($selectedMeeting['id']);
            if ($url) {
                header('location: ' . $url);
                exit;
            }
        } else {
            if ($om->isTeacher()) {
                $om->createMeeting($meeting_params);
                exit;
            } else {
                $url = 'listing.php';
                header('location: ' . $url);
                exit;
            }
        }
    } else {
        $url = 'listing.php';
        header('location: ' . $url);
        exit;
    }
} else {
    $message = Display::return_message(get_lang('ServerIsNotRunning'), 'warning');
Ejemplo n.º 2
0
 * This script initiates a videoconference session, calling the BigBlueButton API
 * @package chamilo.plugin.bigbluebutton
 */
/**
 * Initialization
 */

$course_plugin = 'openmeetings'; //needed in order to load the plugin lang variables
require_once dirname(__FILE__).'/config.php';
$plugin = \OpenMeetingsPlugin::create();
$tool_name = $plugin->get_lang('Videoconference');
$tpl = new Template($tool_name);

$om = new Chamilo\Plugin\OpenMeetings\OpenMeetings();
$action = isset($_GET['action']) ? $_GET['action'] : null;
$teacher = $om->isTeacher();

api_protect_course_script(true);
$message = null;

if ($teacher) {
    switch ($action) {
        case 'add_to_calendar':
            $course_info = api_get_course_info();
            $agenda = new Agenda();
            $agenda->type = 'course';

            $id = intval($_GET['id']);
            $title = sprintf(get_lang('VideoConferenceXCourseX'), $id, $course_info['name']);
            $content = Display::url(get_lang('GoToTheVideoConference'), $_GET['url']);