[Rt-commit] rt branch, 4.2/login-password-auto-complete, created. rt-4.2.3-8-gbdcea73

Wallace Reis wreis at bestpractical.com
Thu Feb 27 17:22:24 EST 2014


The branch, 4.2/login-password-auto-complete has been created
        at  bdcea731951a4fd339e724e1df47c70d8bc29a39 (commit)

- Log -----------------------------------------------------------------
commit bdcea731951a4fd339e724e1df47c70d8bc29a39
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Tue Feb 25 17:54:00 2014 -0300

    I#29071: Allow auto-completion of passwords
    
    For 4.2, lets allow this through yet another config option (named
    AllowLoginPasswordAutoComplete) which defaults to false as backcompat.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index fe95a75..0e712cd 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1859,6 +1859,17 @@ Set($QuoteFolding, 1);
 
 =back
 
+=item C<$AllowLoginPasswordAutoComplete>
+
+Allow browsers to remember the user's password on login (in case the 
+browser can do so, and has the appropriate setting enabled). Defaults 
+to false.
+
+=cut
+
+Set($AllowLoginPasswordAutoComplete, 0);
+
+=back
 
 
 =head1 Application logic
diff --git a/share/html/Elements/Login b/share/html/Elements/Login
index affab28..b3d900c 100644
--- a/share/html/Elements/Login
+++ b/share/html/Elements/Login
@@ -73,7 +73,7 @@
 
 <div class="input-row">
     <span class="label"><&|/l&>Password</&>:</span>
-    <span class="input"><input type="password" name="pass" autocomplete="off" /></span>
+    <span class="input"><input type="password" name="pass" <% RT->Config->Get('AllowLoginPasswordAutoComplete') ? '' : 'autocomplete="off"' | n %> /></span>
 </div>
 
 <input type="hidden" name="next" value="<% $next %>" />
diff --git a/t/web/login.t b/t/web/login.t
index d0213c3..4b3620d 100644
--- a/t/web/login.t
+++ b/t/web/login.t
@@ -1,7 +1,9 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 34;
+use RT::Test;
+
+RT::Config->Set(AllowLoginPasswordAutoComplete => 1);
 
 my ( $baseurl, $m ) = RT::Test->started_ok;
 
@@ -17,6 +19,7 @@ diag "normal login";
     $m->get($baseurl);
     $m->title_is('Login');
     is( $m->uri, $baseurl, "right url" );
+    $m->content_lacks('autocomplete="off"');
 
     $m->submit_form(
         form_id => 'login',

-----------------------------------------------------------------------


More information about the rt-commit mailing list