From: skodak Date: Wed, 6 Sep 2006 10:11:24 +0000 (+0000) Subject: allow less verbose operation of forget_password.php SC#282 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6a5a62b09632c45af2f4fb5a2f61a668b7842241;p=moodle.git allow less verbose operation of forget_password.php SC#282 --- diff --git a/admin/settings/security.php b/admin/settings/security.php index e8d1fb3278..3b1deee51e 100644 --- a/admin/settings/security.php +++ b/admin/settings/security.php @@ -5,6 +5,7 @@ // "sitepolicies" settingpage $temp = new admin_settingpage('sitepolicies', get_string('sitepolicies', 'admin')); $temp->add(new admin_setting_configselect('showsiteparticipantslist', get_string('showsiteparticipantslist', 'admin'), get_string('configshowsiteparticipantslist', 'admin'), 0, array(0 => get_string('siteteachers'), 1 => get_string('allteachers'), 2 => get_string('studentsandteachers')))); +$temp->add(new admin_setting_configcheckbox('protectusernames', get_string('protectusernames', 'admin'), get_string('configprotectusernames', 'admin'), 1)); $temp->add(new admin_setting_configcheckbox('forcelogin', get_string('forcelogin', 'admin'), get_string('configforcelogin', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('forceloginforprofiles', get_string('forceloginforprofiles', 'admin'), get_string('configforceloginforprofiles', 'admin'), 0)); $temp->add(new admin_setting_configcheckbox('opentogoogle', get_string('opentogoogle', 'admin'), get_string('configopentogoogle', 'admin'), 0)); diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index 951146fc09..6e2896704d 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -141,6 +141,7 @@ $string['configopentogoogle'] = 'If you enable this setting, then Google will be $string['configpathtoclam'] = 'Path to clam AV. Probably something like /usr/bin/clamscan or /usr/bin/clamdscan. You need this in order for clam AV to run.'; $string['configpathtodu'] = 'Path to du. Probably something like /usr/bin/du. If you enter this, pages that display directory contents will run much faster for directories with a lot of files.'; $string['configperfdebug'] = 'If you turn this on, performance info will be printed in the footer of the standard theme'; +$string['configprotectusernames'] = 'By default forget_password.php does not display any hints that would allow guessing of usernames or passwords.'; $string['configproxyhost'] = 'If this server needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.'; $string['configquarantinedir'] = 'If you want clam AV to move infected files to a quarantine directory, enter it here. It must be writable by the webserver. If you leave this blank, or if you enter a directory that doesn\'t exit or isn\'t writable, infected files will be deleted. Do not include a trailing slash.'; $string['configrequestedteachername'] = 'Word for teacher used in requested courses'; @@ -317,4 +318,4 @@ $string['updateaccounts'] = 'Update existing accounts'; $string['updatetimezones'] = 'Update timezones'; $string['upwards'] = 'upwards'; -?> +?> \ No newline at end of file diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php index 908f1c3fe3..0726c720f0 100644 --- a/lang/en_utf8/moodle.php +++ b/lang/en_utf8/moodle.php @@ -410,6 +410,9 @@ line at the top of your web browser window. If you need help, please contact the site administrator, $a->admin'; $string['emailconfirmationsubject'] = '$a: account confirmation'; +$string['emailpasswordconfirmmaybesent'] = '

If you supplied correct username or address an email should have been sent to you.

+

It contains easy instructions to confirm and complete this password change. +If you continue to have difficulty, please contact the site administrator.

'; $string['emailconfirmsent'] = '

An email should have been sent to your address at $a

It contains easy instructions to complete your registration.

If you continue to have difficulty, contact the site administrator.

'; @@ -1449,4 +1452,4 @@ $string['yourself'] = 'yourself'; $string['yourteacher'] = 'your $a'; $string['zippingbackup'] = 'Zipping backup'; -?> +?> \ No newline at end of file diff --git a/login/forgot_password.php b/login/forgot_password.php index 384726b9a4..7b20442955 100644 --- a/login/forgot_password.php +++ b/login/forgot_password.php @@ -164,6 +164,12 @@ if ($param->action=='find' and confirm_sesskey()) { if (empty($param->username) and empty($param->email)) { $errors[] = 'no email or username'; } + + if ($page != 'external' and !empty($CFG->protectusernames)) { + // do not give any hints about usernames or email! + $errors = array(); + $page = 'emailmaybeconfirmed'; + } } // ACTION = AUTHENTICATE @@ -204,15 +210,10 @@ if (!empty($param->p) and !empty($param->s)) { print_header( $txt->forgotten, $txt->forgotten, "wwwroot}/login/index.php\">{$txt->login}->{$txt->forgotten}", 'form.email' ); -print_simple_box_start('center'); -// display any errors -if (count($errors)) { - echo "\n"; +if ($page=='emailmaybeconfirmed') { + // Print general confirmation message + notice(get_string('emailpasswordconfirmmaybesent'),$CFG->wwwroot.'/index.php'); } // check $page for appropriate page to display @@ -244,6 +245,18 @@ elseif ($page=='duplicateemail') { } else { + echo '
'; + print_simple_box_start('center','50%','','20'); + + // display any errors + if (count($errors)) { + echo "\n"; + } + ?>

forgotteninstructions; ?>