diff --git a/blocks/login/block_login.php b/blocks/login/block_login.php index 03868888fcb..516a5faaeb6 100644 --- a/blocks/login/block_login.php +++ b/blocks/login/block_login.php @@ -35,6 +35,12 @@ class block_login extends block_base { // TODO: now that we have multiauth it is hard to find out if there is a way to change password $forgot = $wwwroot . '/login/forgot_password.php'; + if (empty($CFG->xmlstrictheaders) and !empty($CFG->loginpasswordautocomplete)) { + $autocomplete = 'autocomplete="off"'; + } else { + $autocomplete = ''; + } + $username = get_moodle_cookie(); $this->content->footer = ''; @@ -42,18 +48,14 @@ class block_login extends block_base { if (!isloggedin() or isguestuser()) { // Show the block - $this->content->text .= "\n".'
'; + $this->content->text .= "\n".''; $this->content->text .= '
'; $this->content->text .= '
'; $this->content->text .= '
'; - if (!empty($CFG->loginpasswordautocomplete)) { - $this->content->text .= '
'; - } else { - $this->content->text .= ''; - } + $this->content->text .= ''; if (isset($CFG->rememberusername) and $CFG->rememberusername == 2) { $checked = $username ? 'checked="checked"' : ''; diff --git a/lang/en/admin.php b/lang/en/admin.php index f648a3dbdd8..807f5cca555 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -613,7 +613,7 @@ $string['logguests_help'] = 'This setting enables logging of actions by guest ac $string['loginhttps'] = 'Use HTTPS for logins'; $string['loginpageautofocus'] = 'Autofocus login page form'; $string['loginpageautofocus_help'] = 'Enabling this option improves usability of the login page, but automatically focusing fields may be considered an accessibility issue.'; -$string['loginpasswordautocomplete'] = 'Prevent password autocompletion on login form.'; +$string['loginpasswordautocomplete'] = 'Prevent password autocompletion on login form'; $string['loginpasswordautocomplete_help'] = 'Having this off will let users save their account password in their browser. Switching this setting on will result in your site no longer following XHTML strict validation rules.'; $string['loglifetime'] = 'Keep logs for'; $string['longtimewarning'] = 'Please note that this process can take a long time.'; diff --git a/login/index_form.html b/login/index_form.html index e45b8e1aa96..3455a544fe1 100644 --- a/login/index_form.html +++ b/login/index_form.html @@ -4,6 +4,12 @@ if ($show_instructions) { } else { $columns = 'onecolumn'; } + +if (empty($CFG->xmlstrictheaders) and !empty($CFG->loginpasswordautocomplete)) { + $autocomplete = 'autocomplete="off"'; +} else { + $autocomplete = ''; +} ?>
@@ -29,7 +35,7 @@ if ($show_instructions) { echo '
'; } ?> - + >
@@ -38,7 +44,7 @@ if ($show_instructions) {
- loginpasswordautocomplete)) {echo 'autocomplete="off"';} ?> /> + /> " />