| 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_auth/description', '',
  | 
          
          
            | - | 
               | 
            30 | 
                    new lang_string('settings:description', 'factor_auth')));
  | 
          
          
            | 26 | 
            defined('MOODLE_INTERNAL') || die();
  | 
            31 | 
                $settings->add(new admin_setting_heading('factor_auth/settings', new lang_string('settings', 'moodle'), ''));
  | 
          
          
            | 27 | 
             
  | 
            32 | 
             
  | 
          
          
            | 28 | 
            $enabled = new admin_setting_configcheckbox('factor_auth/enabled',
  | 
            33 | 
                $enabled = new admin_setting_configcheckbox('factor_auth/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'), 0);
  | 
          
          
            | 31 | 
            $enabled->set_updatedcallback(function () {
  | 
            36 | 
                $enabled->set_updatedcallback(function () {
  | 
          
          
            | 32 | 
                \tool_mfa\manager::do_factor_action('auth', get_config('factor_auth', 'enabled') ? 'enable' : 'disable');
  | 
            37 | 
                    \tool_mfa\manager::do_factor_action('auth', get_config('factor_auth', 'enabled') ? 'enable' : 'disable');
  | 
          
          
            | 33 | 
            });
  | 
            38 | 
                });
  | 
          
          
            | 34 | 
            $settings->add($enabled);
  | 
            39 | 
                $settings->add($enabled);
  | 
          
          
            | 35 | 
             
  | 
            40 | 
             
  | 
          
          
            | 36 | 
            $settings->add(new admin_setting_configtext('factor_auth/weight',
  | 
            41 | 
                $settings->add(new admin_setting_configtext('factor_auth/weight',
  | 
          
          
            | 37 | 
                new lang_string('settings:weight', 'tool_mfa'),
  | 
            - | 
               | 
          
          
            | 38 | 
                new lang_string('settings:weight_help', 'tool_mfa'), 100, PARAM_INT));
  | 
            - | 
               | 
          
          
            | 39 | 
             
  | 
            - | 
               | 
          
          
            | 40 | 
            $authtypes = get_enabled_auth_plugins(true);
  | 
            - | 
               | 
          
          
            | 41 | 
            $authselect = [];
  | 
            - | 
               | 
          
          
            | 42 | 
            foreach ($authtypes as $type) {
  | 
            - | 
               | 
          
          
            | 43 | 
                $auth = get_auth_plugin($type);
  | 
            - | 
               | 
          
          
            | Línea -... | 
            Línea 42... | 
          
          
            | - | 
               | 
            42 | 
                    new lang_string('settings:weight', 'tool_mfa'),
  | 
          
          
            | - | 
               | 
            43 | 
                    new lang_string('settings:weight_help', 'tool_mfa'), 100, PARAM_INT));
  | 
          
          
            | - | 
               | 
            44 | 
             
  | 
          
          
            | - | 
               | 
            45 | 
                $authtypes = get_enabled_auth_plugins(true);
  | 
          
          
            | - | 
               | 
            46 | 
                $authselect = [];
  | 
          
          
            | - | 
               | 
            47 | 
                foreach ($authtypes as $type) {
  | 
          
          
            | - | 
               | 
            48 | 
                    $auth = get_auth_plugin($type);
  | 
          
          
            | 44 | 
                $authselect[$type] = $auth->get_title();
  | 
            49 | 
                    $authselect[$type] = $auth->get_title();
  | 
          
          
            | 45 | 
            }
  | 
            50 | 
                }
  | 
          
          
            | 46 | 
             
  | 
            51 | 
             
  | 
          
          
            | - | 
               | 
            52 | 
                $settings->add(new admin_setting_configmulticheckbox('factor_auth/goodauth',
  |