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: 307 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: factor  - X-Ref

Grace period factor class.

get_all_user_factors(stdClass $user)   X-Ref
Grace Factor implementation.
This factor is a singleton, return single instance.

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

get_active_user_factors(stdClass $user)   X-Ref
Grace Factor implementation.
Singleton instance, no additional filtering needed.

param: stdClass $user object to check against.
return: array the array of active factors.

has_input()   X-Ref
Grace Factor implementation.
Factor has no input.

{@inheritDoc}

get_state($redirectable = true)   X-Ref
Grace Factor implementation.
Checks the user login time against their first login after MFA activation.

param: bool $redirectable should this state call be allowed to redirect the user?
return: string state constant

set_state(string $state)   X-Ref
Grace Factor implementation.
State cannot be set. Return true.

param: string $state the state constant to set
return: bool

post_pass_state()   X-Ref
Grace Factor implementation.
Add a notification on the next page.

{@inheritDoc}

check_combination(array $combination)   X-Ref
Grace Factor implementation.
Gracemode should not be a valid combination with another factor.

param: array $combination array of factors that make up the combination
return: bool

possible_states(stdClass $user)   X-Ref
Grace Factor implementation.
Gracemode can change outcome just by waiting, or based on other factors.

param: stdClass $user
return: array

get_no_redirect_urls()   X-Ref
Grace factor implementation.

If grace period should redirect at end, make this a no-redirect url.

return: array

get_all_affecting_factors()   X-Ref
Returns a list of factor objects that can affect gracemode giving points.

Only factors that a user can setup or manually use can affect whether gracemode gives points.
The intest is to provide a grace period for users to go in, setup factors, phone numbers, etc.,
so that they are able to authenticate correctly once the grace period ends.

return: array

get_affecting_factors()   X-Ref
Get the factor list that is currently affecting gracemode. Active and not ignored.

return: array