diff --git a/lang/en/tool_securityquestions.php b/lang/en/tool_securityquestions.php index 47b57f6..1575b23 100644 --- a/lang/en/tool_securityquestions.php +++ b/lang/en/tool_securityquestions.php @@ -106,8 +106,6 @@ $string['settingsinjectsetpw'] = 'Set password form.'; $string['settingslockoutnum'] = 'Answer attempts before lockout'; $string['settingslockoutnumdesc'] = 'The number of attempts at answering questions a user is allowed before being locked out of password resetting. Set this control to 0 to disable locking.'; -$string['settingsquestionfile'] = 'Question file to use'; -$string['settingsquestionfiledesc'] = 'Enter the filepath of a question file you would like to use to add questions.'; $string['settingsmandatoryquestions'] = 'Mandatory security questions'; $string['settingsmandatoryquestionsdesc'] = 'Enable this control to make security questions mandatory. If disabled, users will still be prompted to answer questions on login, but they will be able to navigate away. On next login they will again be prompted.'; diff --git a/locallib.php b/locallib.php index 1ea4405..0bb20a5 100644 --- a/locallib.php +++ b/locallib.php @@ -716,45 +716,6 @@ function tool_securityquestions_clear_user_responses($user) { set_user_preference('tool_securityquestions_logintime', time()); } -// Template File Functions. -/** - * Reads a question template file, and inserts all questions - * - * @param string $filepath the path to the question template file - */ -function tool_securityquestions_read_questions_file($filepath) { - - if (file_exists($filepath)) { - try { - $questions = fopen($filepath, 'r'); - } catch (Exception $e) { - return false; - } - } - - if (!empty($questions)) { - while (!feof($questions)) { - $question = trim(fgets($questions)); - tool_securityquestions_insert_question($question); - } - } - - return true; -} - -/** - * Forces use of a template file if the admin config specifies one - */ -function tool_securityquestions_use_template_file() { - global $CFG; - $file = get_config('tool_securityquestions', 'questionfile'); - if ($file !== '') { - // If a filepath is set, use that config file. - $path = $CFG->wwwroot.$file; - tool_securityquestions_read_questions_file($path); - } -} - /** * Generates the select array for use in setting resposes. */ diff --git a/set_questions.php b/set_questions.php index 6116d03..2e95c5a 100644 --- a/set_questions.php +++ b/set_questions.php @@ -30,9 +30,6 @@ admin_externalpage_setup('tool_securityquestions_setform'); -// If a template is in use, apply it. -tool_securityquestions_use_template_file(); - // Setup notification block. $notifyadd = false; $notifyaddcontent = ''; diff --git a/settings.php b/settings.php index affa87a..23ebe42 100644 --- a/settings.php +++ b/settings.php @@ -102,10 +102,5 @@ $settings->add(new admin_setting_configtext('tool_securityquestions/lockoutnum', get_string('settingslockoutnum', 'tool_securityquestions'), get_string('settingslockoutnumdesc', 'tool_securityquestions'), 3, PARAM_INT)); - - $settings->add(new admin_setting_configfile('tool_securityquestions/questionfile', - get_string('settingsquestionfile', 'tool_securityquestions'), - get_string('settingsquestionfile', 'tool_securityquestions'), - '/admin/tool/securityquestions/questions/example.txt')); } } diff --git a/version.php b/version.php index d446c68..8abc6c3 100644 --- a/version.php +++ b/version.php @@ -24,8 +24,8 @@ defined('MOODLE_INTERNAL') || die; -$plugin->version = 2020021300; -$plugin->release = 2020021300; // Match release exactly to version. +$plugin->version = 2020022600; +$plugin->release = 2020022600; // Match release exactly to version. $plugin->requires = 2016052300; $plugin->component = 'tool_securityquestions'; $plugin->maturity = MATURITY_STABLE;