Completed
Pull Request — master (#141)
by Jesus
01:53
created
brokerlib.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
209 209
     $callbackresponse['status'] = true;
210 210
     $callbackresponse['found'] = true;
211
-    $callbackresponse['published'] = (string) $recording['published'];
211
+    $callbackresponse['published'] = (string)$recording['published'];
212 212
     if (!isset($params['meta']) || empty($params['meta'])) {
213 213
         return $callbackresponse;
214 214
     }
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'],
536 536
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
537 537
     } catch (Exception $e) {
538
-        $error = 'Caught exception: '.$e->getMessage();
539
-        header('HTTP/1.0 400 Bad Request. '.$error);
538
+        $error = 'Caught exception: ' . $e->getMessage();
539
+        header('HTTP/1.0 400 Bad Request. ' . $error);
540 540
         return;
541 541
     }
542 542
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -561,12 +561,12 @@  discard block
 block discarded – undo
561 561
             bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
562 562
         }
563 563
         $overrides = array('meetingid' => $decodedparameters->meeting_id);
564
-        $meta = '{"recordid":'.$decodedparameters->record_id.'}';
564
+        $meta = '{"recordid":' . $decodedparameters->record_id . '}';
565 565
         bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
566 566
         header('HTTP/1.0 202 Accepted');
567 567
     } catch (Exception $e) {
568
-        $error = 'Caught exception: '.$e->getMessage();
569
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
568
+        $error = 'Caught exception: ' . $e->getMessage();
569
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
570 570
     }
571 571
 }
572 572
 
@@ -587,13 +587,13 @@  discard block
 block discarded – undo
587 587
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
588 588
     if (!isset($importrecordings[$params['id']])) {
589 589
         $error = "Recording {$params['id']} could not be found. It can not be imported";
590
-        header('HTTP/1.0 404 Not found. '.$error);
590
+        header('HTTP/1.0 404 Not found. ' . $error);
591 591
         return;
592 592
     }
593 593
     $callbackresponse = array('status' => true);
594 594
     $importrecordings[$params['id']]['imported'] = true;
595 595
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
596
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
596
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
597 597
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
598 598
     // Moodle event logger: Create an event for recording imported.
599 599
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -618,8 +618,8 @@  discard block
 block discarded – undo
618 618
         $decodedparameters = \Firebase\JWT\JWT::decode($params['signed_parameters'],
619 619
             \mod_bigbluebuttonbn\locallib\config::get('shared_secret'), array('HS256'));
620 620
     } catch (Exception $e) {
621
-        $error = 'Caught exception: '.$e->getMessage();
622
-        header('HTTP/1.0 400 Bad Request. '.$error);
621
+        $error = 'Caught exception: ' . $e->getMessage();
622
+        header('HTTP/1.0 400 Bad Request. ' . $error);
623 623
         return;
624 624
     }
625 625
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
     }
661 661
     $action = strtolower($params['action']);
662 662
     if (!array_key_exists($action, $requiredparams)) {
663
-        return 'Action '.$params['action'].' can not be performed.';
663
+        return 'Action ' . $params['action'] . ' can not be performed.';
664 664
     }
665 665
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
666 666
 }
Please login to merge, or discard this patch.
bbb_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
24 24
  */
25 25
 
26
-require(__DIR__.'/../../config.php');
27
-require_once(__DIR__.'/locallib.php');
28
-require_once(__DIR__.'/brokerlib.php');
26
+require(__DIR__ . '/../../config.php');
27
+require_once(__DIR__ . '/locallib.php');
28
+require_once(__DIR__ . '/brokerlib.php');
29 29
 
30 30
 global $PAGE, $USER, $CFG, $SESSION, $DB;
31 31
 
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 require_login(null, true);
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
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         echo bigbluebuttonbn_broker_recording_import($bbbsession, $params);
122 122
         return;
123 123
     }
124
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
124
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
125 125
 } catch (Exception $e) {
126
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
126
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
127 127
 }
Please login to merge, or discard this patch.
bbb_broker.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
  * @author    Darko Miletic  (darko.miletic [at] gmail [dt] com)
25 25
  */
26 26
 
27
-require(__DIR__.'/../../config.php');
28
-require_once(__DIR__.'/locallib.php');
29
-require_once(__DIR__.'/brokerlib.php');
27
+require(__DIR__ . '/../../config.php');
28
+require_once(__DIR__ . '/locallib.php');
29
+require_once(__DIR__ . '/brokerlib.php');
30 30
 
31 31
 use \Firebase\JWT\JWT;
32 32
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 $params['meta'] = optional_param('meta', '', PARAM_TEXT);
43 43
 
44 44
 if (empty($params['action'])) {
45
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
45
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
46 46
     return;
47 47
 }
48 48
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 $error = bigbluebuttonbn_broker_validate_parameters($params);
62 62
 if (!empty($error)) {
63
-    header('HTTP/1.0 400 Bad Request. '.$error);
63
+    header('HTTP/1.0 400 Bad Request. ' . $error);
64 64
     return;
65 65
 }
66 66
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         bigbluebuttonbn_broker_live_session_events($params, $bigbluebuttonbn);
80 80
         return;
81 81
     }
82
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
82
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
83 83
 } catch (Exception $e) {
84
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
84
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
85 85
 }
Please login to merge, or discard this patch.