Skip to content

Commit 252ef0c

Browse files
Merge pull request #82 from catalyst/issue71
Issue #71: Removed question file import
2 parents 5b8ea5c + f8c4818 commit 252ef0c

5 files changed

Lines changed: 2 additions & 51 deletions

File tree

lang/en/tool_securityquestions.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@
106106
$string['settingsinjectsetpw'] = 'Set password form.';
107107
$string['settingslockoutnum'] = 'Answer attempts before lockout';
108108
$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.';
109-
$string['settingsquestionfile'] = 'Question file to use';
110-
$string['settingsquestionfiledesc'] = 'Enter the filepath of a question file you would like to use to add questions.';
111109
$string['settingsmandatoryquestions'] = 'Mandatory security questions';
112110
$string['settingsmandatoryquestionsdesc'] = 'Enable this control to make security questions mandatory. If disabled, users will still be prompted to answer questions on login,
113111
but they will be able to navigate away. On next login they will again be prompted.';

locallib.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -716,45 +716,6 @@ function tool_securityquestions_clear_user_responses($user) {
716716
set_user_preference('tool_securityquestions_logintime', time());
717717
}
718718

719-
// Template File Functions.
720-
/**
721-
* Reads a question template file, and inserts all questions
722-
*
723-
* @param string $filepath the path to the question template file
724-
*/
725-
function tool_securityquestions_read_questions_file($filepath) {
726-
727-
if (file_exists($filepath)) {
728-
try {
729-
$questions = fopen($filepath, 'r');
730-
} catch (Exception $e) {
731-
return false;
732-
}
733-
}
734-
735-
if (!empty($questions)) {
736-
while (!feof($questions)) {
737-
$question = trim(fgets($questions));
738-
tool_securityquestions_insert_question($question);
739-
}
740-
}
741-
742-
return true;
743-
}
744-
745-
/**
746-
* Forces use of a template file if the admin config specifies one
747-
*/
748-
function tool_securityquestions_use_template_file() {
749-
global $CFG;
750-
$file = get_config('tool_securityquestions', 'questionfile');
751-
if ($file !== '') {
752-
// If a filepath is set, use that config file.
753-
$path = $CFG->wwwroot.$file;
754-
tool_securityquestions_read_questions_file($path);
755-
}
756-
}
757-
758719
/**
759720
* Generates the select array for use in setting resposes.
760721
*/

set_questions.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030

3131
admin_externalpage_setup('tool_securityquestions_setform');
3232

33-
// If a template is in use, apply it.
34-
tool_securityquestions_use_template_file();
35-
3633
// Setup notification block.
3734
$notifyadd = false;
3835
$notifyaddcontent = '';

settings.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,5 @@
102102
$settings->add(new admin_setting_configtext('tool_securityquestions/lockoutnum',
103103
get_string('settingslockoutnum', 'tool_securityquestions'),
104104
get_string('settingslockoutnumdesc', 'tool_securityquestions'), 3, PARAM_INT));
105-
106-
$settings->add(new admin_setting_configfile('tool_securityquestions/questionfile',
107-
get_string('settingsquestionfile', 'tool_securityquestions'),
108-
get_string('settingsquestionfile', 'tool_securityquestions'),
109-
'/admin/tool/securityquestions/questions/example.txt'));
110105
}
111106
}

version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
defined('MOODLE_INTERNAL') || die;
2626

27-
$plugin->version = 2020021300;
28-
$plugin->release = 2020021300; // Match release exactly to version.
27+
$plugin->version = 2020022600;
28+
$plugin->release = 2020022600; // Match release exactly to version.
2929
$plugin->requires = 2016052300;
3030
$plugin->component = 'tool_securityquestions';
3131
$plugin->maturity = MATURITY_STABLE;

0 commit comments

Comments
 (0)