Commit 8df6df7272aec371dec9f69a3857ef3e2553129d

Authored by DFNVC
1 parent 0c2420a70f
Exists in master

Verbesserungen und Bug-Fixes im Bereich Aufzeichnungen:

Meetings können nicht mehr versehentlich gelöscht werden,
falls noch Aufzeichnungen enthalten sind.
Neue Veranstalter-Löschfunktion für Aufzeichungen.
Eine Adobe-Connect-Aktivität kann nicht mehr erzeugt werden,
wenn die angegebene Meeting-URL bereits existiert.

Showing 9 changed files with 96 additions and 39 deletions Side-by-side Diff

... ... @@ -0,0 +1,36 @@
  1 +<?php
  2 +
  3 +require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
  4 +require_once(dirname(__FILE__).'/locallib.php');
  5 +require_once(dirname(__FILE__).'/connect_class.php');
  6 +require_once(dirname(__FILE__).'/connect_class_dom.php');
  7 +
  8 +$id = required_param('id', PARAM_INT);
  9 +$recordingscoid = required_param('recording', PARAM_INT);
  10 +
  11 +global $CFG, $USER, $DB, $PAGE, $OUTPUT;
  12 +
  13 +// Do the usual Moodle setup
  14 +if (! $cm = get_coursemodule_from_id('adobeconnect', $id)) {
  15 + error('Course Module ID was incorrect');
  16 +}
  17 +$cond = array('id' => $cm->course);
  18 +if (! $course = $DB->get_record('course', $cond)) {
  19 + error('Course is misconfigured');
  20 +}
  21 +
  22 +$cond = array('id' => $cm->instance);
  23 +if (! $adobeconnect = $DB->get_record('adobeconnect', $cond)) {
  24 + error('Course module is incorrect');
  25 +}
  26 +require_login($course, true, $cm);
  27 +
  28 +$context = context_module::instance($id);
  29 +$user_is_host = has_capability('mod/adobeconnect:meetinghost', $context);
  30 +
  31 +if ($user_is_host) {
  32 + $aconnect = aconnect_login();
  33 + aconnect_remove_meeting($aconnect, $recordingscoid);
  34 +}
  35 +
  36 +redirect('https://moodle.vc.dfn.de/mod/adobeconnect/view.php?id=' . $id);
