Permalink
Browse files

Merge branch 'wip-MDL-30336-MOODLE_19_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_19_STABLE
  • Loading branch information...
2 parents cc4d45b + 630fc6e commit f844dbcacee45866faf658ae9b6a289a0bdbe04b @nebgor nebgor committed Dec 8, 2011
Showing with 10 additions and 2 deletions.
  1. +1 −0 admin/settings/security.php
  2. +6 −1 blocks/login/block_login.php
  3. +2 −0 lang/en_utf8/admin.php
  4. +1 −1 login/index_form.html
View
1 admin/settings/security.php
@@ -67,6 +67,7 @@
$temp->add(new admin_setting_configcheckbox('cookiehttponly', get_string('cookiehttponly', 'admin'), get_string('configcookiehttponly', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('regenloginsession', get_string('regenloginsession', 'admin'), get_string('configregenloginsession', 'admin'), 1));
$temp->add(new admin_setting_configtext('excludeoldflashclients', get_string('excludeoldflashclients', 'admin'), get_string('configexcludeoldflashclients', 'admin'), '10.0.12', PARAM_TEXT));
+ $temp->add(new admin_setting_configcheckbox('loginpasswordautocomplete', get_string('loginpasswordautocomplete', 'admin'), get_string('loginpasswordautocomplete_help', 'admin'), 0));
$ADMIN->add('security', $temp);
View
7 blocks/login/block_login.php
@@ -49,7 +49,12 @@ function get_content () {
$this->content->text .= '<input type="text" name="username" id="login_username" value="'.s($username).'" /></div>';
$this->content->text .= '<div class="c1 fld password"><label for="login_password">'.get_string('password').'</label>';
- $this->content->text .= '<input type="password" name="password" id="login_password" value="" /></div>';
+
+ if (!empty($CFG->loginpasswordautocomplete)) {
+ $this->content->text .= '<input type="password" name="password" id="login_password" value="" autocomplete="off" /></div>';
+ } else {
+ $this->content->text .= '<input type="password" name="password" id="login_password" value="" /></div>';
+ }
$this->content->text .= '<div class="c1 btn"><input type="submit" value="'.get_string('login').'" /></div>';
View
2 lang/en_utf8/admin.php
@@ -493,6 +493,8 @@
$string['locationsettings'] = 'Location settings';
$string['log'] = 'Logs';
$string['loginhttps'] = 'Use HTTPS for logins';
+$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['longtimenosee'] = 'Unsubscribe users from courses after';
$string['longtimewarning'] = '<b>Please note that this process can take a long time.</b>';
View
2 login/index_form.html
@@ -35,7 +35,7 @@
<div class="clearer"><!-- --></div>
<div class="form-label"><label for="password"><?php print_string("password") ?></label></div>
<div class="form-input">
- <input type="password" name="password" id="password" size="15" value="" />
+ <input type="password" name="password" id="password" size="15" value="" <?php if (!empty($CFG->loginpasswordautocomplete)) {echo 'autocomplete="off"';} ?> />
<input type="submit" value="<?php print_string("login") ?>" />
<input type="hidden" name="testcookies" value="1" />
</div>

0 comments on commit f844dbc

Please sign in to comment.