Exemplo n.º 1
0
/**
 * Given an ID of an instance of this module,
 * this function will permanently delete the instance
 * and any data that depends on it.
 *
 * @param int $id Id of the module instance
 * @return boolean Success/Failure
 */
function bigbluebuttonbn_delete_instance($id)
{
    global $CFG;
    if (!($bigbluebuttonbn = get_record('bigbluebuttonbn', 'id', $id))) {
        return false;
    }
    $result = true;
    //
    // End the session associated with this instance (if it's running)
    //
    $meetingID = $bigbluebuttonbn->meetingid;
    $modPW = $bigbluebuttonbn->moderatorpass;
    $url = trim(trim($CFG->bigbluebuttonbnServerURL), '/') . '/';
    $salt = trim($CFG->bigbluebuttonbnSecuritySalt);
    $getArray = BigBlueButtonBN::endMeeting($meetingID, $modPW, $url, $salt);
    if (!delete_records('bigbluebuttonbn', 'id', $bigbluebuttonbn->id)) {
        //echo $endURL = '<a href='.BBBMeeting::endMeeting( $mToken, "mp", getBBBServerIP(), $salt ).'>'."End Meeting".'</a>';
        #switch to remove the meetingname
        #    	  BBBMeeting::endMeeting( $bigbluebuttonbn->, "mp", getBBBServerIP(), $bigbluebuttonbn->salt );
        $result = false;
    }
    return $result;
}
Exemplo n.º 2
0
    }
}
$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 = "-";
Exemplo n.º 3
0
/**
 * Given an ID of an instance of this module,
 * this function will permanently delete the instance
 * and any data that depends on it.
 *
 * @param int $id Id of the module instance
 * @return boolean Success/Failure
 */
function bigbluebuttonbn_delete_instance($id)
{
    global $CFG, $DB;
    if (!($bigbluebuttonbn = $DB->get_record('bigbluebuttonbn', array('id' => $id)))) {
        return false;
    }
    $result = true;
    //
    // End the session associated with this instance (if it's running)
    //
    $meetingID = $bigbluebuttonbn->meetingid;
    $modPW = $bigbluebuttonbn->moderatorpass;
    $url = trim(trim($CFG->BigBlueButtonBNServerURL), '/') . '/';
    $salt = trim($CFG->BigBlueButtonBNSecuritySalt);
    $getArray = BigBlueButtonBN::endMeeting($meetingID, $modPW, $url, $salt);
    if (!$DB->delete_records('bigbluebuttonbn', array('id' => $bigbluebuttonbn->id))) {
        $result = false;
    }
    if (!$DB->delete_records('event', array('modulename' => 'bigbluebuttonbn', 'instance' => $bigbluebuttonbn->id))) {
        $result = false;
    }
    return $result;
}