Completed
Push — master ( 725cb1...411be6 )
by Jesus
02:57
created
index.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -206,6 +206,9 @@
 block discarded – undo
206 206
     return $users;
207 207
 }
208 208
 
209
+/**
210
+ * @param string $role
211
+ */
209 212
 function displayBigBlueButtonRoomsAttendeeList($meetingInfo, $role)
210 213
 {
211 214
     $attendeeList = '';
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
  * @copyright 2010-2015 Blindside Networks Inc
23 23
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
24 24
  */
25
-require_once dirname(dirname(dirname(__FILE__))).'/config.php';
26
-require_once dirname(__FILE__).'/locallib.php';
25
+require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
26
+require_once dirname(__FILE__) . '/locallib.php';
27 27
 
28 28
 $id = required_param('id', PARAM_INT); // Course Module ID, or
29 29
 $a = optional_param('a', 0, PARAM_INT); // bigbluebuttonbn instance ID
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 
102 102
         echo get_string('index_ending', 'bigbluebuttonbn');
103 103
 
104
-        $meetingID = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
104
+        $meetingID = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
105 105
         if ($g != '0') {
106
-            $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID.'['.$g.']', $bigbluebuttonbn->moderatorpass, $endpoint, $shared_secret));
106
+            $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID . '[' . $g . ']', $bigbluebuttonbn->moderatorpass, $endpoint, $shared_secret));
107 107
         } else {
108 108
             $getArray = bigbluebuttonbn_wrap_xml_load_file(bigbluebuttonbn_getEndMeetingURL($meetingID, $bigbluebuttonbn->moderatorpass, $endpoint, $shared_secret));
109 109
         }
110
-        redirect('index.php?id='.$id);
110
+        redirect('index.php?id=' . $id);
111 111
     }
112 112
 }
113 113
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $can_moderate = ($administrator || $moderator);
128 128
 
129 129
         //Add a the data for the bigbluebuttonbn instance
130
-        $groupObj = (groups_get_activity_groupmode($cm) > 0) ? (object) array('id' => 0, 'name' => get_string('allparticipants')) : null;
130
+        $groupObj = (groups_get_activity_groupmode($cm) > 0) ? (object)array('id' => 0, 'name' => get_string('allparticipants')) : null;
131 131
         $table->data[] = displayBigBlueButtonRooms($endpoint, $shared_secret, $can_moderate, $course, $bigbluebuttonbn, $groupObj);
132 132
 
133 133
         //Add a the data for the groups belonging to the bigbluebuttonbn instance, if any
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 /// Functions
149 149
 function displayBigBlueButtonRooms($endpoint, $shared_secret, $moderator, $course, $bigbluebuttonbn, $groupObj = null)
150 150
 {
151
-    $meetingID = $bigbluebuttonbn->meetingid.'-'.$course->id.'-'.$bigbluebuttonbn->id;
151
+    $meetingID = $bigbluebuttonbn->meetingid . '-' . $course->id . '-' . $bigbluebuttonbn->id;
152 152
     if ($groupObj) {
153
-        $meetingID .= '['.$groupObj->id.']';
153
+        $meetingID .= '[' . $groupObj->id . ']';
154 154
         $group = $groupObj->name;
155 155
     }
156 156
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     // Output Users in the meeting
176 176
 
177
-    $joinURL = '<a href="view.php?id='.$bigbluebuttonbn->coursemodule.($groupObj ? '&group='.$groupObj->id : '').'">'.format_string($bigbluebuttonbn->name).'</a>';
177
+    $joinURL = '<a href="view.php?id=' . $bigbluebuttonbn->coursemodule . ($groupObj ? '&group=' . $groupObj->id : '') . '">' . format_string($bigbluebuttonbn->name) . '</a>';
178 178
     $group = '';
179 179
     $users = '';
180 180
     $viewerList = '';
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $attendee_count = 0;
215 215
         foreach ($meetingInfo['attendees']->attendee as $attendee) {
216 216
             if ($attendee->role == $role) {
217
-                $attendeeList .= ($attendee_count++ > 0 ? ', ' : '').$attendee->fullName;
217
+                $attendeeList .= ($attendee_count++ > 0 ? ', ' : '') . $attendee->fullName;
218 218
             }
219 219
         }
220 220
     }
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
     $actions = '';
239 239
 
240 240
     if ($moderator) {
241
-        $actions .= '<form name="form1" method="post" action="">'.'/n';
242
-        $actions .= '  <INPUT type="hidden" name="id" value="'.$course->id.'">'.'/n';
243
-        $actions .= '  <INPUT type="hidden" name="a" value="'.$bigbluebuttonbn->id.'">'.'/n';
241
+        $actions .= '<form name="form1" method="post" action="">' . '/n';
242
+        $actions .= '  <INPUT type="hidden" name="id" value="' . $course->id . '">' . '/n';
243
+        $actions .= '  <INPUT type="hidden" name="a" value="' . $bigbluebuttonbn->id . '">' . '/n';
244 244
         if ($groupObj != null) {
245
-            $actions .= '  <INPUT type="hidden" name="g" value="'.$groupObj->id.'">'.'/n';
245
+            $actions .= '  <INPUT type="hidden" name="g" value="' . $groupObj->id . '">' . '/n';
246 246
         }
247
-        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\''.get_string('index_confirm_end', 'bigbluebuttonbn').'\')">'.'/n';
248
-        $actions .= '</form>'.'/n';
247
+        $actions .= '  <INPUT type="submit" name="submit" value="end" onclick="return confirm(\'' . get_string('index_confirm_end', 'bigbluebuttonbn') . '\')">' . '/n';
248
+        $actions .= '</form>' . '/n';
249 249
     }
250 250
 
251 251
     return $actions;
Please login to merge, or discard this patch.
lib.php 3 patches
Doc Comments   +9 added lines, -1 removed lines patch added patch discarded remove patch
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
  * $return->time = the time they did it
221 221
  * $return->info = a short text description.
222 222
  *
223
- * @return bool
223
+ * @return string
224 224
  */
225 225
 function bigbluebuttonbn_user_outline($course, $user, $mod, $bigbluebuttonbn)
226 226
 {
@@ -544,6 +544,11 @@  discard block
 block discarded – undo
544 544
     send_stored_file($file, 0, 0, $forcedownload, $options); // download MUST be forced - security!
545 545
 }
546 546
 
547
+/**
548
+ * @param stdClass $course
549
+ * @param stdClass $cm
550
+ * @param stdClass $context
551
+ */
547 552
 function bigbluebuttonbn_pluginfile_filename($course, $cm, $context, $args)
548 553
 {
549 554
     global $DB;
@@ -642,6 +647,9 @@  discard block
 block discarded – undo
642 647
     bigbluebuttonbn_notification_send($USER, $bigbluebuttonbn, bigbluebuttonbn_notification_msg_html($msg));
643 648
 }
644 649
 
650
+/**
651
+ * @param stdClass $msg
652
+ */
645 653
 function bigbluebuttonbn_notification_msg_html($msg)
646 654
 {
647 655
     $message_text = '<p>'.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -227,9 +227,9 @@  discard block
 block discarded – undo
227 227
     global $DB;
228 228
 
229 229
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
230
-                                                              'bigbluebuttonbnid' => $bigbluebuttonbn->id,
231
-                                                              'userid' => $user->id,
232
-                                                              'log' => 'Join', ), '*');
230
+                                                                'bigbluebuttonbnid' => $bigbluebuttonbn->id,
231
+                                                                'userid' => $user->id,
232
+                                                                'log' => 'Join', ), '*');
233 233
 
234 234
     if ($completed > 0) {
235 235
         return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.get_string('view_message_times', 'bigbluebuttonbn');
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
 {
249 249
     global $DB;
250 250
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
251
-                                                              'bigbluebuttonbnid' => $bigbluebuttonbn->id,
252
-                                                              'userid' => $user->id,
253
-                                                              'log' => 'Join', ), '*', IGNORE_MULTIPLE);
251
+                                                                'bigbluebuttonbnid' => $bigbluebuttonbn->id,
252
+                                                                'userid' => $user->id,
253
+                                                                'log' => 'Join', ), '*', IGNORE_MULTIPLE);
254 254
 
255 255
     return $completed > 0;
256 256
 }
@@ -317,11 +317,11 @@  discard block
 block discarded – undo
317 317
             $str  = '<div class="bigbluebuttonbn overview">'."\n";
318 318
             $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
319 319
             $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
320
-              '">'.$bigbluebuttonbn->name.'</a>'."\n";
320
+                '">'.$bigbluebuttonbn->name.'</a>'."\n";
321 321
             $str .= '  </div>'."\n";
322 322
             $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).'</div>'."\n";
323 323
             $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
324
-              .'</div>'."\n";
324
+                .'</div>'."\n";
325 325
             $str .= '</div>'."\n";
326 326
 
