| Línea 23... | Línea 23... | 
          
            | 23 |  * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 | 23 |  * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 | 
          
            | 24 |  */
 | 24 |  */
 | 
          
            | Línea 25... | Línea 25... | 
          
            | 25 |  
 | 25 |  
 | 
          
            | Línea -... | Línea 26... | 
          
            | - |   | 26 | defined('MOODLE_INTERNAL') || die();
 | 
          
            | - |   | 27 |  
 | 
          
            | - |   | 28 | if ($ADMIN->fulltree) {
 | 
          
            | - |   | 29 |     $settings->add(new admin_setting_heading('factor_email/description', '',
 | 
          
            | - |   | 30 |         new lang_string('settings:description', 'factor_email')));
 | 
          
            | 26 | defined('MOODLE_INTERNAL') || die();
 | 31 |     $settings->add(new admin_setting_heading('factor_email/settings', new lang_string('settings', 'moodle'), ''));
 | 
          
            | 27 |  
 | 32 |  
 | 
          
            | 28 | $enabled = new admin_setting_configcheckbox('factor_email/enabled',
 | 33 |     $enabled = new admin_setting_configcheckbox('factor_email/enabled',
 | 
          
            | 29 |     new lang_string('settings:enablefactor', 'tool_mfa'),
 | 34 |         new lang_string('settings:enablefactor', 'tool_mfa'),
 | 
          
            | 30 |     new lang_string('settings:enablefactor_help', 'tool_mfa'), 0);
 | 35 |         new lang_string('settings:enablefactor_help', 'tool_mfa'), 1);
 | 
          
            | 31 | $enabled->set_updatedcallback(function () {
 | 36 |     $enabled->set_updatedcallback(function () {
 | 
          
            | 32 |     \tool_mfa\manager::do_factor_action('email', get_config('factor_email', 'enabled') ? 'enable' : 'disable');
 | 37 |         \tool_mfa\manager::do_factor_action('email', get_config('factor_email', 'enabled') ? 'enable' : 'disable');
 | 
          
            | 33 | });
 | 38 |     });
 | 
          
            | 34 | $settings->add($enabled);
 | 39 |     $settings->add($enabled);
 | 
          
            | 35 |  
 | 40 |  
 | 
          
            | 36 | $settings->add(new admin_setting_configtext('factor_email/weight',
 | 41 |     $settings->add(new admin_setting_configtext('factor_email/weight',
 | 
          
            | 37 |     new lang_string('settings:weight', 'tool_mfa'),
 | 42 |         new lang_string('settings:weight', 'tool_mfa'),
 | 
          
            | 38 |     new lang_string('settings:weight_help', 'tool_mfa'), 100, PARAM_INT));
 | 43 |         new lang_string('settings:weight_help', 'tool_mfa'), 100, PARAM_INT));
 | 
          
            | 39 |  
 | 44 |  
 | 
          
            | 40 | $settings->add(new admin_setting_configduration('factor_email/duration',
 | 45 |     $settings->add(new admin_setting_configduration('factor_email/duration',
 | 
          
            | 41 |     get_string('settings:duration', 'factor_email'),
 | 46 |         get_string('settings:duration', 'factor_email'),
 | 
          
            | 42 |     get_string('settings:duration_help', 'factor_email'), 30 * MINSECS, MINSECS));
 | 47 |         get_string('settings:duration_help', 'factor_email'), 30 * MINSECS, MINSECS));
 | 
          
            | 43 |  
 | 48 |  
 | 
          
            | 44 | $settings->add(new admin_setting_configcheckbox('factor_email/suspend',
 | 49 |     $settings->add(new admin_setting_configcheckbox('factor_email/suspend',
 | 
          
            | - |   | 50 |         get_string('settings:suspend', 'factor_email'),
 |