Esempio n. 1
0
            $result = $bbb->publishMeeting($_GET['id']);
            break;
        case 'unpublish':
            $result = $bbb->unpublishMeeting($_GET['id']);
            break;
        default:
            break;
    }
}

$meetings = $bbb->getCourseMeetings();
if (!empty($meetings)) {
    $meetings = array_reverse($meetings);
}
$users_online   = $bbb->getUsersOnlineInCurrentRoom();
$status         = $bbb->isServerRunning();
$meeting_exists = $bbb->meetingExists(api_get_course_id().'-'.api_get_session_id());
$show_join_button = false;
if ($meeting_exists || $teacher) {
    $show_join_button = true;
}

$tpl->assign('allow_to_edit', $teacher);
$tpl->assign('meetings', $meetings);
$conferenceUrl = api_get_path(WEB_PLUGIN_PATH).'bbb/start.php?launch=1&'.api_get_cidreq();
$tpl->assign('conference_url', $conferenceUrl);
$tpl->assign('users_online', $users_online);
$tpl->assign('bbb_status', $status);
$tpl->assign('show_join_button', $show_join_button);

//$tpl->assign('actions', $actions);
Esempio n. 2
0
/**
 * This script initiates a video conference session, calling the BigBlueButton API
 * @package chamilo.plugin.bigbluebutton
 */
require __DIR__ . '/../../vendor/autoload.php';
$course_plugin = 'bbb';
//needed in order to load the plugin lang variables
require_once dirname(__FILE__) . '/config.php';
$tool_name = get_lang('Videoconference');
$tpl = new Template($tool_name);
$vmIsEnabled = false;
$host = null;
$salt = null;
$bbb = new bbb();
if ($bbb->plugin_enabled) {
    if ($bbb->isServerRunning()) {
        if (isset($_GET['launch']) && $_GET['launch'] == 1) {
            if (file_exists(__DIR__ . '/config.vm.php')) {
                $config = (require __DIR__ . '/config.vm.php');
                $vmIsEnabled = true;
                $host = null;
                $salt = null;
                require __DIR__ . '/lib/vm/AbstractVM.php';
                require __DIR__ . '/lib/vm/VMInterface.php';
                require __DIR__ . '/lib/vm/DigitalOceanVM.php';
                require __DIR__ . '/lib/VM.php';
                $vm = new VM($config);
                if ($vm->IsEnabled()) {
                    try {
                        $vm->resizeToMaxLimit();
                    } catch (\Exception $e) {