Completed
Pull Request — v2.2-stable (#69)
by
unknown
01:58
created
db/upgrade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once(dirname(dirname(__FILE__)).'/locallib.php');
29
+require_once(dirname(dirname(__FILE__)) . '/locallib.php');
30 30
 
31 31
 /**
32 32
  * Performs data migrations and updates on upgrade.
Please login to merge, or discard this patch.
classes/privacy/provider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
             function($instanceid, $data) use ($user, $instanceidstocmids) {
213 213
                 $context = \context_module::instance($instanceidstocmids[$instanceid]);
214 214
                 $contextdata = helper::get_context_data($context, $user);
215
-                $finaldata = (object) array_merge((array) $contextdata, ['logs' => $data]);
215
+                $finaldata = (object)array_merge((array)$contextdata, ['logs' => $data]);
216 216
                 helper::export_context_files($context, $user);
217 217
                 writer::with_context($context)->export_data([], $finaldata);
218 218
             }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public static function _get_metadata(collection $collection) {
63 63
 
64
-         // The table bigbluebuttonbn stores only the room properties.
65
-         // However, there is a chance that some personal information is stored as metadata.
66
-         // This would be done in the column 'participants' where rules can be set to define BBB roles.
67
-         // It is fair to say that only the userid is stored, which is useless if user is removed.
68
-         // But if this is a concern a refactoring on the way the rules are stored will be required.
64
+            // The table bigbluebuttonbn stores only the room properties.
65
+            // However, there is a chance that some personal information is stored as metadata.
66
+            // This would be done in the column 'participants' where rules can be set to define BBB roles.
67
+            // It is fair to say that only the userid is stored, which is useless if user is removed.
68
+            // But if this is a concern a refactoring on the way the rules are stored will be required.
69 69
         $collection->add_database_table('bigbluebuttonbn', [
70 70
             'participants' => 'privacy:metadata:bigbluebuttonbn:participants',
71 71
         ], 'privacy:metadata:bigbluebuttonbn');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                     'meetingid' => $record->meetingid,
209 209
                     'log' => $record->log,
210 210
                     'meta' => $record->meta,
211
-                  ];
211
+                    ];
212 212
                 return $carry;
213 213
             },
214 214
             function($instanceid, $data) use ($user, $instanceidstocmids) {
Please login to merge, or discard this patch.
classes/locallib/config.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -152,33 +152,33 @@
 block discarded – undo
152 152
      */
153 153
     public static function get_options() {
154 154
         return array(
155
-               'version_major' => self::get_moodle_version_major(),
156
-               'voicebridge_editable' => self::get('voicebridge_editable'),
157
-               'importrecordings_enabled' => self::get('importrecordings_enabled'),
158
-               'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
159
-               'waitformoderator_default' => self::get('waitformoderator_default'),
160
-               'waitformoderator_editable' => self::get('waitformoderator_editable'),
161
-               'userlimit_default' => self::get('userlimit_default'),
162
-               'userlimit_editable' => self::get('userlimit_editable'),
163
-               'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
164
-               'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
165
-               'recordings_enabled' => self::get('recordings_enabled'),
166
-               'recordings_html_default' => self::get('recordings_html_default'),
167
-               'recordings_html_editable' => self::get('recordings_html_editable'),
168
-               'recordings_deleted_default' => self::get('recordings_deleted_default'),
169
-               'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
170
-               'recordings_imported_default' => self::get('recordings_imported_default'),
171
-               'recordings_imported_editable' => self::get('recordings_imported_editable'),
172
-               'recordings_preview_default' => self::get('recordings_preview_default'),
173
-               'recordings_preview_editable' => self::get('recordings_preview_editable'),
174
-               'recording_default' => self::get('recording_default'),
175
-               'recording_editable' => self::get('recording_editable'),
176
-               'recording_icons_enabled' => self::get('recording_icons_enabled'),
177
-               'general_warning_message' => self::get('general_warning_message'),
178
-               'general_warning_box_type' => self::get('general_warning_box_type'),
179
-               'general_warning_button_text' => self::get('general_warning_button_text'),
180
-               'general_warning_button_href' => self::get('general_warning_button_href'),
181
-               'general_warning_button_class' => self::get('general_warning_button_class'),
182
-          );
155
+                'version_major' => self::get_moodle_version_major(),
156
+                'voicebridge_editable' => self::get('voicebridge_editable'),
157
+                'importrecordings_enabled' => self::get('importrecordings_enabled'),
158
+                'importrecordings_from_deleted_enabled' => self::get('importrecordings_from_deleted_enabled'),
159
+                'waitformoderator_default' => self::get('waitformoderator_default'),
160
+                'waitformoderator_editable' => self::get('waitformoderator_editable'),
161
+                'userlimit_default' => self::get('userlimit_default'),
162
+                'userlimit_editable' => self::get('userlimit_editable'),
163
+                'preuploadpresentation_enabled' => self::get('preuploadpresentation_enabled'),
164
+                'sendnotifications_enabled' => self::get('sendnotifications_enabled'),
165
+                'recordings_enabled' => self::get('recordings_enabled'),
166
+                'recordings_html_default' => self::get('recordings_html_default'),
167
+                'recordings_html_editable' => self::get('recordings_html_editable'),
168
+                'recordings_deleted_default' => self::get('recordings_deleted_default'),
169
+                'recordings_deleted_editable' => self::get('recordings_deleted_editable'),
170
+                'recordings_imported_default' => self::get('recordings_imported_default'),
171
+                'recordings_imported_editable' => self::get('recordings_imported_editable'),
172
+                'recordings_preview_default' => self::get('recordings_preview_default'),
173
+                'recordings_preview_editable' => self::get('recordings_preview_editable'),
174
+                'recording_default' => self::get('recording_default'),
175
+                'recording_editable' => self::get('recording_editable'),
176
+                'recording_icons_enabled' => self::get('recording_icons_enabled'),
177
+                'general_warning_message' => self::get('general_warning_message'),
178
+                'general_warning_box_type' => self::get('general_warning_box_type'),
179
+                'general_warning_button_text' => self::get('general_warning_button_text'),
180
+                'general_warning_button_href' => self::get('general_warning_button_href'),
181
+                'general_warning_button_class' => self::get('general_warning_button_class'),
182
+            );
183 183
     }
