@@ -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 | |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | require_login(0, false); |
44 | 44 | |
45 | 45 | if (empty($params['action'])) { |
46 | - header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included'); |
|
46 | + header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included'); |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
50 | 50 | $error = bigbluebuttonbn_broker_validate_parameters($params); |
51 | 51 | if (!empty($error)) { |
52 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
52 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
@@ -134,11 +134,11 @@ discard block |
||
134 | 134 | bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn, $cm); |
135 | 135 | return; |
136 | 136 | } |
137 | - header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist'); |
|
137 | + header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist'); |
|
138 | 138 | return; |
139 | 139 | |
140 | 140 | } catch (Exception $e) { |
141 | - header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage()); |
|
141 | + header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage()); |
|
142 | 142 | return; |
143 | 143 | } |
144 | 144 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
324 | 324 | $callbackresponse['status'] = true; |
325 | 325 | $callbackresponse['found'] = true; |
326 | - $callbackresponse['published'] = (string) $recording['published']; |
|
326 | + $callbackresponse['published'] = (string)$recording['published']; |
|
327 | 327 | if (!isset($params['meta']) || empty($params['meta'])) { |
328 | 328 | return $callbackresponse; |
329 | 329 | } |
@@ -650,8 +650,8 @@ discard block |
||
650 | 650 | $decodedparameters = JWT::decode($params['signed_parameters'], |
651 | 651 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
652 | 652 | } catch (Exception $e) { |
653 | - $error = 'Caught exception: '.$e->getMessage(); |
|
654 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
653 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
654 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
655 | 655 | return; |
656 | 656 | } |
657 | 657 | |
@@ -666,16 +666,16 @@ discard block |
||
666 | 666 | // Sends the messages. |
667 | 667 | try { |
668 | 668 | //That if was for trying to workaround the several emails sent for one record ready |
669 | - if(bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0){ |
|
669 | + if (bigbluebuttonbn_get_count_callback_event_log($decodedparameters->record_id) == 0) { |
|
670 | 670 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
671 | 671 | } |
672 | 672 | $overrides = array('meetingid' => $bigbluebuttonbn->meetingid); |
673 | - $meta = '{"recordID":'.$decodedparameters->record_id.'}'; |
|
673 | + $meta = '{"recordID":' . $decodedparameters->record_id . '}'; |
|
674 | 674 | bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta); |
675 | 675 | header('HTTP/1.0 202 Accepted'); |
676 | 676 | } catch (Exception $e) { |
677 | - $error = 'Caught exception: '.$e->getMessage(); |
|
678 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
677 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
678 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
679 | 679 | } |
680 | 680 | } |
681 | 681 | |
@@ -696,13 +696,13 @@ discard block |
||
696 | 696 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
697 | 697 | if (!isset($importrecordings[$params['id']])) { |
698 | 698 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
699 | - header('HTTP/1.0 404 Not found. '.$error); |
|
699 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
700 | 700 | return; |
701 | 701 | } |
702 | 702 | $callbackresponse = array('status' => true); |
703 | 703 | $importrecordings[$params['id']]['imported'] = true; |
704 | 704 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
705 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
705 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
706 | 706 | bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
707 | 707 | // Moodle event logger: Create an event for recording imported. |
708 | 708 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -728,8 +728,8 @@ discard block |
||
728 | 728 | $decodedparameters = JWT::decode($params['signed_parameters'], |
729 | 729 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
730 | 730 | } catch (Exception $e) { |
731 | - $error = 'Caught exception: '.$e->getMessage(); |
|
732 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
731 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
732 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
733 | 733 | return; |
734 | 734 | } |
735 | 735 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | $requiredparams = bigbluebuttonbn_broker_required_parameters(); |
765 | 765 | $action = strtolower($params['action']); |
766 | 766 | if (!array_key_exists($action, $requiredparams)) { |
767 | - return 'Action '.$params['action'].' can not be performed.'; |
|
767 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
768 | 768 | } |
769 | 769 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
770 | 770 | } |