@@ -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 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | function bigbluebuttonbn_broker_recording_info_current($recording, $params) { |
| 321 | 321 | $callbackresponse['status'] = true; |
| 322 | 322 | $callbackresponse['found'] = true; |
| 323 | - $callbackresponse['published'] = (string) $recording['published']; |
|
| 323 | + $callbackresponse['published'] = (string)$recording['published']; |
|
| 324 | 324 | if (!isset($params['meta']) || empty($params['meta'])) { |
| 325 | 325 | return $callbackresponse; |
| 326 | 326 | } |
@@ -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 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -667,8 +667,8 @@ discard block |
||
| 667 | 667 | bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn); |
| 668 | 668 | header('HTTP/1.0 202 Accepted'); |
| 669 | 669 | } catch (Exception $e) { |
| 670 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 671 | - header('HTTP/1.0 503 Service Unavailable. '.$error); |
|
| 670 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 671 | + header('HTTP/1.0 503 Service Unavailable. ' . $error); |
|
| 672 | 672 | } |
| 673 | 673 | } |
| 674 | 674 | |
@@ -689,13 +689,13 @@ discard block |
||
| 689 | 689 | $importrecordings = $SESSION->bigbluebuttonbn_importrecordings; |
| 690 | 690 | if (!isset($importrecordings[$params['id']])) { |
| 691 | 691 | $error = "Recording {$params['id']} could not be found. It can not be imported"; |
| 692 | - header('HTTP/1.0 404 Not found. '.$error); |
|
| 692 | + header('HTTP/1.0 404 Not found. ' . $error); |
|
| 693 | 693 | return; |
| 694 | 694 | } |
| 695 | 695 | $callbackresponse = array('status' => true); |
| 696 | 696 | $importrecordings[$params['id']]['imported'] = true; |
| 697 | 697 | $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']); |
| 698 | - $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}'; |
|
| 698 | + $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}'; |
|
| 699 | 699 | bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta); |
| 700 | 700 | // Moodle event logger: Create an event for recording imported. |
| 701 | 701 | if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) { |
@@ -721,8 +721,8 @@ discard block |
||
| 721 | 721 | $decodedparameters = JWT::decode($params['signed_parameters'], |
| 722 | 722 | \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256')); |
| 723 | 723 | } catch (Exception $e) { |
| 724 | - $error = 'Caught exception: '.$e->getMessage(); |
|
| 725 | - header('HTTP/1.0 400 Bad Request. '.$error); |
|
| 724 | + $error = 'Caught exception: ' . $e->getMessage(); |
|
| 725 | + header('HTTP/1.0 400 Bad Request. ' . $error); |
|
| 726 | 726 | return; |
| 727 | 727 | } |
| 728 | 728 | // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received. |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | } |
| 764 | 764 | $action = strtolower($params['action']); |
| 765 | 765 | if (!array_key_exists($action, $requiredparams)) { |
| 766 | - return 'Action '.$params['action'].' can not be performed.'; |
|
| 766 | + return 'Action ' . $params['action'] . ' can not be performed.'; |
|
| 767 | 767 | } |
| 768 | 768 | return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]); |
| 769 | 769 | } |