@@ -220,7 +220,7 @@ discard block |
||
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 |
||
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 |
||
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.' "'.$msg->activity_title.'" '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | global $DB; |
226 | 226 | |
227 | 227 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
228 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
229 | - 'userid' => $user->id, |
|
230 | - 'log' => 'Join', ), '*'); |
|
228 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
229 | + 'userid' => $user->id, |
|
230 | + 'log' => 'Join', ), '*'); |
|
231 | 231 | |
232 | 232 | if ($completed > 0) { |
233 | 233 | 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'); |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | { |
247 | 247 | global $DB; |
248 | 248 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
249 | - 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
250 | - 'userid' => $user->id, |
|
251 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
249 | + 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
|
250 | + 'userid' => $user->id, |
|
251 | + 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
252 | 252 | |
253 | 253 | return $completed > 0; |
254 | 254 | } |
@@ -315,11 +315,11 @@ discard block |
||
315 | 315 | $str = '<div class="bigbluebuttonbn overview">'."\n"; |
316 | 316 | $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
317 | 317 | $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
318 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
318 | + '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
319 | 319 | $str .= ' </div>'."\n"; |
320 | 320 | $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).'</div>'."\n"; |
321 | 321 | $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
322 | - .'</div>'."\n"; |
|
322 | + .'</div>'."\n"; |
|
323 | 323 | $str .= '</div>'."\n"; |
324 | 324 | |
325 | 325 | if (empty($htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'])) { |
@@ -26,23 +26,23 @@ discard block |
||
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 |
||
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 |
||
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 | |
173 | 173 | if (bigbluebuttonbn_isMeetingRunning($meetingID)) { |
@@ -227,10 +227,10 @@ discard block |
||
227 | 227 | $completed = $DB->count_records('bigbluebuttonbn_logs', array('courseid' => $course->id, |
228 | 228 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
229 | 229 | 'userid' => $user->id, |
230 | - 'log' => 'Join', ), '*'); |
|
230 | + 'log' => 'Join',), '*'); |
|
231 | 231 | |
232 | 232 | if ($completed > 0) { |
233 | - 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'); |
|
233 | + 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'); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | return ''; |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $completed = $DB->count_recorda('bigbluebuttonbn_logs', array('courseid' => $course->id, |
249 | 249 | 'bigbluebuttonbnid' => $bigbluebuttonbn->id, |
250 | 250 | 'userid' => $user->id, |
251 | - 'log' => 'Join', ), '*', IGNORE_MULTIPLE); |
|
251 | + 'log' => 'Join',), '*', IGNORE_MULTIPLE); |
|
252 | 252 | |
253 | 253 | return $completed > 0; |
254 | 254 | } |
@@ -312,15 +312,15 @@ discard block |
||
312 | 312 | if ($bigbluebuttonbn->visible) { |
313 | 313 | $classes = 'class="dimmed" '; |
314 | 314 | } |
315 | - $str = '<div class="bigbluebuttonbn overview">'."\n"; |
|
316 | - $str .= ' <div class="name">'.get_string('modulename', 'bigbluebuttonbn').': '."\n"; |
|
317 | - $str .= ' <a '.$classes.'href="'.$CFG->wwwroot.'/mod/bigbluebuttonbn/view.php?id='.$bigbluebuttonbn->coursemodule. |
|
318 | - '">'.$bigbluebuttonbn->name.'</a>'."\n"; |
|
319 | - $str .= ' </div>'."\n"; |
|
320 | - $str .= ' <div class="info">'.get_string($start, 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->openingtime).'</div>'."\n"; |
|
321 | - $str .= ' <div class="info">'.get_string('ends_at', 'bigbluebuttonbn').': '.userdate($bigbluebuttonbn->closingtime) |
|
322 | - .'</div>'."\n"; |
|
323 | - $str .= '</div>'."\n"; |
|
315 | + $str = '<div class="bigbluebuttonbn overview">' . "\n"; |
|
316 | + $str .= ' <div class="name">' . get_string('modulename', 'bigbluebuttonbn') . ': ' . "\n"; |
|
317 | + $str .= ' <a ' . $classes . 'href="' . $CFG->wwwroot . '/mod/bigbluebuttonbn/view.php?id=' . $bigbluebuttonbn->coursemodule . |
|
318 | + '">' . $bigbluebuttonbn->name . '</a>' . "\n"; |
|
319 | + $str .= ' </div>' . "\n"; |
|
320 | + $str .= ' <div class="info">' . get_string($start, 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->openingtime) . '</div>' . "\n"; |
|
321 | + $str .= ' <div class="info">' . get_string('ends_at', 'bigbluebuttonbn') . ': ' . userdate($bigbluebuttonbn->closingtime) |
|
322 | + .'</div>' . "\n"; |
|
323 | + $str .= '</div>' . "\n"; |
|
324 | 324 | |
325 | 325 | if (empty($htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'])) { |
326 | 326 | $htmlarray[$bigbluebuttonbn->course]['bigbluebuttonbn'] = ''; |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | // Now that an id was assigned, generate and set the meetingid property based on |
418 | 418 | // [Moodle Instance + Activity ID + BBB Secret] (but only for new activities) |
419 | 419 | if (isset($bigbluebuttonbn->add) && !empty($bigbluebuttonbn->add)) { |
420 | - $meetingid = sha1($CFG->wwwroot.$bigbluebuttonbn->id.bigbluebuttonbn_get_cfg_shared_secret()); |
|
420 | + $meetingid = sha1($CFG->wwwroot . $bigbluebuttonbn->id . bigbluebuttonbn_get_cfg_shared_secret()); |
|
421 | 421 | $DB->set_field('bigbluebuttonbn', 'meetingid', $meetingid, array('id' => $bigbluebuttonbn->id)); |
422 | 422 | |
423 | 423 | $action = get_string('mod_form_field_notification_msg_created', 'bigbluebuttonbn'); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | // Get the first (and only) file. |
492 | 492 | $file = reset($files); |
493 | 493 | // Set the presentation column in the bigbluebuttonbn table. |
494 | - $DB->set_field('bigbluebuttonbn', 'presentation', '/'.$file->get_filename(), array('id' => $bigbluebuttonbn_id)); |
|
494 | + $DB->set_field('bigbluebuttonbn', 'presentation', '/' . $file->get_filename(), array('id' => $bigbluebuttonbn_id)); |
|
495 | 495 | } else { |
496 | 496 | // Set the presentation column in the bigbluebuttonbn table. |
497 | 497 | $DB->set_field('bigbluebuttonbn', 'presentation', '', array('id' => $bigbluebuttonbn_id)); |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | return false; |
533 | 533 | } |
534 | 534 | |
535 | - $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/".$filename; |
|
535 | + $fullpath = "/$context->id/mod_bigbluebuttonbn/$filearea/0/" . $filename; |
|
536 | 536 | $fs = get_file_storage(); |
537 | 537 | if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) { |
538 | 538 | return false; |
@@ -642,19 +642,19 @@ discard block |
||
642 | 642 | |
643 | 643 | function bigbluebuttonbn_notification_msg_html($msg) |
644 | 644 | { |
645 | - $message_text = '<p>'.$msg->activity_type.' "'.$msg->activity_title.'" '.get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn').' '.$msg->action.'.</p>'."\n"; |
|
646 | - $message_text .= '<p><b>'.$msg->activity_title.'</b> '.get_string('email_body_notification_meeting_details', 'bigbluebuttonbn').':'."\n"; |
|
647 | - $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>'."\n"; |
|
648 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_title', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
649 | - $message_text .= $msg->activity_title.'</td></tr>'."\n"; |
|
650 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_description', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
651 | - $message_text .= $msg->activity_description.'</td></tr>'."\n"; |
|
652 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
653 | - $message_text .= $msg->activity_openingtime.'</td></tr>'."\n"; |
|
654 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
655 | - $message_text .= $msg->activity_closingtime.'</td></tr>'."\n"; |
|
656 | - $message_text .= '<tr><td style="font-weight:bold;color:#555;">'.$msg->action.' '.get_string('email_body_notification_meeting_by', 'bigbluebuttonbn').': </td><td>'."\n"; |
|
657 | - $message_text .= $msg->activity_owner.'</td></tr></tbody></table></p>'."\n"; |
|
645 | + $message_text = '<p>' . $msg->activity_type . ' "' . $msg->activity_title . '" ' . get_string('email_body_notification_meeting_has_been', 'bigbluebuttonbn') . ' ' . $msg->action . '.</p>' . "\n"; |
|
646 | + $message_text .= '<p><b>' . $msg->activity_title . '</b> ' . get_string('email_body_notification_meeting_details', 'bigbluebuttonbn') . ':' . "\n"; |
|
647 | + $message_text .= '<table border="0" style="margin: 5px 0 0 20px"><tbody>' . "\n"; |
|
648 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_title', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
649 | + $message_text .= $msg->activity_title . '</td></tr>' . "\n"; |
|
650 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_description', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
651 | + $message_text .= $msg->activity_description . '</td></tr>' . "\n"; |
|
652 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_start_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
653 | + $message_text .= $msg->activity_openingtime . '</td></tr>' . "\n"; |
|
654 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . get_string('email_body_notification_meeting_end_date', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
655 | + $message_text .= $msg->activity_closingtime . '</td></tr>' . "\n"; |
|
656 | + $message_text .= '<tr><td style="font-weight:bold;color:#555;">' . $msg->action . ' ' . get_string('email_body_notification_meeting_by', 'bigbluebuttonbn') . ': </td><td>' . "\n"; |
|
657 | + $message_text .= $msg->activity_owner . '</td></tr></tbody></table></p>' . "\n"; |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | function bigbluebuttonbn_notification_send($sender, $bigbluebuttonbn, $message = '') |
@@ -669,17 +669,17 @@ discard block |
||
669 | 669 | $msg->user_name = fullname($sender); |
670 | 670 | $msg->user_email = $sender->email; |
671 | 671 | $msg->course_name = "$course->fullname"; |
672 | - $message .= '<p><hr/><br/>'.get_string('email_footer_sent_by', 'bigbluebuttonbn').' '.$msg->user_name.'('.$msg->user_email.') '; |
|
673 | - $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn').' '.$msg->course_name.'.</p>'; |
|
672 | + $message .= '<p><hr/><br/>' . get_string('email_footer_sent_by', 'bigbluebuttonbn') . ' ' . $msg->user_name . '(' . $msg->user_email . ') '; |
|
673 | + $message .= get_string('email_footer_sent_from', 'bigbluebuttonbn') . ' ' . $msg->course_name . '.</p>'; |
|
674 | 674 | |
675 | 675 | $users = get_enrolled_users($context); |
676 | 676 | foreach ($users as $user) { |
677 | 677 | if ($user->id != $sender->id) { |
678 | 678 | $messageid = message_post_message($sender, $user, $message, FORMAT_HTML); |
679 | 679 | if (!empty($messageid)) { |
680 | - error_log('Msg to '.$msg->user_name.' was sent.'); |
|
680 | + error_log('Msg to ' . $msg->user_name . ' was sent.'); |
|
681 | 681 | } else { |
682 | - error_log('Msg to '.$msg->user_name.' was NOT sent.'); |
|
682 | + error_log('Msg to ' . $msg->user_name . ' was NOT sent.'); |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | { |
705 | 705 | global $BIGBLUEBUTTONBN_CFG, $CFG; |
706 | 706 | |
707 | - 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/'); |
|
707 | + 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/'); |
|
708 | 708 | } |
709 | 709 | |
710 | 710 | function bigbluebuttonbn_get_cfg_shared_secret() |
@@ -174,7 +174,7 @@ |
||
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 | * |
@@ -156,7 +156,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -37,12 +37,12 @@ |
||
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); |
@@ -43,7 +43,7 @@ discard block |
||
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 |
||
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'); |
@@ -20,7 +20,7 @@ |
||
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 |
@@ -20,7 +20,7 @@ discard block |
||
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 |
||
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; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function get_description() |
57 | 57 | { |
58 | 58 | $rid = isset($this->other['rid']) ? $this->other['rid'] : ''; |
59 | - $a = (object) array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
59 | + $a = (object)array('userid' => $this->userid, 'recordingid' => $rid, 'courseid' => $this->contextinstanceid); |
|
60 | 60 | |
61 | 61 | return "The user with id '$a->userid' has deleted a recording with id '$a->recordingid' from the course id '$a->courseid'."; |
62 | 62 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | protected function get_legacy_logdata() |
70 | 70 | { |
71 | 71 | return array($this->courseid, 'bigbluebuttonbn', 'recording deleted', |
72 | - 'view.php?pageid='.$this->objectid, 'Recording deleted', $this->contextinstanceid, ); |
|
72 | + 'view.php?pageid=' . $this->objectid, 'Recording deleted', $this->contextinstanceid,); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function get_description() |
57 | 57 | { |
58 | - $a = (object) array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
58 | + $a = (object)array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
59 | 59 | |
60 | 60 | return "A bigbluebutton meeting for the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id '$a->courseid' has been forcibly ended by the user with id '$a->userid'."; |
61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | protected function get_legacy_logdata() |
69 | 69 | { |
70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'meeting ended', |
71 | - 'view.php?pageid='.$this->objectid, 'BigBlueButtonBN meeting forcibly ended', $this->contextinstanceid, ); |
|
71 | + 'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN meeting forcibly ended', $this->contextinstanceid,); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function get_description() |
57 | 57 | { |
58 | - $a = (object) array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
58 | + $a = (object)array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
59 | 59 | |
60 | 60 | return "The user with id '$a->userid' created a bigbluebutton meeting for the bigbluebuttonbn activity with id '$a->bigbluebuttonbnid' for the course id '$a->courseid'."; |
61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | protected function get_legacy_logdata() |
69 | 69 | { |
70 | 70 | return array($this->courseid, 'bigbluebuttonbn', 'meeting created', |
71 | - 'view.php?pageid='.$this->objectid, 'BigBlueButtonBN meeting created', $this->contextinstanceid, ); |
|
71 | + 'view.php?pageid=' . $this->objectid, 'BigBlueButtonBN meeting created', $this->contextinstanceid,); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |