MDL-61232 core: Remove process_email.php and anything related to it

This commit is contained in:
meirzamoodle
2024-10-30 04:51:27 +07:00
parent ec7711b9a6
commit c299f69e9f
6 changed files with 49 additions and 113 deletions
+37
View File
@@ -785,3 +785,40 @@ function plagiarism_get_file_results(): void {
function plagiarism_update_status(): void {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
}
/**
* ?
*
* @param string $modargs
* @param string $body Currently unused
*
* @deprecated Since Moodle 5.0
* @todo Final deprecation on Moodle 6.0. See MDL-83366.
*/
#[\core\attribute\deprecated(
replacement: null,
since: '5.0',
mdl: 'MDL-83366',
reason: 'The function is no longer used with the removal of the unused and non-functioning admin/process_email.php.',
)]
function moodle_process_email($modargs, $body) {
\core\deprecation::emit_deprecation_if_present(__FUNCTION__);
global $DB;
// The first char should be an unencoded letter. We'll take this as an action.
switch ($modargs[0]) {
case 'B': { // Bounce.
list(, $userid) = unpack('V', base64_decode(substr($modargs, 1, 8)));
if ($user = $DB->get_record("user", array('id' => $userid), "id,email")) {
// Check the half md5 of their email.
$md5check = substr(md5($user->email), 0, 16);
if ($md5check == substr($modargs, -16)) {
set_bounce_count($user);
}
// Else maybe they've already changed it?
}
}
break;
// Maybe more later?
}
}