0 37 \ No newline at end of file
... ... @@ -52,7 +52,7 @@ if (! $adobeconnects = get_all_instances_in_course(&#39;adobeconnect&#39;, $course)) {
52 52  
53 53 $usesections = course_format_uses_sections($course->format);
54 54 if ($usesections) {
55   - $sections = get_all_sections($course->id);
  55 +// $sections = get_all_sections($course->id);
56 56 }
57 57  
58 58 $table = new html_table();
... ... @@ -88,4 +88,5 @@ foreach ($adobeconnects as $adobeconnect) {
88 88  
89 89 echo html_writer::table($table);
90 90  
  91 +
91 92 echo $OUTPUT->footer();
92 93 \ No newline at end of file
lang/de/adobeconnect.php
... ... @@ -61,6 +61,7 @@ $string[&#39;presenterlabel&#39;] = &#39;Moderator&#39;;
61 61 $string['recordinghdr'] = 'Meeting-Aufzeichnung';
62 62 $string['record_force'] = 'Meeting-Aufzeichnung erzwingen';
63 63 $string['record_force_desc'] = 'Alle Meetings aufzeichnen. Dies ist eine Einstellung für den gesamten Adobe Connect Server. Der Server muss dazu neu gestartet werden. ';
  64 +$string['record_play'] = 'Aufzeichung abspielen';
64 65 $string['record_convert'] = 'Konvertieren';
65 66 $string['record_convert_help'] = 'Hilfe: Konvertieren von Aufzeichnungen';
66 67 $string['convert_recording_help'] = '<h2>Konvertierung von Adobe Connect Aufzeichnungen</h2>
... ... @@ -74,6 +75,9 @@ Adobe Connect Host zugewiesen werden.
74 75 Die Konvertierungsdauer entspricht immer der Länge der Aufzeichnung, da ein Download<br>
75 76 der Original-Aufzeichnungen unter Adobe Connect nicht möglich ist.
76 77 </p>';
  78 +$string['record_delete'] = 'Aufzeichnung löschen';
  79 +$string['confirm_record_delete'] = 'Wollen Sie die Aufzeichnung "{$a}" wirklich löschen ?';
  80 +$string['recording_error'] = 'Das Meeting kann nicht gelöscht werden, da es noch Aufzeichnungen enthält !';
77 81  
78 82 $string['removeparticipant'] = 'Entfernen';
79 83 $string['removepresenter'] = 'Entfernen';
... ... @@ -123,14 +127,15 @@ $string[&#39;error2&#39;] = &#39;Die Eigenschaft \&#39;{$a}\&#39; is leer. Geben Sie bitte einen Wer
123 127 $string['settingblurb'] = '<p>Dieses Plugin wurde durch den DFN-Verein für den DFNVC Webkonferenz-Dienst modifiziert.<br>
124 128 Es wurde ursprünglich von Remote-Learner und Adobe entwickelt.</p>';
125 129  
126   -$string['meeturl_help'] = '<p>Sie können die für den Aufbau der Verbidnung zum Meetingraum verwendete URL anpassen.
127   -Der Domain-Teil bleibt immer die gleiche (webconf.vc.dfn.de). Nur der Teil nach der Domain kann geändert werden.</p>
  130 +$string['meeturl_help'] = '<p>Sie können die für den Aufbau der Verbidnung zum Meetingraum verwendete URL anpassen.<br>
  131 +Der Domain-Teil bleibt immer die gleiche (webconf.vc.dfn.de). Nur der Teil nach der Domain kann geändert werden.
  132 +</p>
  133 +<p>
  134 +Erlaubt sind nur alphanumerische ASCII-Zeichen und Bindestriche.
  135 +</p>
128 136  
129 137 <p>Beispiele für korrekte URL-Einträge:
130   -<ul><li>meinmeeting</li><li>/meinmeeting</li></ul>
131   -
132   -Nicht korrekte URL-Einträge:
133   -<ul><li>meinmeeting/meinmeeting</li><li>/meinmeeting/meinmeeting/</li><li>meinmeeting/</li></ul>
  138 +<ul><li>meinmeeting</li><li>mein-meeting</li></ul>
134 139 </p>
135 140  
136 141 <p>Wenn ein Meeting gespeichert wurde, ist es nicht mehr möglich dieses Feld zu ändern. Das Feld wird deaktiviert.
lang/en/adobeconnect.php
... ... @@ -62,6 +62,7 @@ $string[&#39;presenterlabel&#39;] = &#39;Presenter&#39;;
62 62 $string['recordinghdr'] = 'Meeting Recordings';
63 63 $string['record_force'] = 'Force Meeting Recordings';
64 64 $string['record_force_desc'] = 'Force all Adobe Connect meetings to be recorded. This is a site wide effect and the Adobe Connect server must be restarted';
  65 +$string['record_play'] = 'Play recording';
65 66 $string['record_convert'] = 'Convert';
66 67 $string['record_convert_help'] = 'Help: Converting Recordings';
67 68 $string['convert_recording_help'] = '<h2>Converting Adobe Connect Recordings</h2>
... ... @@ -75,6 +76,9 @@ the Adobe Connect Host role.&lt;br&gt;
75 76 The conversion duration eqates to the length of the recording becaus it is<br>
76 77 not possible to download the original Adobe Connect recording in advance.
77 78 </p>';
  79 +$string['record_delete'] = 'Delete recording';
  80 +$string['confirm_record_delete'] = 'Do you really want to delete the recroding {$a}?';
  81 +$string['recording_error'] = 'The meeting cannot be deleted because it still contains recordings!';
78 82  
79 83 $string['removeparticipant'] = 'Remove';
80 84 $string['removepresenter'] = 'Remove';
... ... @@ -125,24 +129,15 @@ $string[&#39;settingblurb&#39;] = &#39;Plugin modified by DFN-Verein.
125 129 single-sign-on between the two systems with easy creation and management of Adobe Connect Pro
126 130 meetings.</p>';
127 131  
128   -$string['meeturl_help'] = '<p>You can customize the URL that is used to connect to the Adobe connect meeting. The Adobe Server domain will always remain the same.
129   - However the last part of the URL can be customized.
130   -</p>
131   -<p>For example if the Adobe Connect server domain was located at <b>http://adobe.connect.server/</b>
132   - when customizing the URL to <b>mymeeting</b>, the URL to connect to the meeting would be <b>http://adobe.connect.server/mymeeting</b>. Leave out the trailing forward slash
  132 +$string['meeturl_help'] = '<p>You can customize the URL that is used to connect to the Adobe connect meeting. The Adobe Server domain will always remain the same.<br>
  133 +However the last part of the URL can be customized.</p>
  134 +<p>Only alphanumeric characters and hyphen are allowed.
133 135 </p>
  136 +
134 137 <p>Valid URL entries consists of the name with
135 138 <ul>
136 139 <li>mymeeting</li>
137   -<li>/mymeeting</li>
138   -</ul>
139   -
140   -Invalid URL entries consist of more than one forward slash:
141   -<ul>
142   -<li>mymeeting/mymeeting</li>
143   -<li>mymeeting/mymeeting/</li>
144   -<li>mymeeting/mymeeting//anothermeeting</li>
145   -<li>mymeeting/</li>
  140 +<li>my-meeting</li>
146 141 </ul>
147 142  
148 143 </p>
... ... @@ -411,20 +411,26 @@ function adobeconnect_update_instance($adobeconnect) {
411 411 */
412 412 function adobeconnect_delete_instance($id) {
413 413 global $DB;
414   -
  414 +
415 415 $param = array('id' => $id);
416 416 if (! $adobeconnect = $DB->get_record('adobeconnect', $param)) {
417 417 return false;
418 418 }
419 419  
420   - $result = true;
421   -
422   - // Remove meeting from Adobe connect server
423 420 $param = array('instanceid' => $adobeconnect->id);
424 421 $adbmeetings = $DB->get_records('adobeconnect_meeting_groups', $param);
  422 + $meetingscoid = $DB->get_field('adobeconnect_meeting_groups', 'meetingscoid',$param);
425 423  
  424 + $aconnect = aconnect_login();
  425 + if (aconnect_get_recordings($aconnect, $meetingscoid, $meetingscoid)) {
  426 + $delerror = get_string('recording_error','adobeconnect');
  427 + print_error($delerror,' ');
  428 + aconnect_logout($aconnect);
  429 + return false;
  430 + }
  431 +
  432 + $result = true;
426 433 if (!empty($adbmeetings)) {
427   - $aconnect = aconnect_login();
428 434 foreach ($adbmeetings as $meeting) {
429 435 // Update calendar event
430 436 $param = array('courseid' => $adobeconnect->course, 'instance' => $adobeconnect->id,
... ... @@ -441,10 +447,8 @@ function adobeconnect_delete_instance($id) {
441 447  
442 448 aconnect_logout($aconnect);
443 449 }
444   -
445 450 $param = array('id' => $adobeconnect->id);
446 451 $result &= $DB->delete_records('adobeconnect', $param);
447   -
448 452 $param = array('instanceid' => $adobeconnect->id);
449 453 $result &= $DB->delete_records('adobeconnect_meeting_groups', $param);
450 454  
... ... @@ -208,10 +208,11 @@ function adobe_connection_test($host = &#39;&#39;, $port = 80, $username = &#39;&#39;,
208 208 echo '<p style="color:#680000">XML response:<br />'. htmlspecialchars($aconnectDOM->_xmlresponse). '</p>';
209 209 }
210 210  
  211 + //
211 212 // Test creating a user
212 213 // DFNVC
213 214 //
214   - echo '<p><b>Test creating a user:</b></p>';
  215 + echo '<p><b>Test creating a user:</b></p>';
215 216 $user = new stdClass();
216 217 $res = preg_split('/@/',$username);
217 218 $apiuserdomain = $res[1];
... ... @@ -124,12 +124,12 @@ class mod_adobeconnect_mod_form extends moodleform_mod {
124 124  
125 125 // Search for a Meeting with the same starting name. It will cause a duplicate
126 126 // meeting name (and error) when the user begins to add participants to the meeting
127   - // DFNVC
128   - //
129   - // $meetfldscoid = aconnect_get_folder($aconnect, 'meetings');
130   - $meetfldscoid = aconnect_get_meeting_folder($aconnect);
131   - //
132   - //
  127 + // DFNVC
  128 + //
  129 + // $meetfldscoid = aconnect_get_folder($aconnect, 'meetings');
  130 + $meetfldscoid = aconnect_get_meeting_folder($aconnect);
  131 + //
  132 + //
133 133 $filter = array('filter-like-name' => $data['name']);
134 134 $namematches = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter);
135 135  
... ... @@ -137,6 +137,8 @@ class mod_adobeconnect_mod_form extends moodleform_mod {
137 137 $namematches = array();
138 138 }
139 139  
  140 +
  141 +
140 142 // Now search for existing meeting room URLs
141 143 $url = $data['meeturl'];
142 144 $url = $data['meeturl'] = adobeconnect_clean_meet_url($data['meeturl']);
... ... @@ -147,9 +149,14 @@ class mod_adobeconnect_mod_form extends moodleform_mod {
147 149 $errors['meeturl'] = get_string('invalidadobemeeturl', 'adobeconnect');
148 150 }
149 151  
150   - $filter = array('filter-like-url-path' => $url);
  152 +# $filter = array('filter-like-url-path' => $url);
  153 +# DFNVC ERROR !!
  154 +#
  155 + $filter = array('filter-url-path' => "/$url/");
151 156 $urlmatches = aconnect_meeting_exists($aconnect, $meetfldscoid, $filter);
  157 + #$errors['meeturl'] = 'urlmatches:';
152 158  
  159 +
153 160 if (empty($urlmatches)) {
154 161 $urlmatches = array();
155 162 } else {
... ... @@ -196,7 +203,7 @@ class mod_adobeconnect_mod_form extends moodleform_mod {
196 203  
197 204 foreach($urlmatches as $matchkey => $match) {
198 205 $matchurl = rtrim($match->url, '/');
199   - if (0 == substr_compare($matchurl, $url . '_', 0, strlen($url . '_'), false)) {
  206 + if ($matchurl == $url) {
200 207 $errors['meeturl'] = get_string('duplicateurl', 'adobeconnect');
201 208 }
202 209 }
... ... @@ -112,7 +112,7 @@ class mod_adobeconnect_renderer extends plugin_renderer_base {
112 112 $url = $CFG->wwwroot . '/mod/adobeconnect/joinrecording.php?id=' . $cmid . '&recording='. $recording_scoid . '&groupid='. $groupid . '&sesskey=' . $USER->sesskey;
113 113 // recording name
114 114 $name = '<img src="' . $CFG->wwwroot .'/pix/e/insert_edit_video.svg"/>&nbsp;&nbsp;';
115   - $name .= html_writer::link($url, format_string($recording->name), array('target' => '_blank','title'=>'Play Recording'));
  115 + $name .= html_writer::link($url, format_string($recording->name), array('target' => '_blank','title'=>get_string('record_play','adobeconnect')));
116 116 // start date
117 117 $startdate = format_string($recording->startdate);
118 118 $time = strtotime($startdate);
... ... @@ -126,10 +126,18 @@ class mod_adobeconnect_renderer extends plugin_renderer_base {
126 126 // Moodle users with role meeting host can convert recordings on their local Windows PCs
127 127 $action = '';
128 128 if ($user_is_host) {
  129 + // Konvertieren
129 130 $converturl = $url . '&convert=true';
130 131 $param = array('target' => '_blank','title'=>get_string('record_convert','adobeconnect'));
131 132 $action = html_writer::link($converturl,get_string('record_convert','adobeconnect'),$param);
132 133 array_push($row, $action);
  134 + // Löschen
  135 + $delurl = "/mod/adobeconnect/delrecording.php?id=$cmid&recording=$recording_scoid";
  136 + $a = $recording->name;
  137 + $confirmdel = get_string('confirm_record_delete','adobeconnect',$a);
  138 + $param = array('onclick' => "return confirm('$confirmdel')", 'title'=>get_string('record_delete','adobeconnect'));
  139 + $del = html_writer::link($CFG->wwwroot . $delurl, '<img alt="' . get_string('record_delete','adobeconnect') . '" src="' . $CFG->wwwroot .'/pix/t/delete.svg" />', $param);
  140 + array_push($row, $del);
133 141 // Help
134 142 $param = array('target' => '_blank','title'=>get_string('record_convert_help','adobeconnect'));
135 143 $help = html_writer::link($CFG->wwwroot . "/help.php?component=adobeconnect&identifier=convert_recording&lang=$COURSE->lang", '<img alt="' . get_string('record_convert_help','adobeconnect') . '" src="' . $CFG->wwwroot .'/pix/help.svg" />', $param);
... ... @@ -7,7 +7,7 @@
7 7 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
8 8 */
9 9  
10   -$plugin->version = 2016011800; // The current module version (Date: YYYYMMDDXX)
  10 +$plugin->version = 2018020800; // The current module version (Date: YYYYMMDDXX)
11 11 $plugin->requires = 2014051212; // Requires this Moodle version
12 12 $plugin->component = 'mod_adobeconnect';
13 13 $plugin->cron = 0; // Period for cron to check this module (secs)