Completed
Pull Request — master (#289)
by
unknown
02:44
created
guestlink.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,26 +32,26 @@  discard block
 block discarded – undo
32 32
 $gid = required_param('gid', PARAM_ALPHANUM); // This is required.
33 33
 $guestname = optional_param('guestname', '', PARAM_TEXT);
34 34
 $guestpass = optional_param('guestpass', '', PARAM_TEXT);
35
-$PAGE->set_url(new moodle_url('/mod/bigbluebuttonbn/guestlink.php',['gid' => $gid, 'guestname' => $guestname, 'guestpass' => $guestpass]));
35
+$PAGE->set_url(new moodle_url('/mod/bigbluebuttonbn/guestlink.php', ['gid' => $gid, 'guestname' => $guestname, 'guestpass' => $guestpass]));
36 36
 $PAGE->set_context(context_system::instance());
37 37
 $PAGE->set_pagelayout('embedded');
38 38
 
39
-if(!\mod_bigbluebuttonbn\locallib\config::get('participant_guestlink')) {
39
+if (!\mod_bigbluebuttonbn\locallib\config::get('participant_guestlink')) {
40 40
     echo get_string('guestlink_form_guestlink_disabled', 'bigbluebuttonbn');
41 41
     die();
42 42
 }
43 43
 
44 44
 $bigbluebuttonbn = bigbluebuttonbn_get_bigbluebuttonbn_by_guestlinkid($gid);
45
-if(!$bigbluebuttonbn->guestlinkenabled) {
45
+if (!$bigbluebuttonbn->guestlinkenabled) {
46 46
     echo get_string('guestlink_form_guestlink_disabled_instance', 'bigbluebuttonbn');
47 47
     die();
48 48
 }
49 49
 $valid = ($guestname && ($bigbluebuttonbn->guestpass == $guestpass || !$bigbluebuttonbn->guestpass));
50 50
 
51
-if(!$valid) {
51
+if (!$valid) {
52 52
     $guestpasserrormessage = false;
53 53
     $guestnameerrormessage = false;
54
-    if($guestpass && $bigbluebuttonbn->guestpass != $guestpass){
54
+    if ($guestpass && $bigbluebuttonbn->guestpass != $guestpass) {
55 55
         $guestpasserrormessage = true;
56 56
     }
57 57
     $customlogo = \mod_bigbluebuttonbn\locallib\config::get('custom_logo');
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     echo $OUTPUT->render_from_template('mod_bigbluebuttonbn/guestaccess_view', $context);
70 70
     echo $OUTPUT->footer();
71 71
 } else {
72
-    list($course,$cm) = get_course_and_cm_from_instance($bigbluebuttonbn, 'bigbluebuttonbn');
72
+    list($course, $cm) = get_course_and_cm_from_instance($bigbluebuttonbn, 'bigbluebuttonbn');
73 73
     $context = context_module::instance($cm->id);
74 74
     $bbbsession = [];
75 75
     $bbbsession['course'] = $course;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     } else {
86 86
         $pinginterval = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_ping_interval') * 1000;
87 87
         echo $OUTPUT->header();
88
-        echo get_string('guestlink_form_join_waiting','bigbluebuttonbn');
88
+        echo get_string('guestlink_form_join_waiting', 'bigbluebuttonbn');
89 89
         echo "<script> setTimeout(function () {location.reload();}, $pinginterval);</script>";
90 90
         echo $OUTPUT->footer();
91 91
     }
Please login to merge, or discard this patch.
backup/moodle2/restore_bigbluebuttonbn_stepslib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once ($CFG->dirroot.'/mod/bigbluebuttonbn/locallib.php');
29
+require_once ($CFG->dirroot . '/mod/bigbluebuttonbn/locallib.php');
30 30
 
31 31
 /**
32 32
  * Define all the restore steps that will be used by the restore_url_activity_task.
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     protected function process_bigbluebuttonbn($data) {
60 60
         global $DB;
61
-        $data = (object) $data;
61
+        $data = (object)$data;
62 62
         $data->course = $this->get_courseid();
63 63
         $data->timemodified = $this->apply_date_offset($data->timemodified);
64 64
         $data->guestlinkid = bigbluebuttonbn_random_password(12);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      */
77 77
     protected function process_bigbluebuttonbn_logs($data) {
78 78
         global $DB;
79
-        $data = (object) $data;
79
+        $data = (object)$data;
80 80
         // Apply modifications.
81 81
         $data->courseid = $this->get_mappingid('course', $data->courseid);
82 82
         $data->bigbluebuttonbnid = $this->get_new_parentid('bigbluebuttonbn');
Please login to merge, or discard this patch.
db/upgrade.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 defined('MOODLE_INTERNAL') || die();
28 28
 
29
-require_once(dirname(dirname(__FILE__)).'/locallib.php');
29
+require_once(dirname(dirname(__FILE__)) . '/locallib.php');
30 30
 
31 31
 /**
32 32
  * Performs data migrations and updates on upgrade.
@@ -230,19 +230,19 @@  discard block
 block discarded – undo
230 230
         // Update db version tag.
231 231
         upgrade_mod_savepoint(true, 2019101001, 'bigbluebuttonbn');
232 232
     }
233
-    if($oldversion < 2020072001) {
233
+    if ($oldversion < 2020072001) {
234 234
         //Add field for guestlinkenabled
235 235
         $fielddefinition = array('type' => XMLDB_TYPE_INTEGER, 'precision' => '1', 'unsigned' => null,
236 236
             'notnull' => XMLDB_NOTNULL, 'sequence' => null, 'default' => 0, 'previous' => null);
237
-        xmldb_bigbluebuttonbn_add_change_field($dbman,'bigbluebuttonbn', 'guestlinkenabled', $fielddefinition);
237
+        xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'guestlinkenabled', $fielddefinition);
238 238
         //Add field for guestlinkid
239 239
         $fielddefinition = array('type' => XMLDB_TYPE_CHAR, 'precision' => '255', 'unsigned' => null,
240 240
             'notnull' => null, 'sequence' => null, 'default' => null, 'previous' => null);
241
-        xmldb_bigbluebuttonbn_add_change_field($dbman,'bigbluebuttonbn', 'guestlinkid', $fielddefinition);
241
+        xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'guestlinkid', $fielddefinition);
242 242
         //Add field for guestpass
243 243
         $fielddefinition = array('type' => XMLDB_TYPE_INTEGER, 'precision' => '10', 'unsigned' => null,
244 244
             'notnull' => null, 'sequence' => null, 'default' => null, 'previous' => null);
245
-        xmldb_bigbluebuttonbn_add_change_field($dbman,'bigbluebuttonbn', 'guestpass', $fielddefinition);
245
+        xmldb_bigbluebuttonbn_add_change_field($dbman, 'bigbluebuttonbn', 'guestpass', $fielddefinition);
246 246
         try {
247 247
             global $DB;
248 248
             $transaction = $DB->start_delegated_transaction();
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
             }
253 253
             $transaction->allow_commit();
254 254
             upgrade_mod_savepoint(true, 2020072001, 'bigbluebuttonbn');
255
-        } catch(Exception $e) {
255
+        } catch (Exception $e) {
256 256
             $transaction->rollback($e);
257 257
             throw($e);
258 258
         }
Please login to merge, or discard this patch.
viewlib.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         $groupname = groups_get_group_name($bbbsession['group']);
55 55
     }
56 56
     // Assign group default values.
57
-    $bbbsession['meetingid'] .= '['.$bbbsession['group'].']';
58
-    $bbbsession['meetingname'] .= ' ('.$groupname.')';
57
+    $bbbsession['meetingid'] .= '[' . $bbbsession['group'] . ']';
58
+    $bbbsession['meetingname'] .= ' (' . $groupname . ')';
59 59
     if (count($groups) == 0) {
60 60
         // Only the All participants group exists.
61 61
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_notenrolled_warning', 'bigbluebuttonbn'), 'info');
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     if (has_capability('moodle/site:accessallgroups', $context)) {
66 66
         bigbluebuttonbn_view_message_box($bbbsession, get_string('view_groups_selection_warning', 'bigbluebuttonbn'));
67 67
     }
68
-    $urltoroot = $CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bbbsession['cm']->id;
68
+    $urltoroot = $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bbbsession['cm']->id;
69 69
     groups_print_activity_menu($bbbsession['cm'], $urltoroot);
70 70
     echo '<br><br>';
71 71
 }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $recordingsdisabled = get_string('view_message_recordings_disabled', 'bigbluebuttonbn');
138 138
         $output .= bigbluebuttonbn_render_warning($recordingsdisabled, 'danger');
139 139
     }
140
-    echo $output.html_writer::empty_tag('br').html_writer::empty_tag('br').html_writer::empty_tag('br');
140
+    echo $output . html_writer::empty_tag('br') . html_writer::empty_tag('br') . html_writer::empty_tag('br');
141 141
     $PAGE->requires->yui_module('moodle-mod_bigbluebuttonbn-broker', 'M.mod_bigbluebuttonbn.broker.init', array($jsvars));
142 142
 }
143 143
 
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
     // JavaScript variables for room.
207 207
     $openingtime = '';
208 208
     if ($bbbsession['openingtime']) {
209
-        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn').': '.
209
+        $openingtime = get_string('mod_form_field_openingtime', 'bigbluebuttonbn') . ': ' .
210 210
             userdate($bbbsession['openingtime']);
211 211
     }
212 212
     $closingtime = '';
213 213
     if ($bbbsession['closingtime']) {
214
-        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn').': '.
214
+        $closingtime = get_string('mod_form_field_closingtime', 'bigbluebuttonbn') . ': ' .
215 215
             userdate($bbbsession['closingtime']);
216 216
     }
217 217
     $guestlink = [];
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     $output .= $OUTPUT->box_end();
254 254
     // Action button box.
255 255
     $output .= $OUTPUT->box_start('generalbox boxaligncenter', 'bigbluebuttonbn_view_action_button_box');
256
-    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>'."\n";
256
+    $output .= '<br><br><span id="join_button"></span>&nbsp;<span id="end_button"></span>' . "\n";
257 257
     $output .= $OUTPUT->box_end();
258 258
     if ($activity == 'ended') {
259 259
         $output .= bigbluebuttonbn_view_ended($bbbsession);
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
     // If there are meetings with recordings load the data to the table.
287 287
     if ($bbbsession['bigbluebuttonbn']->recordings_html) {
288 288
         // Render a plain html table.
289
-        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings)."\n";
289
+        return bigbluebuttonbn_output_recording_table($bbbsession, $recordings) . "\n";
290 290
     }
291 291
     // JavaScript variables for recordings with YUI.
292 292
     $jsvars += array(
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
         array('type' => 'button',
323 323
             'value' => get_string('view_recording_button_import', 'bigbluebuttonbn'),
324 324
             'class' => 'btn btn-secondary',
325
-            'onclick' => 'window.location=\''.$CFG->wwwroot.'/mod/bigbluebuttonbn/import_view.php?bn='.
326
-                $bbbsession['bigbluebuttonbn']->id.'\''));
325
+            'onclick' => 'window.location=\'' . $CFG->wwwroot . '/mod/bigbluebuttonbn/import_view.php?bn=' .
326
+                $bbbsession['bigbluebuttonbn']->id . '\''));
327 327
     $output  = html_writer::empty_tag('br');
328 328
     $output .= html_writer::tag('span', $button, array('id' => 'import_recording_links_button'));
329 329
     $output .= html_writer::tag('span', '', array('id' => 'import_recording_links_table'));
@@ -342,10 +342,10 @@  discard block
 block discarded – undo
342 342
     if (!is_null($bbbsession['presentation']['url'])) {
343 343
         $attributes = array('title' => $bbbsession['presentation']['name']);
344 344
         $icon = new pix_icon($bbbsession['presentation']['icon'], $bbbsession['presentation']['mimetype_description']);
345
-        return '<h4>'.get_string('view_section_title_presentation', 'bigbluebuttonbn').'</h4>'.
346
-            $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false).
345
+        return '<h4>' . get_string('view_section_title_presentation', 'bigbluebuttonbn') . '</h4>' .
346
+            $OUTPUT->action_icon($bbbsession['presentation']['url'], $icon, null, array(), false) .
347 347
             $OUTPUT->action_link($bbbsession['presentation']['url'],
348
-                $bbbsession['presentation']['name'], null, $attributes).'<br><br>';
348
+                $bbbsession['presentation']['name'], null, $attributes) . '<br><br>';
349 349
     }
350 350
     return '';
351 351
 }
Please login to merge, or discard this patch.
brokerlib.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function bigbluebuttonbn_broker_recording_info_current($recording, $params) {
209 209
     $callbackresponse['status'] = true;
210 210
     $callbackresponse['found'] = true;
211
-    $callbackresponse['published'] = (string) $recording['published'];
211
+    $callbackresponse['published'] = (string)$recording['published'];
212 212
     if (!isset($params['meta']) || empty($params['meta'])) {
213 213
         return $callbackresponse;
214 214
     }
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
             array('HS256')
560 560
         );
561 561
     } catch (Exception $e) {
562
-        $error = 'Caught exception: '.$e->getMessage();
563
-        header('HTTP/1.0 400 Bad Request. '.$error);
562
+        $error = 'Caught exception: ' . $e->getMessage();
563
+        header('HTTP/1.0 400 Bad Request. ' . $error);
564 564
         return;
565 565
     }
566 566
     // Validate that the bigbluebuttonbn activity corresponds to the meeting_id received.
@@ -590,8 +590,8 @@  discard block
 block discarded – undo
590 590
         bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTON_LOG_EVENT_CALLBACK, $overrides, json_encode($meta));
591 591
         header('HTTP/1.0 202 Accepted');
592 592
     } catch (Exception $e) {
593
-        $error = 'Caught exception: '.$e->getMessage();
594
-        header('HTTP/1.0 503 Service Unavailable. '.$error);
593
+        $error = 'Caught exception: ' . $e->getMessage();
594
+        header('HTTP/1.0 503 Service Unavailable. ' . $error);
595 595
     }
596 596
 }
597 597
 
@@ -612,13 +612,13 @@  discard block
 block discarded – undo
612 612
     $importrecordings = $SESSION->bigbluebuttonbn_importrecordings;
613 613
     if (!isset($importrecordings[$params['id']])) {
614 614
         $error = "Recording {$params['id']} could not be found. It can not be imported";
615
-        header('HTTP/1.0 404 Not found. '.$error);
615
+        header('HTTP/1.0 404 Not found. ' . $error);
616 616
         return;
617 617
     }
618 618
     $callbackresponse = array('status' => true);
619 619
     $importrecordings[$params['id']]['imported'] = true;
620 620
     $overrides = array('meetingid' => $importrecordings[$params['id']]['meetingID']);
621
-    $meta = '{"recording":'.json_encode($importrecordings[$params['id']]).'}';
621
+    $meta = '{"recording":' . json_encode($importrecordings[$params['id']]) . '}';
622 622
     bigbluebuttonbn_log($bbbsession['bigbluebuttonbn'], BIGBLUEBUTTONBN_LOG_EVENT_IMPORT, $overrides, $meta);
623 623
     // Moodle event logger: Create an event for recording imported.
624 624
     if (isset($bbbsession['bigbluebutton']) && isset($bbbsession['cm'])) {
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
     $action = strtolower($params['action']);
712 712
     $requiredparams = bigbluebuttonbn_broker_required_parameters();
713 713
     if (!array_key_exists($action, $requiredparams)) {
714
-        return 'Action '.$params['action'].' can not be performed.';
714
+        return 'Action ' . $params['action'] . ' can not be performed.';
715 715
     }
716 716
     return bigbluebuttonbn_broker_validate_parameters_message($params, $requiredparams[$action]);
717 717
 }
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
     $tabledata = array();
862 862
     $typeprofiles = bigbluebuttonbn_get_instance_type_profiles();
863 863
     $tabledata['activity'] = bigbluebuttonbn_view_get_activity_status($bbbsession);
864
-    $tabledata['ping_interval'] = (int) \mod_bigbluebuttonbn\locallib\config::get('waitformoderator_ping_interval') * 1000;
864
+    $tabledata['ping_interval'] = (int)\mod_bigbluebuttonbn\locallib\config::get('waitformoderator_ping_interval') * 1000;
865 865
     $tabledata['locale'] = bigbluebuttonbn_get_localcode();
866 866
     $tabledata['profile_features'] = $typeprofiles[0]['features'];
867 867
     $tabledata['recordings_html'] = $bbbsession['bigbluebuttonbn']->recordings_html == '1';
@@ -922,10 +922,10 @@  discard block
 block discarded – undo
922 922
         return;
923 923
     }
924 924
     $context = context_module::instance($cm->id);
925
-    if(!has_capability('mod/bigbluebuttonbn:guestlink_change_password', $context)) {
925
+    if (!has_capability('mod/bigbluebuttonbn:guestlink_change_password', $context)) {
926 926
         return;
927 927
     }
928
-    if($params['delete']) {
928
+    if ($params['delete']) {
929 929
         $password = null;
930 930
     } else {
931 931
         $password = rand(1, 999999);
Please login to merge, or discard this patch.
bbb_ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
  * @author    Jesus Federico  (jesus [at] blindsidenetworks [dt] com)
24 24
  */
25 25
 
26
-require(__DIR__.'/../../config.php');
27
-require_once(__DIR__.'/locallib.php');
28
-require_once(__DIR__.'/brokerlib.php');
26
+require(__DIR__ . '/../../config.php');
27
+require_once(__DIR__ . '/locallib.php');
28
+require_once(__DIR__ . '/brokerlib.php');
29 29
 
30 30
 global $PAGE, $USER, $CFG, $SESSION, $DB;
31 31
 
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
 require_sesskey();
44 44
 
45 45
 if (empty($params['action'])) {
46
-    header('HTTP/1.0 400 Bad Request. Parameter ['.$params['action'].'] was not included');
46
+    header('HTTP/1.0 400 Bad Request. Parameter [' . $params['action'] . '] was not included');
47 47
     return;
48 48
 }
49 49
 
50 50
 $error = bigbluebuttonbn_broker_validate_parameters($params);
51 51
 if (!empty($error)) {
52
-    header('HTTP/1.0 400 Bad Request. '.$error);
52
+    header('HTTP/1.0 400 Bad Request. ' . $error);
53 53
     return;
54 54
 }
55 55
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         echo $password;
140 140
         return;
141 141
     }
142
-    header('HTTP/1.0 400 Bad request. The action '. $a . ' doesn\'t exist');
142
+    header('HTTP/1.0 400 Bad request. The action ' . $a . ' doesn\'t exist');
143 143
 } catch (Exception $e) {
144
-    header('HTTP/1.0 500 Internal Server Error. '.$e->getMessage());
144
+    header('HTTP/1.0 500 Internal Server Error. ' . $e->getMessage());
145 145
 }
Please login to merge, or discard this patch.