Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
tool_mfa

Namespaces

namespace  tool_mfa
  
 
namespace  tool_mfa\event
  
 
namespace  tool_mfa\hook
  
 
namespace  tool_mfa\local
  
 
namespace  tool_mfa\local\factor
  
 
namespace  tool_mfa\local\form
  
 
namespace  tool_mfa\local\hooks
  
 
namespace  tool_mfa\output
  
 
namespace  tool_mfa\plugininfo
  
 
namespace  tool_mfa\privacy
  
 

Classes

class  behat_tool_mfa_generator
 
class  tool_mfa\event\user_deleted_factor
 
class  tool_mfa\event\user_failed_mfa
 
class  tool_mfa\event\user_passed_mfa
 
class  tool_mfa\event\user_revoked_factor
 
class  tool_mfa\event\user_setup_factor
 
class  tool_mfa\hook\after_user_passed_mfa
 
class  tool_mfa\local\admin_setting_managemfa
 
class  tool_mfa\local\factor\fallback
 
interface  tool_mfa\local\factor\object_factor
 
class  tool_mfa\local\factor\object_factor_base
 
class  tool_mfa\local\form\factor_action_confirmation_form
 
class  tool_mfa\local\form\global_form_manager
 
class  tool_mfa\local\form\login_form
 
class  tool_mfa\local\form\reset_factor
 
class  tool_mfa\local\form\setup_factor_form
 
class  tool_mfa\local\form\verification_field
 
class  tool_mfa\local\hooks\extend_bulk_user_actions
 
class  tool_mfa\local\secret_manager
 
class  tool_mfa\manager
 
class  tool_mfa\output\renderer
 
class  tool_mfa\plugininfo\factor
 
class  tool_mfa\privacy\provider
 Privacy provider. More...
 
class  tool_mfa_generator
 

Functions

 tool_mfa_after_config ()
 Triggered as soon as practical on every moodle bootstrap after config has been loaded.
 
 tool_mfa_after_require_login ($courseorid=null, $autologinguest=null, $cm=null, $setwantsurltome=null, $preventredirect=null)
 Main hook.
 
 tool_mfa_extend_navigation_user_settings (navigation_node $navigation, stdClass $user, $usercontext, stdClass $course, $coursecontext)
 Extends navigation bar and injects MFA Preferences menu to user preferences.
 
 tool_mfa_output_fragment_factor_action_confirmation_form (array $args,)
 Fragment to confirm a factor action using the confirmation form.
 
 tool_mfa_pluginfile (stdClass $course, stdClass $cm, context $context, string $filearea, array $args, bool $forcedownload, array $options=[])
 Serves any files for the guidance page.
 

Variables

 $callbacks
 
 $capabilities
 
global $CFG
 
global tool_mfa::$CFG
 
 $plugin = 2024041600
 
 $renamedclasses
 
 $subplugins = (array) json_decode(file_get_contents($CFG->dirroot."/admin/tool/mfa/db/subplugins.json"))->plugintypes
 
$plugin component = 'tool_mfa'
 
$plugin maturity = MATURITY_STABLE
 
$plugin version = 2024042200
 

Detailed Description

Function Documentation

◆ tool_mfa_after_config()

tool_mfa_after_config ( )

Triggered as soon as practical on every moodle bootstrap after config has been loaded.

The $USER object is available at this point too.

Return values
void

◆ tool_mfa_after_require_login()

tool_mfa_after_require_login ( $courseorid = null,
$autologinguest = null,
$cm = null,
$setwantsurltome = null,
$preventredirect = null )

Main hook.

e.g. Add permissions logic across a site or course

Parameters
mixed$courseorid
mixed$autologinguest
mixed$cm
mixed$setwantsurltome
mixed$preventredirect
Return values
void
Exceptions
moodle_exception

◆ tool_mfa_extend_navigation_user_settings()

tool_mfa_extend_navigation_user_settings ( navigation_node $navigation,
stdClass $user,
$usercontext,
stdClass $course,
$coursecontext )

Extends navigation bar and injects MFA Preferences menu to user preferences.

Parameters
navigation_node$navigation
stdClass$user
context_user$usercontext
stdClass$course
context_course$coursecontext
Return values
mixvoid or null
Exceptions
moodle_exception

◆ tool_mfa_output_fragment_factor_action_confirmation_form()

tool_mfa_output_fragment_factor_action_confirmation_form ( array $args)

Fragment to confirm a factor action using the confirmation form.

Parameters
array$argsArguments to the form.
Return values
null|stringThe rendered form.

◆ tool_mfa_pluginfile()

tool_mfa_pluginfile ( stdClass $course,
stdClass $cm,
context $context,
string $filearea,
array $args,
bool $forcedownload,
array $options = [] )

Serves any files for the guidance page.

Parameters
stdClass$course
stdClass$cm
context$context
string$filearea
array$args
bool$forcedownload
array$options
Return values
bool

Variable Documentation

◆ $callbacks

$callbacks
Initial value:
= [
[
'hook' => core_user\hook\extend_bulk_user_actions::class,
'callback' => 'tool_mfa\local\hooks\extend_bulk_user_actions::callback',
'priority' => 0,
],
]

◆ $capabilities

$capabilities
Initial value:
= [
'tool/mfa:mfaaccess' => [
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => ['user' => CAP_ALLOW],
],
]
const CONTEXT_USER
User context level - one instance for each user describing what others can do to user.
Definition accesslib.php:124
const CAP_ALLOW
Allow permission, overrides CAP_PREVENT defined in parent contexts.
Definition accesslib.php:115

◆ $renamedclasses

$renamedclasses
Initial value:
= [
'tool_mfa\\local\\form\\revoke_factor_form' => 'tool_mfa\\local\\form\\factor_action_confirmation_form',
]