Completed
Pull Request — master (#98)
by
unknown
01:54
created
bbb_view.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
24 24
  */
25 25
 
26
-require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
27
-require_once(dirname(__FILE__).'/locallib.php');
26
+require_once(dirname(dirname(dirname(__FILE__))) . '/config.php');
27
+require_once(dirname(__FILE__) . '/locallib.php');
28 28
 
29 29
 global $SESSION;
30 30
 
@@ -68,23 +68,23 @@  discard block
 block discarded – undo
68 68
     if (is_null($serverversion)) {
69 69
         if ($bbbsession['administrator']) {
70 70
             print_error('view_error_unable_join', 'bigbluebuttonbn',
71
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
71
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
72 72
             exit;
73 73
         }
74 74
         if ($bbbsession['moderator']) {
75 75
             print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
76
-                $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
76
+                $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
77 77
             exit;
78 78
         }
79 79
         print_error('view_error_unable_join_student', 'bigbluebuttonbn',
80
-            $CFG->wwwroot.'/course/view.php?id='.$bigbluebuttonbn->course);
80
+            $CFG->wwwroot . '/course/view.php?id=' . $bigbluebuttonbn->course);
81 81
         exit;
82 82
     }
83
-    $bbbsession['serverversion'] = (string) $serverversion;
83
+    $bbbsession['serverversion'] = (string)$serverversion;
84 84
 
85 85
     // Operation URLs.
86 86
     $bbbsession['bigbluebuttonbnURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
87
-    $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id='.$id .
87
+    $bbbsession['logoutURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_view.php?action=logout&id=' . $id .
88 88
         '&bn=' . $bbbsession['bigbluebuttonbn']->id;
89 89
     $bbbsession['recordingReadyURL'] = $CFG->wwwroot . '/mod/bigbluebuttonbn/bbb_broker.php?action=recording_' .
90 90
         'ready&bigbluebuttonbn=' . $bbbsession['bigbluebuttonbn']->id;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
         }
157 157
         // If user is not administrator nor moderator (user is steudent) and waiting is required.
158 158
         if (!$bbbsession['administrator'] && !$bbbsession['moderator'] && $bbbsession['wait']) {
159
-            header('Location: '.$bbbsession['logoutURL']);
159
+            header('Location: ' . $bbbsession['logoutURL']);
160 160
             break;
161 161
         }
162 162
         // As the meeting doesn't exist, try to create it.
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
             // The server is unreachable.
171 171
             if ($bbbsession['administrator']) {
172 172
                 print_error('view_error_unable_join', 'bigbluebuttonbn',
173
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
173
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
174 174
                 break;
175 175
             }
176 176
             if ($bbbsession['moderator']) {
177 177
                 print_error('view_error_unable_join_teacher', 'bigbluebuttonbn',
178
-                    $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
178
+                    $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
179 179
                 break;
180 180
             }
181 181
             print_error('view_error_unable_join_student', 'bigbluebuttonbn',
182
-                $CFG->wwwroot.'/admin/settings.php?section=modsettingbigbluebuttonbn');
182
+                $CFG->wwwroot . '/admin/settings.php?section=modsettingbigbluebuttonbn');
183 183
             break;
184 184
         }
185 185
         if ($response['returncode'] == 'FAILED') {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
         if ($timeline) {
206 206
             $origin = BIGBLUEBUTTON_ORIGIN_TIMELINE;
207 207
         }
208
-        $meta = '{"record":'.($bbbsession['record'] ? 'true' : 'false').', "origin":'.$origin.'}';
208
+        $meta = '{"record":' . ($bbbsession['record'] ? 'true' : 'false') . ', "origin":' . $origin . '}';
209 209
         bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_CREATE, $overrides, $meta);
210 210
 
211 211
         // Since the meeting is already running, we just join the session.
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
         bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['recording_play'], $bigbluebuttonbn,
218 218
             ['other' => $rid]);
219 219
         // Execute the redirect.
220
-        header('Location: '.urldecode($href));
220
+        header('Location: ' . urldecode($href));
221 221
         break;
222 222
     default:
223 223
         bigbluebutton_bbb_view_close_window();
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         $data['welcome'] .= '<br><br>';
303 303
         $data['welcome'] .= str_replace(
304 304
             '%duration%',
305
-            (string) $durationtime,
305
+            (string)$durationtime,
306 306
             get_string('bbbdurationwarning', 'bigbluebuttonbn')
307 307
           );
308 308
     }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
     $meetinginfo = bigbluebuttonbn_get_meeting_info($bbbsession['meetingid'], BIGBLUEBUTTONBN_UPDATE_CACHE);
393 393
     if ($bbbsession['userlimit'] > 0 && intval($meetinginfo['participantCount']) >= $bbbsession['userlimit']) {
394 394
         // No more users allowed to join.
395
-        header('Location: '.$bbbsession['logoutURL']);
395
+        header('Location: ' . $bbbsession['logoutURL']);
396 396
         return;
397 397
     }
398 398
     // Build the URL.
@@ -406,13 +406,13 @@  discard block
 block discarded – undo
406 406
     bigbluebuttonbn_event_log(\mod_bigbluebuttonbn\event\events::$events['meeting_join'], $bigbluebuttonbn);
407 407
     // Internal logger: Instert a record with the meeting created.
408 408
     $overrides = array('meetingid' => $bbbsession['meetingid']);
409
-    $meta = '{"origin":'.$origin.'}';
409
+    $meta = '{"origin":' . $origin . '}';
410 410
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_JOIN, $overrides, $meta);
411 411
     // Before executing the redirect, increment the number of participants.
412 412
     bigbluebuttonbn_participant_joined($bbbsession['meetingid'],
413 413
         ($bbbsession['administrator'] || $bbbsession['moderator']));
414 414
     // Execute the redirect.
415
-    header('Location: '.$joinurl);
415
+    header('Location: ' . $joinurl);
416 416
 }
417 417
 
418 418
 /**
@@ -424,13 +424,13 @@  discard block
 block discarded – undo
424 424
  */
425 425
 function bigbluebutton_bbb_view_errors($serrors, $id) {
426 426
     global $CFG, $OUTPUT;
427
-    $errors = (array) json_decode(urldecode($serrors));
427
+    $errors = (array)json_decode(urldecode($serrors));
428 428
     $msgerrors = '';
429 429
     foreach ($errors as $error) {
430
-        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger'))."\n";
430
+        $msgerrors .= html_writer::tag('p', $error->{'message'}, array('class' => 'alert alert-danger')) . "\n";
431 431
     }
432 432
     echo $OUTPUT->header();
433 433
     print_error('view_error_bigbluebutton', 'bigbluebuttonbn',
434
-        $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$id, $msgerrors, $serrors);
434
+        $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $id, $msgerrors, $serrors);
435 435
     echo $OUTPUT->footer();
436 436
 }
Please login to merge, or discard this patch.