Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

(no description)

File Size: 338 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: factor  - X-Ref

Email factor class.

login_form_definition(\MoodleQuickForm $mform)   X-Ref
E-Mail Factor implementation.

param: \MoodleQuickForm $mform
return: \MoodleQuickForm $mform

login_form_definition_after_data(\MoodleQuickForm $mform)   X-Ref
E-Mail Factor implementation.

param: \MoodleQuickForm $mform Form to inject global elements into.
return: object $mform

email_verification_code(int $instanceid)   X-Ref
Sends and e-mail to user with given verification code.

param: int $instanceid
return: void

login_form_validation(array $data)   X-Ref
E-Mail Factor implementation.

param: array $data
return: array

get_all_user_factors(stdClass $user)   X-Ref
E-Mail Factor implementation.

param: stdClass $user the user to check against.
return: array

has_input()   X-Ref
E-Mail Factor implementation.

{@inheritDoc}

get_state()   X-Ref
E-Mail Factor implementation.

{@inheritDoc}

is_ready()   X-Ref
Checks whether user email is correctly configured.

return: bool

generate_and_email_code()   X-Ref
Generates and emails the code for login to the user, stores codes in DB.

return: void

check_verification_code(string $enteredcode)   X-Ref
Verifies entered code against stored DB record.

param: string $enteredcode
return: bool

post_pass_state()   X-Ref
Cleans up email records once MFA passed.

{@inheritDoc}

get_no_redirect_urls()   X-Ref
Email factor implementation.
Email page must be safe to authorise session from link.

{@inheritDoc}

possible_states(stdClass $user)   X-Ref
Email factor implementation.

param: stdClass $user

obfuscate_email(string $email)   X-Ref
Obscure an email address by replacing all but the first and last character of the local part with a dot.
So the users full email isn't displayed during login.

param: string $email The email address to obfuscate.
return: string

get_login_desc()   X-Ref
Get the login description associated with this factor.
Override for factors that have a user input.

return: string The login option.