Example #1
0
/**
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will create a new instance and return the id number
 * of the new instance.
 *
 * @param object $bigbluebuttonbn An object from the form in mod_form.php
 * @return int The id of the newly inserted bigbluebuttonbn record
 */
function bigbluebuttonbn_add_instance($bigbluebuttonbn)
{
    global $DB;
    $bigbluebuttonbn->timecreated = time();
    $bigbluebuttonbn->moderatorpass = bigbluebuttonbn_rand_string(16);
    $bigbluebuttonbn->viewerpass = bigbluebuttonbn_rand_string(16);
    $bigbluebuttonbn->meetingid = bigbluebuttonbn_rand_string(16);
    if (!isset($bigbluebuttonbn->newwindow)) {
        $bigbluebuttonbn->newwindow = 0;
    }
    if (!isset($bigbluebuttonbn->wait)) {
        $bigbluebuttonbn->wait = 0;
    }
    if (!isset($bigbluebuttonbn->record)) {
        $bigbluebuttonbn->record = 0;
    }
    $returnid = $DB->insert_record('bigbluebuttonbn', $bigbluebuttonbn);
    if (isset($bigbluebuttonbn->timeavailable) && $bigbluebuttonbn->timeavailable) {
        $event = NULL;
        $event->name = $bigbluebuttonbn->name;
        $event->courseid = $bigbluebuttonbn->course;
        $event->groupid = 0;
        $event->userid = 0;
        $event->modulename = 'bigbluebuttonbn';
        $event->instance = $returnid;
        $event->timestart = $bigbluebuttonbn->timeavailable;
        if ($bigbluebuttonbn->timedue) {
            $event->timeduration = $bigbluebuttonbn->timedue - $bigbluebuttonbn->timeavailable;
        } else {
            $event->timeduration = 0;
        }
        calendar_event::create($event);
    }
    return $returnid;
}
Example #2
0
/**
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will create a new instance and return the id number
 * of the new instance.
 *
 * @param object $bigbluebuttonbn An object from the form in mod_form.php
 * @return int The id of the newly inserted bigbluebuttonbn record
 */
function bigbluebuttonbn_add_instance($bigbluebuttonbn)
{
    $bigbluebuttonbn->timecreated = time();
    if (record_exists('bigbluebuttonbn', 'meetingID', $bigbluebuttonbn->name)) {
        error("A meeting with that name already exists.");
        return false;
    }
    $bigbluebuttonbn->moderatorpass = bigbluebuttonbn_rand_string(16);
    $bigbluebuttonbn->viewerpass = bigbluebuttonbn_rand_string(16);
    $bigbluebuttonbn->meetingid = bigbluebuttonbn_rand_string(16);
    return insert_record('bigbluebuttonbn', $bigbluebuttonbn);
}
Example #3
0
/**
 * Given an object containing all the necessary data,
 * (defined by the form in mod_form.php) this function
 * will create a new instance and return the id number
 * of the new instance.
 *
 * @param object $streamline An object from the form in mod_form.php
 * @return int The id of the newly inserted streamline record
 */
function streamline_add_instance($streamline)
{
    global $DB;
    $streamline->timecreated = time();
    $streamline->moderatorpass = bigbluebuttonbn_rand_string();
    $streamline->viewerpass = bigbluebuttonbn_rand_string();
    $streamline->meetingid = bigbluebuttonbn_rand_string();
    if (!isset($streamline->newwindow)) {
        $streamline->newwindow = 0;
    }
    if (!isset($streamline->wait)) {
        $streamline->wait = 0;
    }
    if (!isset($streamline->record)) {
        $streamline->record = 0;
    }
    if (!isset($streamline->allmoderators)) {
        $streamline->allmoderators = 0;
    }
    $returnid = $DB->insert_record('streamline', $streamline);
    if (isset($streamline->timeavailable) && $streamline->timeavailable) {
        $event = new stdClass();
        $event->name = $streamline->name;
        $event->courseid = $streamline->course;
        $event->groupid = 0;
        $event->userid = 0;
        $event->modulename = 'streamline';
        $event->instance = $returnid;
        $event->timestart = $streamline->timeavailable;
        if ($streamline->timedue) {
            $event->timeduration = $streamline->timedue - $streamline->timeavailable;
        } else {
            $event->timeduration = 0;
        }
        calendar_event::create($event);
    }
    return $returnid;
}
$salt = trim($CFG->BigBlueButtonSecuritySalt);
$url = trim(trim($CFG->BigBlueButtonServerURL), '/') . '/';
$logoutURL = $CFG->wwwroot;
if (isset($_POST['submit']) && $_POST['submit'] == 'end') {
    //
    // A request to end the meeting
    //
    if (!($bigbluebuttonbn = get_record('bigbluebuttonbn', 'id', $a))) {
        error("BigBlueButton ID {$a} is incorrect");
    }
    print get_string('index_ending', 'bigbluebuttonbn');
    $meetingID = $bigbluebuttonbn->meetingid;
    $modPW = $bigbluebuttonbn->moderatorpass;
    $getArray = BigBlueButtonBN::endMeeting($meetingID, $modPW, $url, $salt);
    // print_object( $getArray );
    $bigbluebuttonbn->meetingid = bigbluebuttonbn_rand_string(16);
    if (!update_record('bigbluebuttonbn', $bigbluebuttonbn)) {
        notice("Unable to assign a new meetingid");
    } else {
        redirect('index.php?id=' . $id);
    }
}
// print_object( $bigbluebuttonbns );
foreach ($bigbluebuttonbns as $bigbluebuttonbn) {
    $info = null;
    $joinURL = null;
    $user = null;
    $result = null;
    $users = "-";
    $running = "-";
    $actions = "-";