delrecording.php 1.11 KB
<?php

require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once(dirname(__FILE__).'/locallib.php');
require_once(dirname(__FILE__).'/connect_class.php');
require_once(dirname(__FILE__).'/connect_class_dom.php');

$id         = required_param('id', PARAM_INT);
$recordingscoid = required_param('recording', PARAM_INT);

global $CFG, $USER, $DB, $PAGE, $OUTPUT;

// Do the usual Moodle setup
if (! $cm = get_coursemodule_from_id('adobeconnect', $id)) {
    error('Course Module ID was incorrect');
}
$cond = array('id' => $cm->course);
if (! $course = $DB->get_record('course', $cond)) {
    error('Course is misconfigured');
}

$cond = array('id' => $cm->instance);
if (! $adobeconnect = $DB->get_record('adobeconnect', $cond)) {
    error('Course module is incorrect');
}
require_login($course, true, $cm);

$context = context_module::instance($id);
$user_is_host = has_capability('mod/adobeconnect:meetinghost', $context);

if ($user_is_host) {
    $aconnect = aconnect_login();
    aconnect_remove_meeting($aconnect, $recordingscoid);
}

redirect('https://moodle.vc.dfn.de/mod/adobeconnect/view.php?id=' . $id);