184 184
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public static function defaultvalues() {
57 57
         return array(
58
-            'server_url' => (string) BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
-            'shared_secret' => (string) BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
58
+            'server_url' => (string)BIGBLUEBUTTONBN_DEFAULT_SERVER_URL,
59
+            'shared_secret' => (string)BIGBLUEBUTTONBN_DEFAULT_SHARED_SECRET,
60 60
             'voicebridge_editable' => 'false',
61 61
             'importrecordings_enabled' => 'false',
62 62
             'importrecordings_from_deleted_enabled' => 'false',
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
         if (isset($CFG->bigbluebuttonbn[$setting])) {
122 122
             return (string)$CFG->bigbluebuttonbn[$setting];
123 123
         }
124
-        if (isset($CFG->{'bigbluebuttonbn_'.$setting})) {
125
-            return (string)$CFG->{'bigbluebuttonbn_'.$setting};
124
+        if (isset($CFG->{'bigbluebuttonbn_' . $setting})) {
125
+            return (string)$CFG->{'bigbluebuttonbn_' . $setting};
126 126
         }
127 127
         return self::defaultvalue($setting);
128 128
     }
Please login to merge, or discard this patch.
classes/locallib/notifier.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public static function notification_process($context, $bigbluebuttonbn, $action) {
48 48
         global $USER;
49 49
         // Prepare message.
50
-        $msg = (object) array();
50
+        $msg = (object)array();
51 51
         // Build the message_body.
52 52
         $msg->action = $action;
53 53
         $msg->activity_type = '';
@@ -72,26 +72,26 @@  discard block
 block discarded – undo
72 72
      * @return string
73 73
      */
74 74
     public static function notification_msg_html($msg) {
75
-        $messagetext = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.
76
-            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
77
-        $messagetext .= '<p><b>'.$msg->activity_title.'</b> '.
78
-            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
79
-        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
80
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
81
-            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
82
-        $messagetext .= $msg->activity_title.'</td></tr>'."\n";
83
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
84
-            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
85
-        $messagetext .= $msg->activity_description.'</td></tr>'."\n";
86
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
87
-            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
88
-        $messagetext .= $msg->activity_openingtime.'</td></tr>'."\n";
89
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.
90
-            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
91
-        $messagetext .= $msg->activity_closingtime.'</td></tr>'."\n";
92
-        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.
93
-            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
94
-        $messagetext .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
75
+        $messagetext = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' .
76
+            get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
77
+        $messagetext .= '<p><b>' . $msg->activity_title . '</b> ' .
78
+            get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
79
+        $messagetext .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
80
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
81
+            get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
82
+        $messagetext .= $msg->activity_title . '</td></tr>' . "\n";
83
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
84
+            get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
85
+        $messagetext .= $msg->activity_description . '</td></tr>' . "\n";
86
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
87
+            get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
88
+        $messagetext .= $msg->activity_openingtime . '</td></tr>' . "\n";
89
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' .
90
+            get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
91
+        $messagetext .= $msg->activity_closingtime . '</td></tr>' . "\n";
92
+        $messagetext .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' .
93
+            get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
94
+        $messagetext .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
95 95
         return $messagetext;
96 96
     }
97 97
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
         global $DB;
109 109
         $course = $DB->get_record('course', array('id' => $bigbluebuttonbn->course), '*', MUST_EXIST);
110 110
         // Complete message.
111
-        $msg = (object) array();
111
+        $msg = (object)array();
112 112
         $msg->user_name = fullname($sender);
113 113
         $msg->user_email = $sender->email;
114 114
         $msg->course_name = "$course->fullname";
115
-        $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.
116
-            $msg->user_name.'('.$msg->user_email.') ';
117
-        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
118
-        $users = (array) get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
115
+        $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' .
116
+            $msg->user_name . '(' . $msg->user_email . ') ';
117
+        $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
118
+        $users = (array)get_enrolled_users($context, '', 0, 'u.*', null, 0, 0, true);
119 119
         foreach ($users as $user) {
120 120
             if ($user->id != $sender->id) {
121 121
                 message_post_message($sender, $user, $message, FORMAT_MOODLE);
Please login to merge, or discard this patch.
bbb_broker.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -818,6 +818,7 @@
 block discarded – undo
818 818
 /**
819 819
  * Helper for definig default rules for validating required parameters.
820 820
  *
821
+ * @param string $id
821 822
  * @return array
822 823
  */
823 824
 function bigbluebuttonbn_broker_required_parameters_default($id) {
Please login to merge, or discard this patch.
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -439,26 +439,26 @@  discard block
 block discarded – undo
439 439
             return array(
440 440
                 'status' => false,
441 441
                 'message' => get_string('view_recording_publish_link_deleted', 'bigbluebuttonbn')
442
-              );
442
+                );
443 443
         }
444 444
         if ($realrecordings[$params['id']]['published'] !== 'true') {
445 445
             return array(
446 446
                 'status' => false,
447 447
                 'message' => get_string('view_recording_publish_link_not_published', 'bigbluebuttonbn')
448
-              );
448
+                );
449 449
         }
450 450
         return array(
451 451
             'status' => bigbluebuttonbn_publish_recording_imported(
452 452
                 $recordings[$params['id']]['imported'], true
453 453
             )
454
-          );
454
+            );
455 455
     }
456 456
     // As the recordingid was not identified as imported recording link, execute actual publish.
457 457
     return array(
458 458
         'status' => bigbluebuttonbn_publish_recordings(
459 459
             $params['id'], 'true'
460 460
         )
461
-      );
461
+        );
462 462
 }
