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

Wallace Reis wreis at bestpractical.com
Tue Feb 25 16:21:32 EST 2014


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

- Log -----------------------------------------------------------------
commit 252f357e50511793871a7f422bf6409053839166
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 which
    defaults to false as backcompat.
    
    For 4.4, #TODO: remove this totally allowing auto-completion based
    on user's browser settings.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index fe95a75..e45c61a 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1859,6 +1859,16 @@ Set($QuoteFolding, 1);
 
 =back
 
+=item C<$AllowLoginPasswordAutoComplete>
+
+Allow browsers to remember user password on login (in case the browser can do
+and has the appropriate setting enabled). The default value is false.
+
+=cut
+
+Set($AllowLoginPasswordAutoComplete, 0);
+
+=back
 
 
 =head1 Application logic
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 40dcec1..53fc713 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -954,6 +954,7 @@ our %META;
     WebExternalGecos          => { Deprecated => { Instead => 'WebRemoteUserGecos',            Remove => '4.4' }},
     WebExternalAuto           => { Deprecated => { Instead => 'WebRemoteUserAutocreate',       Remove => '4.4' }},
     AutoCreate                => { Deprecated => { Instead => 'UserAutocreateDefaultsOnLogin', Remove => '4.4' }},
+    AllowLoginPasswordAutoComplete => { Type => 'SCALAR' },
 );
 my %OPTIONS = ();
 my @LOADED_CONFIGS = ();
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