From: James Moger Date: Fri, 3 Feb 2012 22:21:10 +0000 (-0500) Subject: Disallow browser autocomplete on add/edit pages X-Git-Tag: v0.9.0~112 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d3ca1c295badd4a265342fd1ac29bcca1984bebd;p=gitblit.git Disallow browser autocomplete on add/edit pages --- diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd index 2d465bc3..effc94f8 100644 --- a/docs/04_releases.mkd +++ b/docs/04_releases.mkd @@ -14,6 +14,7 @@ #### fixes +- Disallow browser autocomplete on add/edit user/team/repository pages - Fixed username case-sensitivity issues (issue 43) - Disregard searching a subfolder if Gitblit does not have filesystem permissions (Github/lemval issue 51) diff --git a/src/com/gitblit/wicket/pages/EditRepositoryPage.java b/src/com/gitblit/wicket/pages/EditRepositoryPage.java index a259a995..0361da3e 100644 --- a/src/com/gitblit/wicket/pages/EditRepositoryPage.java +++ b/src/com/gitblit/wicket/pages/EditRepositoryPage.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Set; import org.apache.wicket.PageParameters; +import org.apache.wicket.behavior.SimpleAttributeModifier; import org.apache.wicket.extensions.markup.html.form.palette.Palette; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.CheckBox; @@ -261,6 +262,9 @@ public class EditRepositoryPage extends RootSubPage { } }; + // do not let the browser pre-populate these fields + form.add(new SimpleAttributeModifier("autocomplete", "off")); + // field names reflective match RepositoryModel fields form.add(new TextField("name").setEnabled(isCreate || isAdmin)); form.add(new TextField("description")); diff --git a/src/com/gitblit/wicket/pages/EditTeamPage.java b/src/com/gitblit/wicket/pages/EditTeamPage.java index 8a0540f1..0af3cb4e 100644 --- a/src/com/gitblit/wicket/pages/EditTeamPage.java +++ b/src/com/gitblit/wicket/pages/EditTeamPage.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.Set; import org.apache.wicket.PageParameters; +import org.apache.wicket.behavior.SimpleAttributeModifier; import org.apache.wicket.extensions.markup.html.form.palette.Palette; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.ChoiceRenderer; @@ -211,6 +212,9 @@ public class EditTeamPage extends RootSubPage { } }; + // do not let the browser pre-populate these fields + form.add(new SimpleAttributeModifier("autocomplete", "off")); + // field names reflective match TeamModel fields form.add(new TextField("name")); form.add(users); diff --git a/src/com/gitblit/wicket/pages/EditUserPage.java b/src/com/gitblit/wicket/pages/EditUserPage.java index 142a5424..62d955e2 100644 --- a/src/com/gitblit/wicket/pages/EditUserPage.java +++ b/src/com/gitblit/wicket/pages/EditUserPage.java @@ -22,6 +22,7 @@ import java.util.Iterator; import java.util.List; import org.apache.wicket.PageParameters; +import org.apache.wicket.behavior.SimpleAttributeModifier; import org.apache.wicket.extensions.markup.html.form.palette.Palette; import org.apache.wicket.markup.html.form.Button; import org.apache.wicket.markup.html.form.CheckBox; @@ -197,6 +198,9 @@ public class EditUserPage extends RootSubPage { } } }; + + // do not let the browser pre-populate these fields + form.add(new SimpleAttributeModifier("autocomplete", "off")); // field names reflective match UserModel fields form.add(new TextField("username"));