463 463
 
464 464
 /**
@@ -479,26 +479,26 @@  discard block
 block discarded – undo
479 479
             return array(
480 480
                 'status' => false,
481 481
                 'message' => get_string('view_recording_unprotect_link_deleted', 'bigbluebuttonbn')
482
-              );
482
+                );
483 483
         }
484 484
         if ($realrecordings[$params['id']]['protected'] === 'true') {
485 485
             return array(
486 486
                 'status' => false,
487 487
                 'message' => get_string('view_recording_unprotect_link_not_unprotected', 'bigbluebuttonbn')
488
-              );
488
+                );
489 489
         }
490 490
         return array(
491 491
             'status' => bigbluebuttonbn_protect_recording_imported(
492 492
                 $recordings[$params['id']]['imported'], false
493 493
             )
494
-          );
494
+            );
495 495
     }
496 496
     // As the recordingid was not identified as imported recording link, execute actual uprotect.
497 497
     return array(
498 498
         'status' => bigbluebuttonbn_update_recordings(
499 499
             $params['id'], array('protect' => 'false')
500 500
         )
501
-      );
501
+        );
502 502
 }
503 503
 
504 504
 /**
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
             'status' => bigbluebuttonbn_publish_recording_imported(
518 518
                 $recordings[$params['id']]['imported'], false
519 519
             )
520
-          );
520
+            );
521 521
     }
522 522
     // As the recordingid was not identified as imported recording link, execute unpublish on a real recording.
523 523
     // First: Unpublish imported links associated to the recording.
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
         'status' => bigbluebuttonbn_publish_recordings(
536 536
             $params['id'], 'false'
537 537
         )
538
-      );
538
+        );
539 539
 }
540 540
 
541 541
 /**
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
             'status' => bigbluebuttonbn_protect_recording_imported(
555 555
                 $recordings[$params['id']]['imported'], true
556 556
             )
557
-          );
557
+            );
558 558
     }
559 559
     // As the recordingid was not identified as imported recording link, execute protect on a real recording.
560 560
     // First: Protect imported links associated to the recording.
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
         'status' => bigbluebuttonbn_update_recordings(
573 573
             $params['id'], array('protect' => 'true')
574 574
         )
575
-      );
575
+        );
576 576
 }
577 577
 
578 578
 /**
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
             'status' => bigbluebuttonbn_delete_recording_imported(
592 592
                 $recordings[$params['id']]['imported']
593 593
             )
594
-          );
594
+            );
595 595
     }
596 596
     // As the recordingid was not identified as imported recording link, execute delete on a real recording.
597 597
     // First: Delete imported links associated to the recording.
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     // Second: Execute the actual delete.
606 606
     return array(
607 607
         'status' => bigbluebuttonbn_delete_recordings($params['id'])
608
-      );
608
+        );
609 609
 }
610 610
 
611 611
 /**
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
             'status' => bigbluebuttonbn_update_recording_imported(
624 624
                 $recordings[$params['id']]['imported'], json_decode($params['meta'], true)
625 625
             )
626
-          );
626
+            );
627 627
     }
628 628
 
629 629
     // As the recordingid was not identified as imported recording link, execute update on a real recording.
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
         'status' => bigbluebuttonbn_update_recordings(
634 634
             $params['id'], json_decode($params['meta'])
635 635
         )
636
-      );
636
+        );
637 637
 }
638 638
 
639 639
 /**
@@ -665,14 +665,14 @@  discard block
 block discarded – undo
665 665
     }
666 666
     // Sends the messages.
667 667
     try {
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){
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){
670 670
         bigbluebuttonbn_send_notification_recording_ready($bigbluebuttonbn);
671
-      }
672
-      $overrides = array('meetingid' => $bigbluebuttonbn->meetingid);
673
-      $meta = '{"recordID":'.$decodedparameters->record_id.'}';
674
-      bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
675
-      header('HTTP/1.0 202 Accepted');
671
+        }
672
+        $overrides = array('meetingid' => $bigbluebuttonbn->meetingid);
673
+        $meta = '{"recordID":'.$decodedparameters->record_id.'}';
674
+        bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, $meta);
675
+        header('HTTP/1.0 202 Accepted');
676 676
     } catch (Exception $e) {
677 677
         $error = 'Caught exception: '.$e->getMessage();
678 678
         header('HTTP/1.0 503 Service Unavailable. '.$error);
@@ -806,11 +806,11 @@  discard block
 block discarded – undo
806 806
     $params['recording_ready'] = [
807 807
             'bigbluebuttonbn' => 'An id for the bigbluebuttonbn instance should be included.',
808 808
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
809
-          ];
809
+            ];
810 810
     $params['live_session_events'] = [
811 811
             'bigbluebuttonbn' => 'An id for the bigbluebuttonbn instance should be included.',
812 812
             'signed_parameters' => 'A JWT encoded string must be included as [signed_parameters].'
813
-          ];
813
+            ];
814 814
     return $params;
815 815
 }
816 816
 
@@ -821,9 +821,9 @@  discard block
 block discarded – undo
821 821
  */
822 822
 function bigbluebuttonbn_broker_required_parameters_default($id) {
823 823
     return [
824
-              'id' => "The {$id} must be specified.",
825
-              'callback' => 'This call must include a javascript callback.'
826
-           ];
824
+                'id' => "The {$id} must be specified.",
825
+                'callback' => 'This call must include a javascript callback.'
826
+            ];
827 827
 }
828 828
 
829 829
 /**
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.