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

Defines 1 class


Class: factor  - X-Ref

Subplugin info class.

get_factors()   X-Ref
Finds all MFA factors.

return: array of factor objects.

sort_factors_by_order(array $unsorted)   X-Ref
Sorts factors by configured order.

param: array $unsorted of factor objects
return: array of factor objects

get_factor(string $name)   X-Ref
Finds factor by its name.

param: string $name
return: mixed factor object or false if factor not found.

get_enabled_factors()   X-Ref
Finds all enabled factors.

return: array of factor objects

get_active_user_factor_types(mixed $user = null)   X-Ref
Finds active factors for a user.
If user is not specified, current user is used.

param: mixed $user user object or null.
return: array of factor objects.

get_next_user_login_factor()   X-Ref
Returns next factor to authenticate user.
Only returns factors that require user input.

return: mixed factor object the next factor to be authenticated or false.

get_all_user_login_factors()   X-Ref
Returns all factors that require user input.

return: array of factor objects.

get_factor_actions()   X-Ref
Returns the list of available actions with factor.

return: array

is_enabled()   X-Ref
Returns the information about plugin availability

True means that the plugin is enabled. False means that the plugin is
disabled. Null means that the information is not available, or the
plugin does not support configurable availability or the availability
can not be changed.

return: null|bool

get_settings_section_name()   X-Ref
Returns section name for settings.

return: string

load_settings(\part_of_admin_tree $adminroot, $parentnodename, $hassiteconfig)   X-Ref
Loads factor settings to the settings tree

This function usually includes settings.php file in plugins folder.
Alternatively it can create a link to some settings page (instance of admin_externalpage)

param: \part_of_admin_tree $adminroot
param: string $parentnodename
param: bool $hassiteconfig whether the current user has moodle/site:config capability

factor_exists(string $factorname)   X-Ref
Checks that given factor exists.

param: string $factorname
return: bool

get_instance_from_id(int $factorid)   X-Ref
Returns instance of any factor from the factorid.

param: int $factorid
return: stdClass|null Factor instance or nothing if not found.

get_manage_url()   X-Ref
Return URL used for management of plugins of this type.

return: moodle_url

is_uninstall_allowed()   X-Ref
These subplugins can be uninstalled.

return: bool

uninstall_cleanup()   X-Ref
Pre-uninstall hook.

This is intended for disabling of plugin, some DB table purging, etc.

NOTE: to be called from uninstall_plugin() only.

sort_factors_by_state(array $factors, string $state)   X-Ref
Sorts factors by state.

param: array $factors The factors to sort.
param: string $state The state to sort by.
return: array $factors The sorted factors.