Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   1  <?php
   2  // This file is part of Moodle - http://moodle.org/
   3  //
   4  // Moodle is free software: you can redistribute it and/or modify
   5  // it under the terms of the GNU General Public License as published by
   6  // the Free Software Foundation, either version 3 of the License, or
   7  // (at your option) any later version.
   8  //
   9  // Moodle is distributed in the hope that it will be useful,
  10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  // GNU General Public License for more details.
  13  //
  14  // You should have received a copy of the GNU General Public License
  15  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * Admin settings and defaults
  19   *
  20   * @package auth_manual
  21   * @copyright  2017 Stephen Bourget
  22   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  defined('MOODLE_INTERNAL') || die;
  26  
  27  if ($ADMIN->fulltree) {
  28  
  29      // Introductory explanation.
  30      $settings->add(new admin_setting_heading('auth_manual/pluginname',
  31              new lang_string('passwdexpire_settings', 'auth_manual'),
  32              new lang_string('auth_manualdescription', 'auth_manual')));
  33  
  34      $expirationoptions = array(
  35          new lang_string('no'),
  36          new lang_string('yes'),
  37      );
  38  
  39      $settings->add(new admin_setting_configselect('auth_manual/expiration',
  40          new lang_string('expiration', 'auth_manual'),
  41          new lang_string('expiration_desc', 'auth_manual'), 0, $expirationoptions));
  42  
  43      $expirationtimeoptions = array(
  44          '30' => new lang_string('numdays', '', 30),
  45          '60' => new lang_string('numdays', '', 60),
  46          '90' => new lang_string('numdays', '', 90),
  47          '120' => new lang_string('numdays', '', 120),
  48          '150' => new lang_string('numdays', '', 150),
  49          '180' => new lang_string('numdays', '', 180),
  50          '365' => new lang_string('numdays', '', 365),
  51      );
  52  
  53      $settings->add(new admin_setting_configselect('auth_manual/expirationtime',
  54          new lang_string('passwdexpiretime', 'auth_manual'),
  55          new lang_string('passwdexpiretime_desc', 'auth_manual'), 30, $expirationtimeoptions));
  56  
  57      $expirationwarningoptions = array(
  58          '0' => new lang_string('never'),
  59          '1' => new lang_string('numdays', '', 1),
  60          '2' => new lang_string('numdays', '', 2),
  61          '3' => new lang_string('numdays', '', 3),
  62          '4' => new lang_string('numdays', '', 4),
  63          '5' => new lang_string('numdays', '', 5),
  64          '6' => new lang_string('numdays', '', 6),
  65          '7' => new lang_string('numdays', '', 7),
  66          '10' => new lang_string('numdays', '', 10),
  67          '14' => new lang_string('numdays', '', 14),
  68      );
  69  
  70      $settings->add(new admin_setting_configselect('auth_manual/expiration_warning',
  71          new lang_string('expiration_warning', 'auth_manual'),
  72          new lang_string('expiration_warning_desc', 'auth_manual'), 0, $expirationwarningoptions));
  73  
  74      // Display locking / mapping of profile fields.
  75      $authplugin = get_auth_plugin('manual');
  76      display_auth_lock_options($settings, $authplugin->authtype,
  77          $authplugin->userfields, get_string('auth_fieldlocks_help', 'auth'), false, false);
  78  }