@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | 26 | |
| 27 | -require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); |
|
| 28 | -require_once(dirname(__FILE__).'/locallib.php'); |
|
| 27 | +require_once(dirname(dirname(dirname(__FILE__))) . '/config.php'); |
|
| 28 | +require_once(dirname(__FILE__) . '/locallib.php'); |
|
| 29 | 29 | |
| 30 | 30 | use \Firebase\JWT\JWT; |
| 31 | 31 | |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | $params['meta'] = optional_param('meta', '', PARAM_TEXT); |
| 42 | 42 | |
| 43 | 43 | if (empty($params['action'])) { |
| 44 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
| 44 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
| 49 | 49 | if (!empty($error)) { |
| 50 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 50 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
| 135 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
| 136 | 136 | return; |
| 137 | 137 | |
| 138 | 138 | } catch (Exception $e) { |
| 139 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
| 139 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 323 | 323 | $callbackresponse['status'] = true; |
| 324 | 324 | $callbackresponse['found'] = true; |
| 325 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 325 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 326 | 326 | if (!isset($params['meta']) || empty($params['meta'])) { |
| 327 | 327 | return $callbackresponse; |
| 328 | 328 | } |
@@ -651,8 +651,8 @@ discard block |
||
| 651 | 651 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 652 | 652 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 653 | 653 | } catch (Exception $e) { |
| 654 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 655 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 654 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 655 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 656 | 656 | return; |
| 657 | 657 | } |
| 658 | 658 | |
@@ -671,12 +671,12 @@ discard block |
||
| 671 | 671 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 672 | 672 | } |
| 673 | 673 | $overrides = array('meetingid' => $decodedparameters->meeting_id); |
| 674 | - $meta = '{"recordingid":'.$decodedparameters->record_id.'}'; |
|
| 674 | + $meta = '{"recordingid":' . $decodedparameters->record_id . '}'; |
|
| 675 | 675 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); |
| 676 | 676 | header('HTTP/1.0 202 Accepted'); |
| 677 | 677 | } catch (Exception $e) { |
| 678 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 679 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 678 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 679 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | 682 | |
@@ -697,13 +697,13 @@ discard block |
||
| 697 | 697 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 698 | 698 | if (!isset($importrecordings[$params['id']])) { |
| 699 | 699 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 700 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 700 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 701 | 701 | return; |
| 702 | 702 | } |
| 703 | 703 | $callbackresponse = array('status' => true); |
| 704 | 704 | $importrecordings[$params['id']]['imported'] = true; |
| 705 | 705 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 706 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 706 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 707 | 707 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 708 | 708 | // Moodle event logger: Create an event for recording imported. |
| 709 | 709 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -729,8 +729,8 @@ discard block |
||
| 729 | 729 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 730 | 730 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 731 | 731 | } catch (Exception $e) { |
| 732 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 733 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 732 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 733 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 734 | 734 | return; |
| 735 | 735 | } |
| 736 | 736 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | $requiredparams = bigbluebuttonbn_broker_required_parameters(); |
| 766 | 766 | $action = strtolower($params['action']); |
| 767 | 767 | if (!array_key_exists($action, $requiredparams)) { |
| 768 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 768 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 769 | 769 | } |
| 770 | 770 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
| 771 | 771 | } |