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

Wallace Reis wreis at bestpractical.com
Fri Mar 7 12:54:19 EST 2014


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

- Log -----------------------------------------------------------------
commit 281f39c2e315f568c8333dc406ab8d8b3e5f1ded
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..1a8a640 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1857,8 +1857,17 @@ It defaults to on.  Set this to 0 to disable it.
 
 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