327 327
             if (empty($htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'])) {
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -26,23 +26,23 @@  discard block
 block discarded – undo
26 26
 
27 27
 global $BIGBLUEBUTTONBN_CFG, $CFG;
28 28
 
29
-require_once $CFG->dirroot.'/calendar/lib.php';
30
-require_once $CFG->dirroot.'/message/lib.php';
31
-require_once $CFG->dirroot.'/mod/lti/OAuth.php';
32
-require_once $CFG->libdir.'/accesslib.php';
33
-require_once $CFG->libdir.'/completionlib.php';
34
-require_once $CFG->libdir.'/datalib.php';
35
-require_once $CFG->libdir.'/coursecatlib.php';
36
-require_once $CFG->libdir.'/enrollib.php';
37
-require_once $CFG->libdir.'/filelib.php';
38
-require_once $CFG->libdir.'/formslib.php';
39
-
40
-require_once dirname(__FILE__).'/vendor/firebase/php-jwt/src/JWT.php';
41
-
42
-if (file_exists(dirname(__FILE__).'/config.php')) {
43
-    require_once dirname(__FILE__).'/config.php';
29
+require_once $CFG->dirroot . '/calendar/lib.php';
30
+require_once $CFG->dirroot . '/message/lib.php';
31
+require_once $CFG->dirroot . '/mod/lti/OAuth.php';
32
+require_once $CFG->libdir . '/accesslib.php';
33
+require_once $CFG->libdir . '/completionlib.php';
34
+require_once $CFG->libdir . '/datalib.php';
35
+require_once $CFG->libdir . '/coursecatlib.php';
36
+require_once $CFG->libdir . '/enrollib.php';
37
+require_once $CFG->libdir . '/filelib.php';
38
+require_once $CFG->libdir . '/formslib.php';
39
+
40
+require_once dirname(__FILE__) . '/vendor/firebase/php-jwt/src/JWT.php';
41
+
42
+if (file_exists(dirname(__FILE__) . '/config.php')) {
43
+    require_once dirname(__FILE__) . '/config.php';
44 44
     if (isset($BIGBLUEBUTTONBN_CFG)) {
45
-        $CFG = (object) array_merge((array) $CFG, (array) $BIGBLUEBUTTONBN_CFG);
45
+        $CFG = (object)array_merge((array)$CFG, (array)$BIGBLUEBUTTONBN_CFG);
46 46
     }
47 47
 } else {
48 48
     $BIGBLUEBUTTONBN_CFG = new stdClass();
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
     }
73 73
 
74 74
     $features = array(
75
-        (string) FEATURE_IDNUMBER => true,
76
-        (string) FEATURE_GROUPS => true,
77
-        (string) FEATURE_GROUPINGS => true,
78
-        (string) FEATURE_GROUPMEMBERSONLY => true,
79
-        (string) FEATURE_MOD_INTRO => true,
80
-        (string) FEATURE_BACKUP_MOODLE2 => true,
81
-        (string) FEATURE_COMPLETION_TRACKS_VIEWS => true,
82
-        (string) FEATURE_GRADE_HAS_GRADE => false,
83
-        (string) FEATURE_GRADE_OUTCOMES => false,
84
-        (string) FEATURE_SHOW_DESCRIPTION => true,
75
+        (string)FEATURE_IDNUMBER => true,
76
+        (string)FEATURE_GROUPS => true,
77
+        (string)FEATURE_GROUPINGS => true,
78
+        (string)FEATURE_GROUPMEMBERSONLY => true,
79
+        (string)FEATURE_MOD_INTRO => true,
80
+        (string)FEATURE_BACKUP_MOODLE2 => true,
81
+        (string)FEATURE_COMPLETION_TRACKS_VIEWS => true,
82
+        (string)FEATURE_GRADE_HAS_GRADE => false,
83
+        (string)FEATURE_GRADE_OUTCOMES => false,
84
+        (string)FEATURE_SHOW_DESCRIPTION => true,
85 85
     );
86 86
 
87
-    if (isset($features[(string) $feature])) {
87
+    if (isset($features[(string)$feature])) {
88 88
         return $features[$feature];
89 89
     }
90 90
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     }
168 168
 
169 169
     // End the session associated with this instance (if it's running)
170
-    $meetingID = $bigbluebuttonbn->meetingid.'-'.$bigbluebuttonbn->course.'-'.$bigbluebuttonbn->id;
170
+    $meetingID = $bigbluebuttonbn->meetingid . '-' . $bigbluebuttonbn->course . '-' . $bigbluebuttonbn->id;
171 171
     $modPW = $bigbluebuttonbn->moderatorpass;
172 172
     $url = bigbluebuttonbn_get_cfg_server_url();
173 173
     $shared_secret = bigbluebuttonbn_get_cfg_shared_secret();
@@ -229,10 +229,10 @@  discard block
 block discarded – undo
229 229
     $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id,
230 230
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
231 231
                                                               'userid' => $user->id,
232
-                                                              'log' => 'Join', ), '*');
232
+                                                              'log' => 'Join',), '*');
233 233
 
234 234
     if ($completed > 0) {
235
-        return fullname($user).' '.get_string('view_message_has_joined', 'bigbluebuttonbn').' '.get_string('view_message_session_for', 'bigbluebuttonbn').' '.(string) $completed.' '.get_string('view_message_times', 'bigbluebuttonbn');
235
+        return fullname($user) . ' ' . get_string('view_message_has_joined', 'bigbluebuttonbn') . ' ' . get_string('view_message_session_for', 'bigbluebuttonbn') . ' ' . (string)$completed . ' ' . get_string('view_message_times', 'bigbluebuttonbn');
236 236
     }
237 237
 
238 238
     return '';
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id,
251 251
                                                               'bigbluebuttonbnid' => $bigbluebuttonbn->id,
252 252
                                                               'userid' => $user->id,
253
-                                                              'log' => 'Join', ), '*', IGNORE_MULTIPLE);
253
+                                                              'log' => 'Join',), '*', IGNORE_MULTIPLE);
254 254
 
255 255
     return $completed > 0;
256 256
 }
@@ -314,15 +314,15 @@  discard block
 block discarded – undo
314 314
             if ($bigbluebuttonbn->visible) {
315 315
                 $classes = 'class="dimmed" ';
316 316
             }
317
-            $str  = '<div class="bigbluebuttonbn overview">'."\n";
318
-            $str .= '  <div class="name">'.get_string('modulename', 'bigbluebuttonbn').':&nbsp;'."\n";
319
-            $str .= '    <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule.
320
-              '">'.$bigbluebuttonbn->name.'</a>'."\n";
321
-            $str .= '  </div>'."\n";
322
-            $str .= '  <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).'</div>'."\n";
323
-            $str .= '  <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime)
324
-              .'</div>'."\n";
325
-            $str .= '</div>'."\n";
317
+            $str  = '<div class="bigbluebuttonbn overview">' . "\n";
318
+            $str .= '  <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ':&nbsp;' . "\n";
319
+            $str .= '    <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule .
320
+              '">' . $bigbluebuttonbn->name . '</a>' . "\n";
321
+            $str .= '  </div>' . "\n";
322
+            $str .= '  <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . '</div>' . "\n";
323
+            $str .= '  <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime)
324
+              .'</div>' . "\n";
325
+            $str .= '</div>' . "\n";
326 326
 
327 327
             if (empty($htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'])) {
328 328
                 $htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'] = '';
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
     // Now that an id was assigned, generate and set the meetingid property based on
420 420
     // [Moodle Instance + Activity ID + BBB Secret] (but only for new activities)
421 421
     if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) {
422
-        $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret());
422
+        $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret());
423 423
         $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id));
424 424
 
425 425
         $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn');
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         // Get the first (and only) file.
494 494
         $file = reset($files);
495 495
         // Set the presentation column in the bigbluebuttonbn table.
496
-        $DB->set_field('bigbluebuttonbn', 'presentation', '/'.$file->get_filename(), array('id' => $bigbluebuttonbn_id));
496
+        $DB->set_field('bigbluebuttonbn', 'presentation', '/' . $file->get_filename(), array('id' => $bigbluebuttonbn_id));
497 497
     } else {
498 498
         // Set the presentation column in the bigbluebuttonbn table.
499 499
         $DB->set_field('bigbluebuttonbn', 'presentation', '', array('id' => $bigbluebuttonbn_id));
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
         return false;
535 535
     }
536 536
 
537
-    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename;
537
+    $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename;
538 538
     $fs = get_file_storage();
539 539
     if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
540 540
         return false;
@@ -644,19 +644,19 @@  discard block
 block discarded – undo
644 644
 
645 645
 function bigbluebuttonbn_notification_msg_html($msg)
646 646
 {
647
-    $message_text = '<p>'.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n";
648
-    $message_text .= '<p><b>'.$msg->activity_title.'</b> '.get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n";
649
-    $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n";
650
-    $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n";
651
-    $message_text .= $msg->activity_title.'</td></tr>'."\n";
652
-    $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n";
653
-    $message_text .= $msg->activity_description.'</td></tr>'."\n";
654
-    $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n";
655
-    $message_text .= $msg->activity_openingtime.'</td></tr>'."\n";
656
-    $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n";
657
-    $message_text .= $msg->activity_closingtime.'</td></tr>'."\n";
658
-    $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n";
659
-    $message_text .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n";
647
+    $message_text = '<p>' . $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' . get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n";
648
+    $message_text .= '<p><b>' . $msg->activity_title . '</b> ' . get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n";
649
+    $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n";
650
+    $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n";
651
+    $message_text .= $msg->activity_title . '</td></tr>' . "\n";
652
+    $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n";
653
+    $message_text .= $msg->activity_description . '</td></tr>' . "\n";
654
+    $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
655
+    $message_text .= $msg->activity_openingtime . '</td></tr>' . "\n";
656
+    $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n";
657
+    $message_text .= $msg->activity_closingtime . '</td></tr>' . "\n";
658
+    $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n";
659
+    $message_text .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n";
660 660
 }
