@@ -198,10 +198,10 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | function bigbluebutton_bbb_view_create_meeting_data(&$bbbsession) { |
| 200 | 200 | $data = ['meetingID' => $bbbsession['meetingid'], |
| 201 | - 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 202 | - 'attendeePW' => $bbbsession['viewerPW'], |
|
| 203 | - 'moderatorPW' => $bbbsession['modPW'], |
|
| 204 | - 'logoutURL' => $bbbsession['logoutURL'], |
|
| 201 | + 'name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 202 | + 'attendeePW' => $bbbsession['viewerPW'], |
|
| 203 | + 'moderatorPW' => $bbbsession['modPW'], |
|
| 204 | + 'logoutURL' => $bbbsession['logoutURL'], |
|
| 205 | 205 | ]; |
| 206 | 206 | $data['record'] = bigbluebutton_bbb_view_create_meeting_data_record($bbbsession['record']); |
| 207 | 207 | $data['welcome'] = trim($bbbsession['welcome']); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | '%duration%', |
| 215 | 215 | (string) $durationtime, |
| 216 | 216 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
| 217 | - ); |
|
| 217 | + ); |
|
| 218 | 218 | } |
| 219 | 219 | $voicebridge = intval($bbbsession['voicebridge']); |
| 220 | 220 | if ($voicebridge > 0 && $voicebridge < 79999) { |
@@ -253,22 +253,22 @@ discard block |
||
| 253 | 253 | function bigbluebutton_bbb_view_create_meeting_metadata(&$bbbsession) { |
| 254 | 254 | global $USER; |
| 255 | 255 | $metadata = ['bbb-origin' => $bbbsession['origin'], |
| 256 | - 'bbb-origin-version' => $bbbsession['originVersion'], |
|
| 257 | - 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
| 258 | - 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
| 259 | - 'bbb-origin-tag' => $bbbsession['originTag'], |
|
| 260 | - 'bbb-context' => $bbbsession['course']->fullname, |
|
| 261 | - 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 262 | - 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
| 263 | - 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
| 256 | + 'bbb-origin-version' => $bbbsession['originVersion'], |
|
| 257 | + 'bbb-origin-server-name' => $bbbsession['originServerName'], |
|
| 258 | + 'bbb-origin-server-common-name' => $bbbsession['originServerCommonName'], |
|
| 259 | + 'bbb-origin-tag' => $bbbsession['originTag'], |
|
| 260 | + 'bbb-context' => $bbbsession['course']->fullname, |
|
| 261 | + 'bbb-recording-name' => bigbluebuttonbn_html2text($bbbsession['meetingname'], 64), |
|
| 262 | + 'bbb-recording-description' => bigbluebuttonbn_html2text($bbbsession['meetingdescription'], 64), |
|
| 263 | + 'bbb-recording-tags' => bigbluebuttonbn_get_tags($bbbsession['cm']->id), // Same as $id. |
|
| 264 | 264 | ]; |
| 265 | 265 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingstatus_enabled')) { |
| 266 | 266 | $metadata["bn-recording-status"] = json_encode( |
| 267 | 267 | array( |
| 268 | 268 | 'email' => array('"' . fullname($USER) . '" <' . $USER->email . '>'), |
| 269 | 269 | 'context' => $bbbsession['bigbluebuttonbnURL'] |
| 270 | - ) |
|
| 271 | - ); |
|
| 270 | + ) |
|
| 271 | + ); |
|
| 272 | 272 | } |
| 273 | 273 | if ((boolean)\mod_bigbluebuttonbn\locallib\config::get('recordingready_enabled')) { |
| 274 | 274 | $metadata['bn-recording-ready-url'] = $bbbsession['recordingReadyURL']; |
@@ -62,91 +62,91 @@ |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | switch (strtolower($action)) { |
| 65 | - case 'logout': |
|
| 66 | - if (isset($errors) && $errors != '') { |
|
| 67 | - bigbluebutton_bbb_view_errors($errors, $id); |
|
| 68 | - break; |
|
| 69 | - } |
|
| 70 | - if (is_null($bbbsession)) { |
|
| 71 | - bigbluebutton_bbb_view_close_window_manually(); |
|
| 72 | - break; |
|
| 73 | - } |
|
| 74 | - // Moodle event logger: Create an event for meeting left. |
|
| 75 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
| 76 | - // Update the cache. |
|
| 77 | - $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
| 78 | - // Close the tab or window where BBB was opened. |
|
| 79 | - bigbluebutton_bbb_view_close_window(); |
|
| 80 | - break; |
|
| 81 | - case 'join': |
|
| 82 | - if (is_null($bbbsession)) { |
|
| 83 | - print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 84 | - break; |
|
| 85 | - } |
|
| 86 | - // See if the session is in progress. |
|
| 87 | - if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
| 88 | - // Since the meeting is already running, we just join the session. |
|
| 89 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 90 | - break; |
|
| 91 | - } |
|
| 92 | - // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
| 93 | - if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
| 94 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 65 | + case 'logout': |
|
| 66 | + if (isset($errors) && $errors != '') { |
|
| 67 | + bigbluebutton_bbb_view_errors($errors, $id); |
|
| 68 | + break; |
|
| 69 | + } |
|
| 70 | + if (is_null($bbbsession)) { |
|
| 71 | + bigbluebutton_bbb_view_close_window_manually(); |
|
| 72 | + break; |
|
| 73 | + } |
|
| 74 | + // Moodle event logger: Create an event for meeting left. |
|
| 75 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_LEFT, $bigbluebuttonbn, $cm); |
|
| 76 | + // Update the cache. |
|
| 77 | + $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
|
| 78 | + // Close the tab or window where BBB was opened. |
|
| 79 | + bigbluebutton_bbb_view_close_window(); |
|
| 95 | 80 | break; |
| 96 | - } |
|
| 97 | - // As the meeting doesn't exist, try to create it. |
|
| 98 | - $response = bigbluebuttonbn_get_create_meeting_array( |
|
| 99 | - bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
| 100 | - bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
| 101 | - $bbbsession['presentation']['name'], |
|
| 102 | - $bbbsession['presentation']['url'] |
|
| 103 | - ); |
|
| 104 | - if (empty($response)) { |
|
| 105 | - // The server is unreachable. |
|
| 106 | - if ($bbbsession['administrator']) { |
|
| 107 | - print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
| 108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 81 | + case 'join': |
|
| 82 | + if (is_null($bbbsession)) { |
|
| 83 | + print_error('view_error_unable_join', 'bigbluebuttonbn'); |
|
| 84 | + break; |
|
| 85 | + } |
|
| 86 | + // See if the session is in progress. |
|
| 87 | + if (bigbluebuttonbn_is_meeting_running($bbbsession['meetingid'])) { |
|
| 88 | + // Since the meeting is already running, we just join the session. |
|
| 89 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 109 | 90 | break; |
| 110 | 91 | } |
| 111 | - if ($bbbsession['moderator']) { |
|
| 112 | - print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
| 92 | + // If user is not administrator nor moderator (user is steudent) and waiting is required. |
|
| 93 | + if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
|
| 94 | + header('Location: '.$bbbsession['logoutURL']); |
|
| 95 | + break; |
|
| 96 | + } |
|
| 97 | + // As the meeting doesn't exist, try to create it. |
|
| 98 | + $response = bigbluebuttonbn_get_create_meeting_array( |
|
| 99 | + bigbluebutton_bbb_view_create_meeting_data($bbbsession), |
|
| 100 | + bigbluebutton_bbb_view_create_meeting_metadata($bbbsession), |
|
| 101 | + $bbbsession['presentation']['name'], |
|
| 102 | + $bbbsession['presentation']['url'] |
|
| 103 | + ); |
|
| 104 | + if (empty($response)) { |
|
| 105 | + // The server is unreachable. |
|
| 106 | + if ($bbbsession['administrator']) { |
|
| 107 | + print_error('view_error_unable_join', 'bigbluebuttonbn', |
|
| 108 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 109 | + break; |
|
| 110 | + } |
|
| 111 | + if ($bbbsession['moderator']) { |
|
| 112 | + print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
|
| 113 | + $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 114 | + break; |
|
| 115 | + } |
|
| 116 | + print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
| 113 | 117 | $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
| 114 | 118 | break; |
| 115 | 119 | } |
| 116 | - print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
|
| 117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 118 | - break; |
|
| 119 | - } |
|
| 120 | - if ($response['returncode'] == 'FAILED') { |
|
| 121 | - // The meeting was not created. |
|
| 122 | - if (!$printerrorkey) { |
|
| 123 | - print_error($response['message'], 'bigbluebuttonbn'); |
|
| 120 | + if ($response['returncode'] == 'FAILED') { |
|
| 121 | + // The meeting was not created. |
|
| 122 | + if (!$printerrorkey) { |
|
| 123 | + print_error($response['message'], 'bigbluebuttonbn'); |
|
| 124 | + break; |
|
| 125 | + } |
|
| 126 | + $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 127 | + print_error($printerrorkey, 'bigbluebuttonbn'); |
|
| 128 | + break; |
|
| 129 | + } |
|
| 130 | + if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 131 | + print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 124 | 132 | break; |
| 125 | 133 | } |
| 126 | - $printerrorkey = bigbluebuttonbn_get_error_key($response['messageKey'], 'view_error_create'); |
|
| 127 | - print_error($printerrorkey, 'bigbluebuttonbn'); |
|
| 134 | + // Moodle event logger: Create an event for meeting created. |
|
| 135 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
| 136 | + // Internal logger: Insert a record with the meeting created. |
|
| 137 | + bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 138 | + // Since the meeting is already running, we just join the session. |
|
| 139 | + bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 128 | 140 | break; |
| 129 | - } |
|
| 130 | - if ($response['hasBeenForciblyEnded'] == 'true') { |
|
| 131 | - print_error(get_string('index_error_forciblyended', 'bigbluebuttonbn')); |
|
| 141 | + case 'play': |
|
| 142 | + $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
| 143 | + // Moodle event logger: Create an event for meeting left. |
|
| 144 | + bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
| 145 | + // Execute the redirect. |
|
| 146 | + header('Location: '.urldecode($href)); |
|
| 132 | 147 | break; |
| 133 | - } |
|
| 134 | - // Moodle event logger: Create an event for meeting created. |
|
| 135 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_MEETING_CREATED, $bigbluebuttonbn, $cm); |
|
| 136 | - // Internal logger: Insert a record with the meeting created. |
|
| 137 | - bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_CREATE); |
|
| 138 | - // Since the meeting is already running, we just join the session. |
|
| 139 | - bigbluebutton_bbb_view_join_meeting($bbbsession, $cm, $bigbluebuttonbn); |
|
| 140 | - break; |
|
| 141 | - case 'play': |
|
| 142 | - $href = bigbluebutton_bbb_view_playback_href($href, $mid, $rid, $rtype); |
|
| 143 | - // Moodle event logger: Create an event for meeting left. |
|
| 144 | - bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
|
| 145 | - // Execute the redirect. |
|
| 146 | - header('Location: '.urldecode($href)); |
|
| 147 | - break; |
|
| 148 | - default: |
|
| 149 | - bigbluebutton_bbb_view_close_window(); |
|
| 148 | + default: |
|
| 149 | + bigbluebutton_bbb_view_close_window(); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 28 | 28 | |
| 29 | 29 | $action = required_param('action', PARAM_TEXT); |
| 30 | 30 | $id = optional_param('id', 0, PARAM_INT); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | // If user is not administrator nor moderator (user is steudent) and waiting is required. |
| 93 | 93 | if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) { |
| 94 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 94 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 95 | 95 | break; |
| 96 | 96 | } |
| 97 | 97 | // As the meeting doesn't exist, try to create it. |
@@ -105,16 +105,16 @@ discard block |
||
| 105 | 105 | // The server is unreachable. |
| 106 | 106 | if ($bbbsession['administrator']) { |
| 107 | 107 | print_error('view_error_unable_join', 'bigbluebuttonbn', |
| 108 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 108 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 109 | 109 | break; |
| 110 | 110 | } |
| 111 | 111 | if ($bbbsession['moderator']) { |
| 112 | 112 | print_error('view_error_unable_join_teacher', 'bigbluebuttonbn', |
| 113 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 113 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 114 | 114 | break; |
| 115 | 115 | } |
| 116 | 116 | print_error('view_error_unable_join_student', 'bigbluebuttonbn', |
| 117 | - $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 117 | + $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn'); |
|
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | if ($response['returncode'] == 'FAILED') { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | // Moodle event logger: Create an event for meeting left. |
| 144 | 144 | bigbluebuttonbn_event_log(BIGBLUEBUTTON_EVENT_RECORDING_VIEWED, $bigbluebuttonbn, $cm, ['other' => $rid]); |
| 145 | 145 | // Execute the redirect. |
| 146 | - header('Location: '.urldecode($href)); |
|
| 146 | + header('Location: ' . urldecode($href)); |
|
| 147 | 147 | break; |
| 148 | 148 | default: |
| 149 | 149 | bigbluebutton_bbb_view_close_window(); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $data['welcome'] .= '<br><br>'; |
| 213 | 213 | $data['welcome'] .= str_replace( |
| 214 | 214 | '%duration%', |
| 215 | - (string) $durationtime, |
|
| 215 | + (string)$durationtime, |
|
| 216 | 216 | get_string('bbbdurationwarning', 'bigbluebuttonbn') |
| 217 | 217 | ); |
| 218 | 218 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_FORCED); |
| 288 | 288 | if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) { |
| 289 | 289 | // No more users allowed to join. |
| 290 | - header('Location: '.$bbbsession['logoutURL']); |
|
| 290 | + header('Location: ' . $bbbsession['logoutURL']); |
|
| 291 | 291 | return; |
| 292 | 292 | } |
| 293 | 293 | // Build the URL. |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | bigbluebuttonbn_participant_joined($bbbsession['meetingid'], |
| 306 | 306 | ($bbbsession['administrator'] || $bbbsession['moderator'])); |
| 307 | 307 | // Execute the redirect. |
| 308 | - header('Location: '.$joinurl); |
|
| 308 | + header('Location: ' . $joinurl); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | /** |
@@ -313,13 +313,13 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | function bigbluebutton_bbb_view_errors($serrors, $id) { |
| 315 | 315 | global $CFG, $OUTPUT; |
| 316 | - $errors = (array) json_decode(urldecode($serrors)); |
|
| 316 | + $errors = (array)json_decode(urldecode($serrors)); |
|
| 317 | 317 | $msgerrors = ''; |
| 318 | 318 | foreach ($errors as $error) { |
| 319 | - $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n"; |
|
| 319 | + $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n"; |
|
| 320 | 320 | } |
| 321 | 321 | echo $OUTPUT->header(); |
| 322 | 322 | print_error('view_error_bigbluebutton', 'bigbluebuttonbn', |
| 323 | - $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors); |
|
| 323 | + $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors); |
|
| 324 | 324 | echo $OUTPUT->footer(); |
| 325 | 325 | } |
@@ -366,26 +366,26 @@ discard block |
||
| 366 | 366 | return array( |
| 367 | 367 | 'status' => false, |
| 368 | 368 | 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn') |
| 369 | - ); |
|
| 369 | + ); |
|
| 370 | 370 | } |
| 371 | 371 | if ($realrecordings[$params['id']]['published'] !== 'true') { |
| 372 | 372 | return array( |
| 373 | 373 | 'status' => false, |
| 374 | 374 | 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn') |
| 375 | - ); |
|
| 375 | + ); |
|
| 376 | 376 | } |
| 377 | 377 | return array( |
| 378 | 378 | 'status' => bigbluebuttonbn_publish_recording_imported( |
| 379 | 379 | $recordings[$params['id']]['imported'], true |
| 380 | 380 | ) |
| 381 | - ); |
|
| 381 | + ); |
|
| 382 | 382 | } |
| 383 | 383 | // As the recordingid was not identified as imported recording link, execute actual publish. |
| 384 | 384 | return array( |
| 385 | 385 | 'status' => bigbluebuttonbn_publish_recordings( |
| 386 | 386 | $params['id'], 'true' |
| 387 | 387 | ) |
| 388 | - ); |
|
| 388 | + ); |
|
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | /** |
@@ -401,26 +401,26 @@ discard block |
||
| 401 | 401 | return array( |
| 402 | 402 | 'status' => false, |
| 403 | 403 | 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn') |
| 404 | - ); |
|
| 404 | + ); |
|
| 405 | 405 | } |
| 406 | 406 | if ($realrecordings[$params['id']]['protected'] === 'true') { |
| 407 | 407 | return array( |
| 408 | 408 | 'status' => false, |
| 409 | 409 | 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn') |
| 410 | - ); |
|
| 410 | + ); |
|
| 411 | 411 | } |
| 412 | 412 | return array( |
| 413 | 413 | 'status' => bigbluebuttonbn_protect_recording_imported( |
| 414 | 414 | $recordings[$params['id']]['imported'], false |
| 415 | 415 | ) |
| 416 | - ); |
|
| 416 | + ); |
|
| 417 | 417 | } |
| 418 | 418 | // As the recordingid was not identified as imported recording link, execute actual uprotect. |
| 419 | 419 | return array( |
| 420 | 420 | 'status' => bigbluebuttonbn_update_recordings( |
| 421 | 421 | $params['id'], array('protect' => 'false') |
| 422 | 422 | ) |
| 423 | - ); |
|
| 423 | + ); |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | /** |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | 'status' => bigbluebuttonbn_publish_recording_imported( |
| 435 | 435 | $recordings[$params['id']]['imported'], false |
| 436 | 436 | ) |
| 437 | - ); |
|
| 437 | + ); |
|
| 438 | 438 | } |
| 439 | 439 | // As the recordingid was not identified as imported recording link, execute unpublish on a real recording. |
| 440 | 440 | // First: Unpublish imported links associated to the recording. |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | 'status' => bigbluebuttonbn_publish_recordings( |
| 453 | 453 | $params['id'], 'false' |
| 454 | 454 | ) |
| 455 | - ); |
|
| 455 | + ); |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | /** |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | 'status' => bigbluebuttonbn_protect_recording_imported( |
| 467 | 467 | $recordings[$params['id']]['imported'], true |
| 468 | 468 | ) |
| 469 | - ); |
|
| 469 | + ); |
|
| 470 | 470 | } |
| 471 | 471 | // As the recordingid was not identified as imported recording link, execute protect on a real recording. |
| 472 | 472 | // First: Protect imported links associated to the recording. |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | 'status' => bigbluebuttonbn_update_recordings( |
| 485 | 485 | $params['id'], array('protect' => 'true') |
| 486 | 486 | ) |
| 487 | - ); |
|
| 487 | + ); |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | /** |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | 'status' => bigbluebuttonbn_delete_recording_imported( |
| 499 | 499 | $recordings[$params['id']]['imported'] |
| 500 | 500 | ) |
| 501 | - ); |
|
| 501 | + ); |
|
| 502 | 502 | } |
| 503 | 503 | // As the recordingid was not identified as imported recording link, execute delete on a real recording. |
| 504 | 504 | // First: Delete imported links associated to the recording. |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | 'status' => bigbluebuttonbn_delete_recordings( |
| 515 | 515 | $params['id'] |
| 516 | 516 | ) |
| 517 | - ); |
|
| 517 | + ); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | /** |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | 'status' => bigbluebuttonbn_update_recording_imported( |
| 528 | 528 | $recordings[$params['id']]['imported'], json_decode($params['meta'], true) |
| 529 | 529 | ) |
| 530 | - ); |
|
| 530 | + ); |
|
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | // As the recordingid was not identified as imported recording link, execute update on a real recording. |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | 'status' => bigbluebuttonbn_update_recordings( |
| 538 | 538 | $params['id'], json_decode($params['meta']) |
| 539 | 539 | ) |
| 540 | - ); |
|
| 540 | + ); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | /** |
@@ -682,10 +682,10 @@ discard block |
||
| 682 | 682 | $params['recording_import'] = ['id' => 'The recordingID must be specified.']; |
| 683 | 683 | $params['recording_ready'] = [ |
| 684 | 684 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 685 | - ]; |
|
| 685 | + ]; |
|
| 686 | 686 | $params['live_session_events'] = [ |
| 687 | 687 | 'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].' |
| 688 | - ]; |
|
| 688 | + ]; |
|
| 689 | 689 | return $params; |
| 690 | 690 | } |
| 691 | 691 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | * @author Jesus Federico (jesus [at] blindsidenetworks [dt] com) |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 27 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 26 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 27 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 28 | 28 | |
| 29 | 29 | use \Firebase\JWT\JWT; |
| 30 | 30 | |
@@ -40,13 +40,13 @@ discard block |
||
| 40 | 40 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
| 41 | 41 | |
| 42 | 42 | if (empty($params['action'])) { |
| 43 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 43 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 44 | 44 | return; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 48 | 48 | if (!empty($error)) { |
| 49 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 49 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 133 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 134 | 134 | return; |
| 135 | 135 | |
| 136 | 136 | } catch (Exception $e) { |
| 137 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 137 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 138 | 138 | return; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 271 | 271 | $callbackresponse['status'] = true; |
| 272 | 272 | $callbackresponse['found'] = true; |
| 273 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 273 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 274 | 274 | if (!isset($params['meta']) || empty($params['meta'])) { |
| 275 | 275 | return $callbackresponse; |
| 276 | 276 | } |
@@ -549,8 +549,8 @@ discard block |
||
| 549 | 549 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 550 | 550 | (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 551 | 551 | } catch (Exception $e) { |
| 552 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 553 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 552 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 553 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 554 | 554 | return; |
| 555 | 555 | } |
| 556 | 556 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -566,8 +566,8 @@ discard block |
||
| 566 | 566 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 567 | 567 | header('HTTP/1.0 202 Accepted'); |
| 568 | 568 | } catch (Exception $e) { |
| 569 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 570 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 569 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 570 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 571 | 571 | } |
| 572 | 572 | } |
| 573 | 573 | |
@@ -583,13 +583,13 @@ discard block |
||
| 583 | 583 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 584 | 584 | if (!isset($importrecordings[$params['id']])) { |
| 585 | 585 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 586 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 586 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 587 | 587 | return; |
| 588 | 588 | } |
| 589 | 589 | $callbackresponse = array('status' => true); |
| 590 | 590 | $importrecordings[$params['id']]['imported'] = true; |
| 591 | 591 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 592 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 592 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 593 | 593 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 594 | 594 | // Moodle event logger: Create an event for recording imported. |
| 595 | 595 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -609,8 +609,8 @@ discard block |
||
| 609 | 609 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 610 | 610 | (string)\mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 611 | 611 | } catch (Exception $e) { |
| 612 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 613 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 612 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 613 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 614 | 614 | return; |
| 615 | 615 | } |
| 616 | 616 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | } |
| 647 | 647 | $action = strtolower($params['action']); |
| 648 | 648 | if (!array_key_exists($action, $requiredparams)) { |
| 649 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 649 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 650 | 650 | } |
| 651 | 651 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
| 652 | 652 | } |