Skip to content

Commit

Permalink
Remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
joel1124 committed Jul 4, 2024
1 parent c2e0f4d commit c086515
Showing 1 changed file with 10 additions and 27 deletions.
37 changes: 10 additions & 27 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ public function definition() {


$context = context_course::instance($this->_course->id);
/**
* Joel Dapiawen
* February 12, 2024
* Update July 4, 2024
* Try to format the email address of the user to the expected format and add it to the dropdown menu
* Select the host who owns the meeting when editing the Zoom meeting.
*/
if (has_capability('mod/zoom:assign', $context)) {
$teacherarray = zoom_get_course_instructors($this->_course->id);

Expand All @@ -210,7 +217,7 @@ public function definition() {
// Construct expected email format
$expected_email = $first_name . '.' . $last_name . '@uregina.ca';

// do not send alert message if the email is acceptable like sample[email protected] or [email protected]
// Do not send alert message if the email address is acceptable like nickname[email protected] or [email protected]
if ($teacher_email_lower !== $expected_email && !preg_match('/^[a-z]+\.[a-z]+.*|^[a-z]+\+.*@uregina\.ca$/m', $teacher_email_lower)) {
// Add alert message if email does not match the expected format
$message = "The email address ({$teacher_email_lower}) appears to be incorrectly formatted. It should be in the format: {$expected_email}. To avoid any future issues please contact IT support.";
Expand Down Expand Up @@ -1064,7 +1071,7 @@ public function data_postprocessing($data) {

// Get latest list of alternative hosts from the DB.
$result = $DB->get_field('zoom', 'alternative_hosts', ['meeting_id' => $data->meeting_id], IGNORE_MISSING);
print_r($result);

error_log(print_r($config->showalternativehosts));
error_log(print_r($result));
// Proceed only if there is a field of alternative hosts already.
Expand Down Expand Up @@ -1315,31 +1322,7 @@ public function validation($data, $files) {
}
}

/**
* Joel Dapiawen
* April 7, 2024
* Need to update this Validate assign field form if user account is or not found in zoom
*/
if (isset($data['assign'])) {
$useremail = $data['assign'];
error_log($useremail);
// if($useremail != $USER->email){
//$user = zoom_get_user_info($useremail);
// error_log(print_r($user, 1));
// error_log(print_r($teachersmenu, 1));
// if($user){
// we dont need to call class here anymore.
// call the function right away.
// $zoomuser = zoom_email_alias($user);

// if(!$zoomuser){
// $errors['assign'] = $useremail.get_string('err_account_invalid', 'mod_zoom');
// } else {
// $errors['assign'] = $useremail.get_string('err_account_invalid', 'mod_zoom');
// }
// }
// }
} //END of ADDED

return $errors;
}
}

0 comments on commit c086515

Please sign in to comment.