661 661
 
662 662
 function bigbluebuttonbn_notification_send($sender, $bigbluebuttonbn, $message = '')
@@ -671,17 +671,17 @@  discard block
 block discarded – undo
671 671
     $msg->user_name = fullname($sender);
672 672
     $msg->user_email = $sender->email;
673 673
     $msg->course_name = "$course->fullname";
674
-    $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.$msg->user_name.'('.$msg->user_email.') ';
675
-    $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>';
674
+    $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . $msg->user_name . '(' . $msg->user_email . ') ';
675
+    $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>';
676 676
 
677 677
     $users = bigbluebuttonbn_get_users($context);
678 678
     foreach ($users as $user) {
679 679
         if ($user->id != $sender->id) {
680 680
             $messageid = message_post_message($sender, $user, $message, FORMAT_HTML);
681 681
             if (!empty($messageid)) {
682
-                error_log('Msg to '.$msg->user_name.' was sent.');
682
+                error_log('Msg to ' . $msg->user_name . ' was sent.');
683 683
             } else {
684
-                error_log('Msg to '.$msg->user_name.' was NOT sent.');
684
+                error_log('Msg to ' . $msg->user_name . ' was NOT sent.');
685 685
             }
686 686
         }
687 687
     }
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 {
716 716
     global $BIGBLUEBUTTONBN_CFG, $CFG;
717 717
 
718
-    return isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? trim(trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url), '/').'/' : (isset($CFG->bigbluebuttonbn_server_url) ? trim(trim($CFG->bigbluebuttonbn_server_url), '/').'/' : 'http://test-install.blindsidenetworks.com/bigbluebutton/');
718
+    return isset($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url) ? trim(trim($BIGBLUEBUTTONBN_CFG->bigbluebuttonbn_server_url), '/') . '/' : (isset($CFG->bigbluebuttonbn_server_url) ? trim(trim($CFG->bigbluebuttonbn_server_url), '/') . '/' : 'http://test-install.blindsidenetworks.com/bigbluebutton/');
719 719
 }
720 720
 
721 721
 function bigbluebuttonbn_get_cfg_shared_secret()
Please login to merge, or discard this patch.
locallib.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -1343,6 +1343,10 @@
 block discarded – undo
1343 1343
     return $row;
1344 1344
 }
1345 1345
 
1346
+/**
1347
+ * @param string $manage_action
1348
+ * @param string $manage_tag
1349
+ */
1346 1350
 function bigbluebuttonbn_actionbar_render($manage_action, $manage_tag, $recording)
1347 1351
 {
1348 1352
     global $OUTPUT;
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1765,24 +1765,24 @@  discard block
 block discarded – undo
1765 1765
 function bigbluebuttonbn_get_cfg_options()
1766 1766
 {
1767 1767
     return [
1768
-          'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(),
1769
-          'recording_default' => bigbluebuttonbn_get_cfg_recording_default(),
1770
-          'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(),
1771
-          'recording_tagging_default' => bigbluebuttonbn_get_cfg_recording_tagging_default(),
1772
-          'recording_tagging_editable' => bigbluebuttonbn_get_cfg_recording_tagging_editable(),
1773
-          'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(),
1774
-          'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(),
1775
-          'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(),
1776
-          'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(),
1777
-          'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(),
1778
-          'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(),
1779
-          'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(),
1780
-          'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(),
1781
-          'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(),
1782
-          'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(),
1783
-          'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(),
1784
-          'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(),
1785
-          'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
1768
+            'voicebridge_editable' => bigbluebuttonbn_get_cfg_voicebridge_editable(),
1769
+            'recording_default' => bigbluebuttonbn_get_cfg_recording_default(),
1770
+            'recording_editable' => bigbluebuttonbn_get_cfg_recording_editable(),
1771
+            'recording_tagging_default' => bigbluebuttonbn_get_cfg_recording_tagging_default(),
1772
+            'recording_tagging_editable' => bigbluebuttonbn_get_cfg_recording_tagging_editable(),
1773
+            'waitformoderator_default' => bigbluebuttonbn_get_cfg_waitformoderator_default(),
1774
+            'waitformoderator_editable' => bigbluebuttonbn_get_cfg_waitformoderator_editable(),
1775
+            'userlimit_default' => bigbluebuttonbn_get_cfg_userlimit_default(),
1776
+            'userlimit_editable' => bigbluebuttonbn_get_cfg_userlimit_editable(),
1777
+            'preuploadpresentation_enabled' => bigbluebuttonbn_get_cfg_preuploadpresentation_enabled(),
1778
+            'sendnotifications_enabled' => bigbluebuttonbn_get_cfg_sendnotifications_enabled(),
1779
+            'recordings_html_default' => bigbluebuttonbn_get_cfg_recordings_html_default(),
1780
+            'recordings_html_editable' => bigbluebuttonbn_get_cfg_recordings_html_editable(),
1781
+            'recordings_deleted_activities_default' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_default(),
1782
+            'recordings_deleted_activities_editable' => bigbluebuttonbn_get_cfg_recordings_deleted_activities_editable(),
1783
+            'recording_icons_enabled' => bigbluebuttonbn_get_cfg_recording_icons_enabled(),
1784
+            'instance_type_enabled' => bigbluebuttonbn_recordings_enabled(),
1785
+            'instance_type_default' => BIGBLUEBUTTONBN_TYPE_ALL,
1786 1786
         ];
1787 1787
 }
1788 1788
 
@@ -2066,8 +2066,8 @@  discard block
 block discarded – undo
2066 2066
     $activity_time = '';
2067 2067
     if ($time) {
2068 2068
         $activity_time = calendar_day_representation($time).' '.
2069
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2070
-          calendar_time_representation($time);
2069
+            get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2070
+            calendar_time_representation($time);
2071 2071
     }
2072 2072
 
2073 2073
     return $activity_time;
Please login to merge, or discard this patch.
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 global $BIGBLUEBUTTONBN_CFG, $CFG;
28 28
 
29
-require_once dirname(__FILE__).'/lib.php';
29
+require_once dirname(__FILE__) . '/lib.php';
30 30
 
31 31
 const BIGBLUEBUTTONBN_FORCED = true;
32 32
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     if (isset($meta)) {
66 66
         $log->meta = $meta;
67 67
     } elseif ($event == BIGBLUEBUTTONBN_LOG_EVENT_CREATE) {
68
-        $log->meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').'}';
68
+        $log->meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . '}';
69 69
     }
70 70
 
71 71
     $DB->insert_record('bigbluebuttonbn_logs', $log);
@@ -74,67 +74,67 @@  discard block
 block discarded – undo
74 74
 //  BigBlueButton API Calls  //
75 75
 function bigbluebuttonbn_getJoinURL($meetingID, $userName, $PW, $SALT, $URL, $logoutURL, $configToken = null, $userId = null)
76 76
 {
77
-    $url_join = $URL.'api/join?';
78
-    $params = 'meetingID='.urlencode($meetingID).'&fullName='.urlencode($userName).'&password='.urlencode($PW).'&logoutURL='.urlencode($logoutURL);
77
+    $url_join = $URL . 'api/join?';
78
+    $params = 'meetingID=' . urlencode($meetingID) . '&fullName=' . urlencode($userName) . '&password=' . urlencode($PW) . '&logoutURL=' . urlencode($logoutURL);
79 79
     if (!is_null($userId)) {
80
-        $params .= '&userID='.urlencode($userId);
80
+        $params .= '&userID=' . urlencode($userId);
81 81
     }
82 82
     if (!is_null($configToken)) {
83
-        $params .= '&configToken='.$configToken;
83
+        $params .= '&configToken=' . $configToken;
84 84
     }
85
-    $url = $url_join.$params.'&checksum='.sha1('join'.$params.$SALT);
85
+    $url = $url_join . $params . '&checksum=' . sha1('join' . $params . $SALT);
86 86
 
87 87
     return $url;
88 88
 }
89 89
 
90 90
 function bigbluebuttonbn_getCreateMeetingURL($name, $meetingID, $attendeePW, $moderatorPW, $welcome, $logoutURL, $SALT, $URL, $record = 'false', $duration = 0, $voiceBridge = 0, $maxParticipants = 0, $metadata = array())
