Skip to content

Commit

Permalink
Code checker fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnOLane committed Jul 15, 2024
1 parent 78b5352 commit 9a2fcab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
1 change: 0 additions & 1 deletion lang/en/zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
$string['err_end_date_before_start'] = 'Recurrence end date cannot be before start date';
$string['err_invalid_password'] = 'Passcode contains invalid characters.';
$string['err_long_timeframe'] = 'Requested time frame too long, showing results of latest month in range.';
$string['err_long_timeframe'] = 'Requested time frame too long, showing results of latest month in range.';
$string['err_password'] = 'Passcode may only contain the following characters: [a-z A-Z 0-9 @ - _ *]. Max of 10 characters.';
$string['err_password_required'] = 'Passcode is required.';
$string['err_repeat_monthly_interval'] = 'Max interval for monthly meeting is 3 months';
Expand Down
29 changes: 13 additions & 16 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,8 @@ function zoom_get_sessions_for_display($zoomid) {
function zoom_get_next_occurrence($zoom) {
global $DB;

/**
* Prepare an ad-hoc request cache as this function could be called multiple times throughout a request.
* and we want to avoid to make duplicate DB calls.
*/
// Prepare an ad-hoc request cache as this function could be called multiple times throughout a request.
// We want to avoid to make duplicate DB calls.
$cacheoptions = [
'simplekeys' => true,
'simpledata' => true,
Expand Down Expand Up @@ -503,11 +501,11 @@ function zoom_get_participants_report($detailsid) {
function zoom_get_course_instructors($courseid) {
global $DB;

$role = $DB->get_record('role', array('shortname' => 'editingteacher'));
$role = $DB->get_record('role', ['shortname' => 'editingteacher']);
$context = context_course::instance($courseid);
$teachers = get_role_users($role->id, $context);

$teachersmenu = array();
$teachersmenu = [];
if ($teachers) {
foreach ($teachers as $teacher) {

Expand Down Expand Up @@ -545,15 +543,14 @@ function zoom_get_user_role($id){

global $DB;

$rolestr = array();
$rolestr = [];

$roleassignments = $DB->get_records_sql("
SELECT ra.roleid
FROM {role_assignments} ra
WHERE ra.userid = ".$id.";");

foreach($roleassignments as $role){

foreach ($roleassignments as $role) {
$rolename = $DB->get_record('role', ['id' => $role->roleid]);
$rolestr[] = $rolename->shortname;
}
Expand All @@ -567,9 +564,9 @@ function zoom_get_user_role($id){
* @param int $email of user
* @param user object
*/
function zoom_email_check($email){
function zoom_email_check($email) {

$split = explode('@',$email);
$split = explode('@', $email);

if (ZOOM_USER_DOMAIN == $split[1]) {
return true;
Expand All @@ -579,12 +576,12 @@ function zoom_email_check($email){
}
}

/**ADDED
/** ADDED
* Check if user has any alias emails connected to account
* @param int $email of user
* @param user object
*/
function zoom_email_alias($user,$service){
function zoom_email_alias($user, $service) {

global $DB;

Expand Down Expand Up @@ -1434,10 +1431,10 @@ function zoom_get_registrant_join_url($useremail, $meetingid, $iswebinar) {
* @param int $email of user
* @param user object
*/
function zoom_get_user_info($email){
function zoom_get_user_info($email) {
global $DB;

$user = $DB->get_record('user', array('email' => $email), '*', IGNORE_MISSING);
$user = $DB->get_record('user', ['email' => $email], '*', IGNORE_MISSING);
$emailchk = explode('@',$email);

if (!$user) {
Expand All @@ -1450,7 +1447,7 @@ function zoom_get_user_info($email){
$uainfo = $DB->get_record_sql($sql, [], IGNORE_MISSING);

if ($uainfo) {
$user = $DB->get_record('user', array('id' => $uainfo->userid), '*', IGNORE_MISSING);
$user = $DB->get_record('user', ['id' => $uainfo->userid], '*', IGNORE_MISSING);
}
}
}
Expand Down

0 comments on commit 9a2fcab

Please sign in to comment.