91 91
 {
92
-    $url_create = $URL.'api/create?';
92
+    $url_create = $URL . 'api/create?';
93 93
 
94
-    $params = 'name='.urlencode($name).'&meetingID='.urlencode($meetingID).'&attendeePW='.urlencode($attendeePW).'&moderatorPW='.urlencode($moderatorPW).'&logoutURL='.urlencode($logoutURL).'&record='.$record;
94
+    $params = 'name=' . urlencode($name) . '&meetingID=' . urlencode($meetingID) . '&attendeePW=' . urlencode($attendeePW) . '&moderatorPW=' . urlencode($moderatorPW) . '&logoutURL=' . urlencode($logoutURL) . '&record=' . $record;
95 95
 
96 96
     $voiceBridge = intval($voiceBridge);
97 97
     if ($voiceBridge > 0 && $voiceBridge < 79999) {
98
-        $params .= '&voiceBridge='.$voiceBridge;
98
+        $params .= '&voiceBridge=' . $voiceBridge;
99 99
     }
100 100
 
101 101
     $duration = intval($duration);
102 102
     if ($duration > 0) {
103
-        $params .= '&duration='.$duration;
103
+        $params .= '&duration=' . $duration;
104 104
     }
105 105
 
106 106
     $maxParticipants = intval($maxParticipants);
107 107
     if ($maxParticipants > 0) {
108
-        $params .= '&maxParticipants='.$maxParticipants;
108
+        $params .= '&maxParticipants=' . $maxParticipants;
109 109
     }
110 110
 
111 111
     if (trim($welcome)) {
112
-        $params .= '&welcome='.urlencode($welcome);
112
+        $params .= '&welcome=' . urlencode($welcome);
113 113
     }
114 114
 
115 115
     foreach ($metadata as $key => $value) {
116
-        $params .= '&'.$key.'='.urlencode($value);
116
+        $params .= '&' . $key . '=' . urlencode($value);
117 117
     }
118 118
 
119
-    $url = $url_create.$params.'&checksum='.sha1('create'.$params.$SALT);
119
+    $url = $url_create . $params . '&checksum=' . sha1('create' . $params . $SALT);
120 120
 
121 121
     return $url;
122 122
 }
123 123
 
124 124
 function bigbluebuttonbn_getIsMeetingRunningURL($meetingID, $URL, $SALT)
125 125
 {
126
-    $base_url = $URL.'api/isMeetingRunning?';
127
-    $params = 'meetingID='.urlencode($meetingID);
128
-    $url = $base_url.$params.'&checksum='.sha1('isMeetingRunning'.$params.$SALT);
126
+    $base_url = $URL . 'api/isMeetingRunning?';
127
+    $params = 'meetingID=' . urlencode($meetingID);
128
+    $url = $base_url . $params . '&checksum=' . sha1('isMeetingRunning' . $params . $SALT);
129 129
 
130 130
     return $url;
131 131
 }
132 132
 
133 133
 function bigbluebuttonbn_getMeetingInfoURL($meetingID, $modPW, $URL, $SALT)
134 134
 {
135
-    $base_url = $URL.'api/getMeetingInfo?';
136
-    $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW);
137
-    $url = $base_url.$params.'&checksum='.sha1('getMeetingInfo'.$params.$SALT);
135
+    $base_url = $URL . 'api/getMeetingInfo?';
136
+    $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW);
137
+    $url = $base_url . $params . '&checksum=' . sha1('getMeetingInfo' . $params . $SALT);
138 138
 
139 139
     return $url;
140 140
 }
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function bigbluebuttonbn_getMeetingsURL($URL, $SALT)
147 147
 {
148
-    $base_url = $URL.'api/getMeetings?';
149
-    $url = $base_url.'&checksum='.sha1('getMeetings'.$SALT);
148
+    $base_url = $URL . 'api/getMeetings?';
149
+    $url = $base_url . '&checksum=' . sha1('getMeetings' . $SALT);
150 150
 
151 151
     return $url;
152 152
 }
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
  */
158 158
 function bigbluebuttonbn_getEndMeetingURL($meetingID, $modPW, $URL, $SALT)
159 159
 {
160
-    $base_url = $URL.'api/end?';
161
-    $params = 'meetingID='.urlencode($meetingID).'&password='.urlencode($modPW);
162
-    $url = $base_url.$params.'&checksum='.sha1('end'.$params.$SALT);
160
+    $base_url = $URL . 'api/end?';
161
+    $params = 'meetingID=' . urlencode($meetingID) . '&password=' . urlencode($modPW);
162
+    $url = $base_url . $params . '&checksum=' . sha1('end' . $params . $SALT);
163 163
 
164 164
     return $url;
165 165
 }
@@ -171,9 +171,9 @@  discard block
 block discarded – undo
171 171
  */
172 172
 function bigbluebuttonbn_getRecordingsURL($meetingID, $URL, $SALT)
173 173
 {
174
-    $base_url_record = $URL.'api/getRecordings?';
175
-    $params = 'meetingID='.urlencode($meetingID);
176
-    $url = $base_url_record.$params.'&checksum='.sha1('getRecordings'.$params.$SALT);
174
+    $base_url_record = $URL . 'api/getRecordings?';
175
+    $params = 'meetingID=' . urlencode($meetingID);
176
+    $url = $base_url_record . $params . '&checksum=' . sha1('getRecordings' . $params . $SALT);
177 177
 
178 178
     return $url;
179 179
 }
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
  */
185 185
 function bigbluebuttonbn_getDeleteRecordingsURL($recordID, $URL, $SALT)
186 186
 {
187
-    $url_delete = $URL.'api/deleteRecordings?';
188
-    $params = 'recordID='.urlencode($recordID);
189
-    $url = $url_delete.$params.'&checksum='.sha1('deleteRecordings'.$params.$SALT);
187
+    $url_delete = $URL . 'api/deleteRecordings?';
188
+    $params = 'recordID=' . urlencode($recordID);
189
+    $url = $url_delete . $params . '&checksum=' . sha1('deleteRecordings' . $params . $SALT);
190 190
 
191 191
     return $url;
192 192
 }
@@ -198,30 +198,30 @@  discard block
 block discarded – undo
198 198
  */
199 199
 function bigbluebuttonbn_getPublishRecordingsURL($recordID, $set, $URL, $SALT)
200 200
 {
201
-    $url_publish = $URL.'api/publishRecordings?';
202
-    $params = 'recordID='.$recordID.'&publish='.$set;
203
-    $url = $url_publish.$params.'&checksum='.sha1('publishRecordings'.$params.$SALT);
201
+    $url_publish = $URL . 'api/publishRecordings?';
202
+    $params = 'recordID=' . $recordID . '&publish=' . $set;
203
+    $url = $url_publish . $params . '&checksum=' . sha1('publishRecordings' . $params . $SALT);
204 204
 
205 205
     return $url;
206 206
 }
207 207
 
208 208
 function bigbluebuttonbn_getUpdateRecordingsURL($recordID, $URL, $SALT, $metadata = array())
209 209
 {
210
-    $url_update = $URL.'api/updateRecordings?';
211
-    $params = 'recordID='.$recordID;
210
+    $url_update = $URL . 'api/updateRecordings?';
211
+    $params = 'recordID=' . $recordID;
212 212
     foreach ($metadata as $key => $value) {
213
-        $params .= '&'.'meta_'.$key.'='.urlencode($value);
213
+        $params .= '&' . 'meta_' . $key . '=' . urlencode($value);
214 214
     }
215
-    $url = $url_update.$params.'&checksum='.sha1('updateRecordings'.$params.$SALT);
215
+    $url = $url_update . $params . '&checksum=' . sha1('updateRecordings' . $params . $SALT);
216 216
 
217 217
     return $url;
218 218
 }
219 219
 
220 220
 function bigbluebuttonbn_getDefaultConfigXMLURL($URL, $SALT)
221 221
 {
222
-    $url_default_config = $URL.'api/getDefaultConfigXML?';
222
+    $url_default_config = $URL . 'api/getDefaultConfigXML?';
223 223
     $params = '';
224
-    $url = $url_default_config.$params.'&checksum='.sha1('getDefaultConfigXML'.$params.$SALT);
224
+    $url = $url_default_config . $params . '&checksum=' . sha1('getDefaultConfigXML' . $params . $SALT);
225 225
 
226 226
     return $url;
227 227
 }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
     if (!is_null($presentation_name) && !is_null($presentation_url)) {
233 233
         $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url,
234 234
                 BIGBLUEBUTTONBN_METHOD_POST,
235
-                "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='".$presentation_url."' /></module></modules>"
235
+                "<?xml version='1.0' encoding='UTF-8'?><modules><module name='presentation'><document url='" . $presentation_url . "' /></module></modules>"
236 236
                 );
237 237
     } else {
238 238
         $xml = bigbluebuttonbn_wrap_xml_load_file($create_meeting_url);
@@ -389,11 +389,11 @@  discard block
 block discarded – undo
389 389
     global $DB;
390 390
 
391 391
     if ($bigbluebuttonbnID === null) {
392
-        $select = "courseid = '{$courseID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
392
+        $select = "courseid = '{$courseID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
393 393
     } elseif ($subset) {
394
-        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
394
+        $select = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
395 395
     } else {
396
-        $select = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_IMPORT."'";
396
+        $select = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_IMPORT . "'";
397 397
     }
398 398
     $records_imported = $DB->get_records_select('bigbluebuttonbn_logs', $select);
399 399
 
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 function bigbluebuttonbn_getDefaultConfigXMLArray($URL, $SALT)
426 426
 {
427 427
     $default_config_xml = bigbluebuttonbn_getDefaultConfigXML($URL, $SALT);
428
-    $default_config_xml_array = (array) $default_config_xml;
428
+    $default_config_xml_array = (array)$default_config_xml;
429 429
 
430 430
     return $default_config_xml_array;
431 431
 }
@@ -436,18 +436,18 @@  discard block
 block discarded – undo
436 436
     //Add formats
437 437
     $playbackArray = array();
438 438
     foreach ($recording->playback->format as $format) {
439
-        $playbackArray[(string) $format->type] = array('type' => (string) $format->type, 'url' => (string) $format->url, 'length' => (string) $format->length);
439
+        $playbackArray[(string)$format->type] = array('type' => (string)$format->type, 'url' => (string)$format->url, 'length' => (string)$format->length);
440 440
         //Add preview per format when existing
441 441
         if ($format->preview) {
442 442
             $imagesArray = array();
443 443
             foreach ($format->preview->images->image as $image) {
444
-                $imageArray = array('url' => (string) $image);
444
+                $imageArray = array('url' => (string)$image);
445 445
                 foreach ($image->attributes() as $attKey => $attValue) {
446
-                    $imageArray[$attKey] = (string) $attValue;
446
+                    $imageArray[$attKey] = (string)$attValue;
447 447
                 }
448 448
                 array_push($imagesArray, $imageArray);
449 449
             }
450
-            $playbackArray[(string) $format->type]['preview'] = $imagesArray;
450
+            $playbackArray[(string)$format->type]['preview'] = $imagesArray;
451 451
         }
452 452
     }
453 453
 
@@ -458,10 +458,10 @@  discard block
 block discarded – undo
458 458
         if (is_object($value)) {
459 459
             $value = '';
460 460
         }
461
-        $metadataArray['meta_'.$key] = $value;
461
+        $metadataArray['meta_' . $key] = $value;
462 462
     }
463 463
 
464
-    $recordingArrayValue = array('recordID' => (string) $recording->recordID, 'meetingID' => (string) $recording->meetingID, 'meetingName' => (string) $recording->name, 'published' => (string) $recording->published, 'startTime' => (string) $recording->startTime, 'endTime' => (string) $recording->endTime, 'playbacks' => $playbackArray) + $metadataArray;
464
+    $recordingArrayValue = array('recordID' => (string)$recording->recordID, 'meetingID' => (string)$recording->meetingID, 'meetingName' => (string)$recording->name, 'published' => (string)$recording->published, 'startTime' => (string)$recording->startTime, 'endTime' => (string)$recording->endTime, 'playbacks' => $playbackArray) + $metadataArray;
465 465
 
466 466
     return $recordingArrayValue;
467 467
 }
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 {
550 550
     $endpoint = is_null($URL) ? bigbluebuttonbn_get_cfg_server_url() : $URL;
551 551
 
552
-    $xml = bigbluebuttonbn_wrap_xml_load_file($endpoint.'api');
552
+    $xml = bigbluebuttonbn_wrap_xml_load_file($endpoint . 'api');
553 553
     if ($xml && $xml->returncode == 'SUCCESS') {
554 554
         return $xml->version;
555 555
     } else {
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 function bigbluebuttonbn_wrap_xml_load_file($url, $method = BIGBLUEBUTTONBN_METHOD_GET, $data = null, $content_type = 'text/xml')
575 575
 {
576 576
     if (bigbluebuttonbn_debugdisplay()) {
577
-        error_log('Request to: '.$url);
577
+        error_log('Request to: ' . $url);
578 578
     }
579 579
 
580 580
     if (extension_loaded('curl')) {
@@ -585,8 +585,8 @@  discard block
 block discarded – undo
585 585
                 if (!is_array($data)) {
586 586
                     $options = array();
587 587
                     $options['CURLOPT_HTTPHEADER'] = array(
588
-                            'Content-Type: '.$content_type,
589
-                            'Content-Length: '.strlen($data),
588
+                            'Content-Type: ' . $content_type,
589
+                            'Content-Length: ' . strlen($data),
590 590
                             'Content-Language: en-US',
591 591
                         );
592 592
                     $response = $c->post($url, $data, $options);
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 
603 603
         if ($response) {
604 604
             if (bigbluebuttonbn_debugdisplay()) {
605
-                error_log('Response: '.$response);
605
+                error_log('Response: ' . $response);
606 606
             }
607 607
             $previous = libxml_use_internal_errors(true);
608 608
             try {
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
                 return $xml;
612 612
             } catch (Exception $e) {
613 613
                 libxml_use_internal_errors($previous);
614
-                $error = 'Caught exception: '.$e->getMessage();
614
+                $error = 'Caught exception: ' . $e->getMessage();
615 615
                 error_log($error);
616 616
 
617 617
                 return null;
@@ -626,12 +626,12 @@  discard block
 block discarded – undo
626 626
         try {
627 627
             $response = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NOBLANKS);
628 628
             if (bigbluebuttonbn_debugdisplay()) {
629
-                error_log('Response processed: '.$response->asXML());
629
+                error_log('Response processed: ' . $response->asXML());
630 630
             }
631 631
 
632 632
             return $response;
633 633
         } catch (Exception $e) {
634
-            $error = 'Caught exception: '.$e->getMessage();
634
+            $error = 'Caught exception: ' . $e->getMessage();
635 635
             error_log($error);
636 636
             libxml_use_internal_errors($previous);
637 637
 
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
     if ($user_roles) {
649 649
         $where = '';
650 650
         foreach ($user_roles as $key => $value) {
651
-            $where .= (empty($where) ? ' WHERE' : ' AND').' id='.$value->roleid;
651
+            $where .= (empty($where) ? ' WHERE' : ' AND') . ' id=' . $value->roleid;
652 652
         }
653
-        $user_roles = $DB->get_records_sql('SELECT * FROM {role}'.$where);
653
+        $user_roles = $DB->get_records_sql('SELECT * FROM {role}' . $where);
654 654
     }
655 655
 
656 656
     return $user_roles;
@@ -713,13 +713,13 @@  discard block
 block discarded – undo
713 713
             foreach ($participant_list as $participant) {
714 714
                 $participant_list_array[] = array('selectiontype' => $participant->selectiontype,
715 715
                                                     'selectionid' => $participant->selectionid,
716
-                                                    'role' => $participant->role, );
716
+                                                    'role' => $participant->role,);
717 717
             }
718 718
         }
719 719
     } else {
720 720
         $participant_list_array[] = array('selectiontype' => 'all',
721 721
                                             'selectionid' => 'all',
722
-                                            'role' => BIGBLUEBUTTONBN_ROLE_VIEWER, );
722
+                                            'role' => BIGBLUEBUTTONBN_ROLE_VIEWER,);
723 723
 
724 724
         $moderator_defaults = bigbluebuttonbn_get_cfg_moderator_default();
725 725
         if (!isset($moderator_defaults)) {
@@ -734,14 +734,14 @@  discard block
 block discarded – undo
734 734
                     if ($user->id == $USER->id) {
735 735
                         $participant_list_array[] = array('selectiontype' => 'user',
736 736
                                                             'selectionid' => $USER->id,
737
-                                                            'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, );
737
+                                                            'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR,);
738 738
                         break;
739 739
                     }
740 740
                 }
741 741
             } else {
742 742
                 $participant_list_array[] = array('selectiontype' => 'role',
743 743
                                                     'selectionid' => $moderator_default,
744
-                                                    'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR, );
744
+                                                    'role' => BIGBLUEBUTTONBN_ROLE_MODERATOR,);
745 745
             }
746 746
         }
747 747
     }
@@ -804,9 +804,9 @@  discard block
 block discarded – undo
804 804
     $is_unique = true;
805 805
     if ($voicebridge != 0) {
806 806
         $table = 'bigbluebuttonbn';
807
-        $select = 'voicebridge = '.$voicebridge;
807
+        $select = 'voicebridge = ' . $voicebridge;
808 808
         if ($id) {
809
-            $select .= ' AND id <> '.$id;
809
+            $select .= ' AND id <> ' . $id;
810 810
         }
811 811
         if ($DB->get_records_select($table, $select)) {
812 812
             $is_unique = false;
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
     $mt = microtime();
873 873
     $rand = mt_rand();
874 874
 
875
-    return md5($mt.$rand);
875
+    return md5($mt . $rand);
876 876
 }
877 877
 
878 878
 function bigbluebuttonbn_random_password($length = 8)
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
         }
1049 1049
         if (isset($moderatorPW)) {
1050 1050
             //Ping again and refresh the cache
1051
-            $meeting_info = (array) bigbluebuttonbn_getMeetingInfo($meetingid, $moderatorPW, $endpoint, $shared_secret);
1051
+            $meeting_info = (array)bigbluebuttonbn_getMeetingInfo($meetingid, $moderatorPW, $endpoint, $shared_secret);
1052 1052
             $cache->set($meetingid, array('creation_time' => time(), 'meeting_info' => json_encode($meeting_info)));
1053 1053
         }
1054 1054
     }
@@ -1154,7 +1154,7 @@  discard block
 block discarded – undo
1154 1154
             case 'moodle_event':
1155 1155
                 break;
1156 1156
             default:
1157
-                $error = bigbluebuttonbn_add_error($error, 'Action '.$params['action'].' can not be performed.');
1157
+                $error = bigbluebuttonbn_add_error($error, 'Action ' . $params['action'] . ' can not be performed.');
1158 1158
         }
1159 1159
     }
1160 1160
 
@@ -1180,8 +1180,8 @@  discard block
 block discarded – undo
1180 1180
  */
1181 1181
 function bigbluebuttonbn_setConfigXMLParams($meetingID, $configXML, $SALT)
1182 1182
 {
1183
-    $params = 'configXML='.urlencode($configXML).'&meetingID='.urlencode($meetingID);
1184
-    $config_xml_params = $params.'&checksum='.sha1('setConfigXML'.$params.$SALT);
1183
+    $params = 'configXML=' . urlencode($configXML) . '&meetingID=' . urlencode($meetingID);
1184
+    $config_xml_params = $params . '&checksum=' . sha1('setConfigXML' . $params . $SALT);
1185 1185
 
1186 1186
     return $config_xml_params;
1187 1187
 }
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
  */
1193 1193
 function bigbluebuttonbn_setConfigXML($meetingID, $configXML, $URL, $SALT)
1194 1194
 {
1195
-    $url_default_config = $URL.'api/setConfigXML?';
1195
+    $url_default_config = $URL . 'api/setConfigXML?';
1196 1196
     $config_xml_params = bigbluebuttonbn_setConfigXMLParams($meetingID, $configXML, $SALT);
1197 1197
     $xml = bigbluebuttonbn_wrap_xml_load_file($url_default_config, BIGBLUEBUTTONBN_METHOD_POST, $config_xml_params, 'application/x-www-form-urlencoded');
1198 1198
 
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 function bigbluebuttonbn_setConfigXMLArray($meetingID, $configXML, $URL, $SALT)
1207 1207
 {
1208 1208
     $config_xml = bigbluebuttonbn_setConfigXML($meetingID, $configXML, $URL, $SALT);
1209
-    $config_xml_array = (array) $config_xml;
1209
+    $config_xml_array = (array)$config_xml;
1210 1210
 
1211 1211
     return $config_xml_array;
1212 1212
 }
@@ -1263,19 +1263,19 @@  discard block
 block discarded – undo
1263 1263
 
1264 1264
         //Set recording_types
1265 1265
         if (isset($recording['imported'])) {
1266
-            $attributes = 'data-imported="true" title='.get_string('view_recording_link_warning', 'bigbluebuttonbn');
1266
+            $attributes = 'data-imported="true" title=' . get_string('view_recording_link_warning', 'bigbluebuttonbn');
1267 1267
         } else {
1268 1268
             $attributes = 'data-imported="false"';
1269 1269
         }
1270 1270
 
1271 1271
         $recording_types = '';
1272 1272
         if ($recording['published'] == 'true') {
1273
-            $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'>';
1273
+            $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '>';
1274 1274
         } else {
1275
-            $recording_types .= '<div id="playbacks-'.$recording['recordID'].'" '.$attributes.'" hidden>';
1275
+            $recording_types .= '<div id="playbacks-' . $recording['recordID'] . '" ' . $attributes . '" hidden>';
1276 1276
         }
1277 1277
         foreach ($recording['playbacks'] as $playback) {
1278
-            $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_'.$playback['type'], 'bigbluebuttonbn'), 'target' => '_new')).'&#32;';
1278
+            $recording_types .= $OUTPUT->action_link($playback['url'], get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), null, array('title' => get_string('view_recording_format_' . $playback['type'], 'bigbluebuttonbn'), 'target' => '_new')) . '&#32;';
1279 1279
         }
1280 1280
         $recording_types .= '</div>';
1281 1281
 
@@ -1323,7 +1323,7 @@  discard block
 block discarded – undo
1323 1323
         }
1324 1324
 
1325 1325
         //Set corresponding format
1326
-        $dateformat = get_string('strftimerecentfull', 'langconfig').' %Z';
1326
+        $dateformat = get_string('strftimerecentfull', 'langconfig') . ' %Z';
1327 1327
         $formattedStartDate = userdate($startTime / 1000, $dateformat, usertimezone($USER->timezone));
1328 1328
 
1329 1329
         $row = new stdClass();
@@ -1349,12 +1349,12 @@  discard block
 block discarded – undo
1349 1349
 
1350 1350
     $actionbar = '';
1351 1351
 
1352
-    $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("'.$manage_action.'", "'.$recording['recordID'].'", "'.$recording['meetingID'].'");';
1352
+    $onclick = 'M.mod_bigbluebuttonbn.broker_manageRecording("' . $manage_action . '", "' . $recording['recordID'] . '", "' . $recording['meetingID'] . '");';
1353 1353
     if (bigbluebuttonbn_get_cfg_recording_icons_enabled()) {
1354 1354
         //With icon for $action
1355
-        $icon_attributes = array('id' => 'recording-btn-'.$action.'-'.$recording['recordID']);
1356
-        $icon = new pix_icon('i/'.$manage_tag, get_string($manage_tag), 'moodle', $icon_attributes);
1357
-        $link_attributes = array('id' => 'recording-link-'.$manage_action.'-'.$recording['recordID'], 'onclick' => $onclick);
1355
+        $icon_attributes = array('id' => 'recording-btn-' . $action . '-' . $recording['recordID']);
1356
+        $icon = new pix_icon('i/' . $manage_tag, get_string($manage_tag), 'moodle', $icon_attributes);
1357
+        $link_attributes = array('id' => 'recording-link-' . $manage_action . '-' . $recording['recordID'], 'onclick' => $onclick);
1358 1358
         $actionbar .= $OUTPUT->action_icon('#', $icon, null, $link_attributes, false);
1359 1359
     } else {
1360 1360
         //With text for $action
@@ -1430,7 +1430,7 @@  discard block
 block discarded – undo
1430 1430
         $table->head = array($view_recording_playback, $view_recording_recording, $view_recording_description, $view_recording_preview, $view_recording_date, $view_recording_duration, $view_recording_actionbar);
1431 1431
         $table->align = array('left', 'left', 'left', 'left', 'left', 'center', 'left');
1432 1432
     } else {
1433
-        $table->head = array($view_recording_playback.$view_recording_recording, $view_recording_description, $view_recording_preview, $view_recording_date, $view_recording_duration);
1433
+        $table->head = array($view_recording_playback . $view_recording_recording, $view_recording_description, $view_recording_preview, $view_recording_date, $view_recording_duration);
1434 1434
         $table->align = array('left', 'left', 'left', 'left', 'left', 'center');
1435 1435
     }
1436 1436
 
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
     if (isset($recordings) && !array_key_exists('messageKey', $recordings)) {  // There are recordings for this meeting
1439 1439
         foreach ($recordings as $recording) {
1440 1440
             $row = new html_table_row();
1441
-            $row->id = 'recording-td-'.$recording['recordID'];
1441
+            $row->id = 'recording-td-' . $recording['recordID'];
1442 1442
             if (isset($recording['imported'])) {
1443 1443
                 $row->attributes['data-imported'] = 'true';
1444 1444
                 $row->attributes['title'] = get_string('view_recording_link_warning', 'bigbluebuttonbn');
@@ -1473,7 +1473,7 @@  discard block
 block discarded – undo
1473 1473
     /// Build the message_body
1474 1474
     $msg->activity_type = '';
1475 1475
     $msg->activity_title = $bigbluebuttonbn->name;
1476
-    $message_text = '<p>'.get_string('email_body_recording_ready_for', 'bigbluebuttonbn').' '.$msg->activity_type.' &quot;'.$msg->activity_title.'&quot; '.get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn').'.</p>';
1476
+    $message_text = '<p>' . get_string('email_body_recording_ready_for', 'bigbluebuttonbn') . ' ' . $msg->activity_type . ' &quot;' . $msg->activity_title . '&quot; ' . get_string('email_body_recording_ready_is_ready', 'bigbluebuttonbn') . '.</p>';
1477 1477
 
1478 1478
     bigbluebuttonbn_send_notification($sender, $bigbluebuttonbn, $message_text);
1479 1479
 }
@@ -1864,9 +1864,9 @@  discard block
 block discarded – undo
1864 1864
         $select = '';
1865 1865
         foreach ($bigbluebuttonbns as $key => $bigbluebuttonbn) {
1866 1866
             $select .= strlen($select) == 0 ? '(' : ' OR ';
1867
-            $select .= 'bigbluebuttonbnid='.$bigbluebuttonbn->id;
1867
+            $select .= 'bigbluebuttonbnid=' . $bigbluebuttonbn->id;
1868 1868
         }
1869
-        $select .= ") AND log='".BIGBLUEBUTTONBN_LOG_EVENT_CREATE."'";
1869
+        $select .= ") AND log='" . BIGBLUEBUTTONBN_LOG_EVENT_CREATE . "'";
1870 1870
 
1871 1871
         //Execute select for loading records based on existent bigbluebuttonbns
1872 1872
         $records = $DB->get_records_select($table, $select);
@@ -1874,7 +1874,7 @@  discard block
 block discarded – undo
1874 1874
         //Remove duplicates
1875 1875
         $unique_records = array();
1876 1876
         foreach ($records as $key => $record) {
1877
-            $record_key = $record->meetingid.','.$record->bigbluebuttonbnid.','.$record->meta;
1877
+            $record_key = $record->meetingid . ',' . $record->bigbluebuttonbnid . ',' . $record->meta;
1878 1878
             if (array_search($record_key, $unique_records) === false) {
1879 1879
                 array_push($unique_records, $record_key);
1880 1880
             } else {
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
 {
1916 1916
     global $CFG;
1917 1917
 
1918
-    return (bool) $CFG->debugdisplay;
1918
+    return (bool)$CFG->debugdisplay;
1919 1919
 }
1920 1920
 
1921 1921
 function bigbluebuttonbn_html2text($html, $len)
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
     $text = strip_tags($html);
1924 1924
     $text = str_replace('&nbsp;', ' ', $text);
1925 1925
     if (strlen($text) > $len) {
1926
-        $text = substr($text, 0, $len).'...';
1926
+        $text = substr($text, 0, $len) . '...';
1927 1927
     } else {
1928 1928
         $text = substr($text, 0, $len);
1929 1929
     }
@@ -1936,7 +1936,7 @@  discard block
 block discarded – undo
1936 1936
     $tags = '';
1937 1937
     $tags_array = core_tag_tag::get_item_tags_array('core', 'course_modules', $id);
1938 1938
     foreach ($tags_array as $key => $value) {
1939
-        $tags .= ($tags == '') ? $value : ','.$value;
1939
+        $tags .= ($tags == '') ? $value : ',' . $value;
1940 1940
     }
1941 1941
 
1942 1942
     return $tags;
@@ -1969,11 +1969,11 @@  discard block
 block discarded – undo
1969 1969
     // Consider logs from deleted bigbluebuttonbn instances whose meetingids should be included in the getRecordings request
1970 1970
     if ($include_deleted) {
1971 1971
         if ($bigbluebuttonbnID === null) {
1972
-            $select = "courseid = '{$courseID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1972
+            $select = "courseid = '{$courseID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1973 1973
         } elseif ($subset) {
1974
-            $select = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1974
+            $select = "bigbluebuttonbnid = '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1975 1975
         } else {
1976
-            $select = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '".BIGBLUEBUTTONBN_LOG_EVENT_DELETE."' AND meta like '%has_recordings%' AND meta like '%true%'";
1976
+            $select = "courseid = '{$courseID}' AND bigbluebuttonbnid <> '{$bigbluebuttonbnID}' AND log = '" . BIGBLUEBUTTONBN_LOG_EVENT_DELETE . "' AND meta like '%has_recordings%' AND meta like '%true%'";
1977 1977
         }
1978 1978
         $bigbluebuttonbns_deleted = $DB->get_records_select_menu('bigbluebuttonbn_logs', $select, null, 'bigbluebuttonbnid', 'bigbluebuttonbnid, meetingid');
1979 1979
         if (!empty($bigbluebuttonbns_deleted)) {
@@ -1986,7 +1986,7 @@  discard block
 block discarded – undo
1986 1986
     if (!empty($bigbluebuttonbns)) {
1987 1987
         //Prepare select for loading records based on existent bigbluebuttonbns
1988 1988
         $sql = 'SELECT DISTINCT meetingid, bigbluebuttonbnid FROM {bigbluebuttonbn_logs} WHERE ';
1989
-        $sql .= '(bigbluebuttonbnid='.implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)).')';
1989
+        $sql .= '(bigbluebuttonbnid=' . implode(' OR bigbluebuttonbnid=', array_keys($bigbluebuttonbns)) . ')';
1990 1990
         //Include only Create events and exclude those with record not true
1991 1991
         $sql .= ' AND log = ? AND meta LIKE ? AND meta LIKE ?';
1992 1992
         //Execute select for loading records based on existent bigbluebuttonbns
@@ -2065,8 +2065,8 @@  discard block
 block discarded – undo
2065 2065
 {
2066 2066
     $activity_time = '';
2067 2067
     if ($time) {
2068
-        $activity_time = calendar_day_representation($time).' '.
2069
-          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn').' '.
2068
+        $activity_time = calendar_day_representation($time) . ' ' .
2069
+          get_string('mod_form_field_notification_msg_at', 'bigbluebuttonbn') . ' ' .
2070 2070
           calendar_time_representation($time);
2071 2071
     }
2072 2072
 
Please login to merge, or discard this patch.
vendor/firebase/php-jwt/src/JWT.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
      * Sign a string with a given key and algorithm.
175 175
      *
176 176
      * @param string            $msg    The message to sign
177
-     * @param string|resource   $key    The secret key
177
+     * @param string   $key    The secret key
178 178
      * @param string            $alg    The signing algorithm.
179 179
      *                                  Supported algorithms are 'HS256', 'HS384', 'HS512' and 'RS256'
180 180
      *
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         if ($keyId !== null) {
157 157
             $header['kid'] = $keyId;
158 158
         }
159
-        if ( isset($head) && is_array($head) ) {
159
+        if (isset($head) && is_array($head)) {
160 160
             $header = array_merge($head, $header);
161 161
         }
162 162
         $segments = array();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             throw new DomainException('Algorithm not supported');
189 189
         }
190 190
         list($function, $algorithm) = static::$supported_algs[$alg];
191
-        switch($function) {
191
+        switch ($function) {
192 192
             case 'hash_hmac':
193 193
                 return hash_hmac($algorithm, $msg, $key, true);
194 194
             case 'openssl':
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         }
223 223
 
224 224
         list($function, $algorithm) = static::$supported_algs[$alg];
225
-        switch($function) {
225
+        switch ($function) {
226 226
             case 'openssl':
227 227
                 $success = openssl_verify($msg, $signature, $key, $algorithm);
228 228
                 if (!$success) {
@@ -270,8 +270,8 @@  discard block
 block discarded – undo
270 270
              * manually detect large ints in the JSON string and quote them (thus converting
271 271
              *them to strings) before decoding, hence the preg_replace() call.
272 272
              */
273
-            $max_int_length = strlen((string) PHP_INT_MAX) - 1;
274
-            $json_without_bigints = preg_replace('/:\s*(-?\d{'.$max_int_length.',})/', ': "$1"', $input);
273
+            $max_int_length = strlen((string)PHP_INT_MAX) - 1;
274
+            $json_without_bigints = preg_replace('/:\s*(-?\d{' . $max_int_length . ',})/', ': "$1"', $input);
275 275
             $obj = json_decode($json_without_bigints);
276 276
         }
277 277
 
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@
 block discarded – undo
37 37
                             'moderatorpass', 'viewerpass', 'wait', 'record', 'tagging',
38 38
                             'welcome', 'voicebridge', 'openingtime', 'closingtime',
39 39
                             'timecreated', 'timemodified', 'presentation', 'participants',
40
-                            'userlimit', ));
40
+                            'userlimit',));
41 41
 
42 42
         $logs = new backup_nested_element('logs');
43 43
 
44 44
         $log = new backup_nested_element('log', array('id'), array(
45
-                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta', ));
45
+                'courseid', 'bigbluebuttonbnid', 'userid', 'timecreated', 'meetingid', 'log', 'meta',));
46 46
 
47 47
         // Build the tree
48 48
         $bigbluebuttonbn->add_child($logs);
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         global $DB;
45 45
 
46
-        $data = (object) $data;
46
+        $data = (object)$data;
47 47
         $data->course = $this->get_courseid();
48 48
 
49 49
         $data->timemodified = $this->apply_date_offset($data->timemodified);
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         global $DB;
60 60
 
61
-        $data = (object) $data;
61
+        $data = (object)$data;
62 62
         // Apply modifications
63 63
         $data->courseid = $this->get_mappingid('course', $data->courseid);
64 64
         $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn');
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
  */
21 21
 defined('MOODLE_INTERNAL') || die();
22 22
 
23
-require_once $CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'; // Because it exists (must)
23
+require_once $CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/restore_bigbluebuttonbn_stepslib.php'; // Because it exists (must)
24 24
 
25 25
 /**
26 26
  * bigbluebuttonbn restore task that provides all the settings and steps to perform one
Please login to merge, or discard this patch.
backup/moodle2/backup_bigbluebuttonbn_activity_task.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  */
21 21
 defined('MOODLE_INTERNAL') || die;
22 22
 
23
-require_once $CFG->dirroot.'/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'; // Because it exists (must)
23
+require_once $CFG->dirroot . '/mod/bigbluebuttonbn/backup/moodle2/backup_bigbluebuttonbn_stepslib.php'; // Because it exists (must)
24 24
 
25 25
 /**
26 26
  * bigbluebuttonbn backup task that provides all the settings and steps to perform one
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
     {
54 54
         global $CFG;
55 55
 
56
-        $base = preg_quote($CFG->wwwroot.'/mod/bigbluebuttonbn', '#');
56
+        $base = preg_quote($CFG->wwwroot . '/mod/bigbluebuttonbn', '#');
57 57
 
58 58
         // Link to the list of bigbluebuttonbns
59
-        $pattern = '#('.$base."\/index.php\?id\=)([0-9]+)#";
59
+        $pattern = '#(' . $base . "\/index.php\?id\=)([0-9]+)#";
60 60
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNINDEX*$2@$', $content);
61 61
 
62 62
         // Link to bigbluebuttonbn view by moduleid
63
-        $pattern = '#('.$base."\/view.php\?id\=)([0-9]+)#";
63
+        $pattern = '#(' . $base . "\/view.php\?id\=)([0-9]+)#";
64 64
         $content = preg_replace($pattern, '$@BIGBLUEBUTTONBNVIEWBYID*$2@$', $content);
65 65
 
66 66
         return $content;
Please login to merge, or discard this patch.
bbb_broker.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  * @copyright 2015 Blindside Networks Inc
22 22
  * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later
23 23
  */
24
-require_once dirname(dirname(dirname(__FILE__))).'/config.php';
25
-require_once dirname(__FILE__).'/locallib.php';
24
+require_once dirname(dirname(dirname(__FILE__))) . '/config.php';
25
+require_once dirname(__FILE__) . '/locallib.php';
26 26
 
27 27
 use \Firebase\JWT\JWT;
28 28
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                         if ($bbbsession['administrator'] || $bbbsession['moderator']) {
102 102
                             $end_button_text = get_string('view_conference_action_end', 'bigbluebuttonbn');
103 103
                             $can_end = true;
104
-                            $status_can_end = '"can_end": true, "end_button_text": "'.$end_button_text.'", ';
104
+                            $status_can_end = '"can_end": true, "end_button_text": "' . $end_button_text . '", ';
105 105
                         }
106 106
                     } else {
107 107
                         // If user is administrator, moderator or if is viewer and no waiting is required
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                         } else {
113 113
                             $initial_message = get_string('view_message_conference_not_started', 'bigbluebuttonbn');
114 114
                             if ($bbbsession['wait']) {
115
-                                $initial_message .= ' '.get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn');
115
+                                $initial_message .= ' ' . get_string('view_message_conference_wait_for_moderator', 'bigbluebuttonbn');
116 116
                             }
117 117
                             $can_join = false;
118 118
                         }
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
                         } else {
123 123
                             $can_tag = false;
124 124
                         }
125
-                        $status_can_end = '"can_tag": '.($can_tag ? 'true' : 'false').', ';
125
+                        $status_can_end = '"can_tag": ' . ($can_tag ? 'true' : 'false') . ', ';
126 126
                     }
127 127
 
128
-                    echo $params['callback'].'({ "running": '.($meeting_running ? 'true' : 'false').', "info": '.json_encode($meeting_info).', "status": {"can_join": '.($can_join ? 'true' : 'false').',"join_url": "'.$bbbsession['joinURL'].'","join_button_text": "'.$join_button_text.'", '.$status_can_end.$status_can_tag.'"message": "'.$initial_message.'"} });';
128
+                    echo $params['callback'] . '({ "running": ' . ($meeting_running ? 'true' : 'false') . ', "info": ' . json_encode($meeting_info) . ', "status": {"can_join": ' . ($can_join ? 'true' : 'false') . ',"join_url": "' . $bbbsession['joinURL'] . '","join_button_text": "' . $join_button_text . '", ' . $status_can_end . $status_can_tag . '"message": "' . $initial_message . '"} });';
129 129
                     break;
130 130
                 case 'meeting_end':
131 131
                     if ($bbbsession['administrator'] || $bbbsession['moderator']) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                         // Update the cache
139 139
                         bigbluebuttonbn_get_meeting_info($params['id'], $bbbsession['modPW'], true);
140 140
 
141
-                        echo $params['callback'].'({ "status": true });';
141
+                        echo $params['callback'] . '({ "status": true });';
142 142
                     } else {
143 143
                         error_log('ERROR: User not authorized to execute end command');
144 144
                         header('HTTP/1.0 401 Unauthorized. User not authorized to execute end command');
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
                     if ($bbbsession['managerecordings']) {
149 149
                         if (isset($params['id']) && $params['id'] != '') {
150 150
                             $recordings_imported_all = bigbluebuttonbn_get_recording_imported_instances($params['id']);
151
-                            echo $params['callback'].'({ "status": "true", "links": '.count($recordings_imported_all).'});';
151
+                            echo $params['callback'] . '({ "status": "true", "links": ' . count($recordings_imported_all) . '});';
152 152
                         } else {
153
-                            echo $params['callback'].'({"status": "false"});';
153
+                            echo $params['callback'] . '({"status": "false"});';
154 154
                         }
155 155
                     } else {
156 156
                         error_log('ERROR: User not authorized to execute end command');
@@ -165,17 +165,17 @@  discard block
 block discarded – undo
165 165
                             // Look up for an update on the imported recording
166 166
                             $recording = $recordings[$params['id']];
167 167
                             if (isset($recording) && !empty($recording) && !array_key_exists('messageKey', $recording)) {  // The recording was found
168
-                                echo $params['callback'].'({ "status": "true", "published": "'.$recording['published'].'"});';
168
+                                echo $params['callback'] . '({ "status": "true", "published": "' . $recording['published'] . '"});';
169 169
                             } else {
170
-                                echo $params['callback'].'({ "status": "false" });';
170
+                                echo $params['callback'] . '({ "status": "false" });';
171 171
                             }
172 172
                         // As the recordingid was not identified as imported recording link, look up for a real recording
173 173
                         } else {
174 174
                             $recording = bigbluebuttonbn_getRecordingsArray($params['idx'], $params['id']);
175 175
                             if (isset($recording) && !empty($recording) && array_key_exists($params['id'], $recording)) {  // The recording was found
176
-                                echo $params['callback'].'({ "status": "true", "published": "'.$recording[$params['id']]['published'].'"});';
176
+                                echo $params['callback'] . '({ "status": "true", "published": "' . $recording[$params['id']]['published'] . '"});';
177 177
                             } else {
178
-                                echo $params['callback'].'({"status": "false"});';
178
+                                echo $params['callback'] . '({"status": "false"});';
179 179
                             }
180 180
                         }
181 181
                     } else {
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
                     try {
288 288
                         $decodedParameters = JWT::decode($params['signed_parameters'], $shared_secret, array('HS256'));
289 289
                     } catch (Exception $e) {
290
-                        $error = 'Caught exception: '.$e->getMessage();
290
+                        $error = 'Caught exception: ' . $e->getMessage();
291 291
                         error_log($error);
292
-                        header('HTTP/1.0 400 Bad Request. '.$error);
292
+                        header('HTTP/1.0 400 Bad Request. ' . $error);
293 293
 
294 294
                         return;
295 295
                     }
@@ -305,16 +305,16 @@  discard block
 block discarded – undo
305 305
 
306 306
                             return;
307 307
                         } catch (Exception $e) {
308
-                            $error = 'Caught exception: '.$e->getMessage();
308
+                            $error = 'Caught exception: ' . $e->getMessage();
309 309
                             error_log($error);
310
-                            header('HTTP/1.0 503 Service Unavailable. '.$error);
310
+                            header('HTTP/1.0 503 Service Unavailable. ' . $error);
311 311
 
312 312
                             return;
313 313
                         }
314 314
                     } else {
315
-                        $error = 'Caught exception: '.$e->getMessage();
315
+                        $error = 'Caught exception: ' . $e->getMessage();
316 316
                         error_log($error);
317
-                        header('HTTP/1.0 410 Gone. '.$error);
317
+                        header('HTTP/1.0 410 Gone. ' . $error);
318 318
 
319 319
                         return;
320 320
                     }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                         if (isset($importrecordings[$params['id']])) {
327 327
                             $importrecordings[$params['id']]['imported'] = true;
328 328
                             $overrides['meetingid'] = $importrecordings[$params['id']]['meetingID'];
329
-                            $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
329
+                            $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
330 330
                             bigbluebuttonbn_logs($bbbsession, BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
331 331
                             // Moodle event logger: Create an event for recording imported
332 332
                             if (isset($bigbluebuttonbn)) {
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
                         } else {
340 340
                             $error = "Recording {$params['id']} could not be found. It can not be imported";
341 341
                             error_log($error);
342
-                            header('HTTP/1.0 404 Not found. '.$error);
342
+                            header('HTTP/1.0 404 Not found. ' . $error);
343 343
 
344 344
                             return;
345 345
                         }
@@ -350,9 +350,9 @@  discard block
 block discarded – undo
350 350
                     try {
351 351
                         $decodedParameters = JWT::decode($params['signed_parameters'], $shared_secret, array('HS256'));
352 352
                     } catch (Exception $e) {
353
-                        $error = 'Caught exception: '.$e->getMessage();
353
+                        $error = 'Caught exception: ' . $e->getMessage();
354 354
                         error_log($error);
355
-                        header('HTTP/1.0 400 Bad Request. '.$error);
355
+                        header('HTTP/1.0 400 Bad Request. ' . $error);
356 356
 
357 357
                         return;
358 358
                     }
@@ -390,15 +390,15 @@  discard block
 block discarded – undo
390 390
                     break;
391 391
             }
392 392
         } catch (Exception $e) {
393
-            error_log('BBB_BROKER ERROR: '.$e->getCode().', '.$e->getMessage());
394
-            header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
393
+            error_log('BBB_BROKER ERROR: ' . $e->getCode() . ', ' . $e->getMessage());
394
+            header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
395 395
 
396 396
             return;
397 397
         }
398 398
     }
399 399
 } else {
400 400
     error_log(json_encode($error));
401
-    header('HTTP/1.0 400 Bad Request. '.$error);
401
+    header('HTTP/1.0 400 Bad Request. ' . $error);
402 402
 
403 403
     return;
404 404
 }
Please login to merge, or discard this patch.