diff --git a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java index bfaccac82cfb8d83366949eecd277724ab1cbb4f..14169ae18fbc1635e4e757cd37e6c9281acd57c0 100644 --- a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java +++ b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java @@ -185,6 +185,11 @@ public class HudsonPrivateSecurityRealm extends SecurityRealm { public Details newInstance(StaplerRequest req, JSONObject formData) throws FormException { String pwd = Util.fixEmpty(req.getParameter("user.password")); + String pwd2= Util.fixEmpty(req.getParameter("user.password2")); + + if(!Util.fixNull(pwd).equals(Util.fixNull(pwd2))) + throw new FormException("Please confirm the password by typing it twice","user.password2"); + String data = Protector.unprotect(pwd); if(data!=null) { String prefix = Stapler.getCurrentRequest().getSession().getId() + ':'; diff --git a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config.jelly b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config.jelly index 7f73562082a30cd7b51c343e488a95dc11274b96..fdf70e79199bee57d519e9721894a658f13937ff 100644 --- a/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config.jelly +++ b/core/src/main/resources/hudson/security/HudsonPrivateSecurityRealm/Details/config.jelly @@ -2,4 +2,7 @@ + + + \ No newline at end of file diff --git a/core/src/main/resources/hudson/security/Messages.properties b/core/src/main/resources/hudson/security/Messages.properties index 92f034eced96331c2b75ab7220b41e85f0fdf06a..6453eb595917b14650ff2f5a17cd0f4024f743a8 100644 --- a/core/src/main/resources/hudson/security/Messages.properties +++ b/core/src/main/resources/hudson/security/Messages.properties @@ -3,6 +3,9 @@ GlobalMatrixAuthorizationStrategy.DisplayName=Matrix-based security LegacyAuthorizationStrategy.DisplayName=Legacy mode HudsonPrivateSecurityRealm.Details.DisplayName=Password +HudsonPrivateSecurityRealm.Details.PasswordError=\ + The confirmed password is not the same as the one entered. \ + Please make sure to type the same password twice. UserDetailsServiceProxy.UnableToQuery=Unable to query user information: {0} diff --git a/core/src/main/resources/hudson/security/Messages_ja.properties b/core/src/main/resources/hudson/security/Messages_ja.properties index 70d717e498bcad9df1515513eaed143e51c340e1..156c1d2c0f06560a9c02ca7df04b7321d98b1ca6 100644 --- a/core/src/main/resources/hudson/security/Messages_ja.properties +++ b/core/src/main/resources/hudson/security/Messages_ja.properties @@ -3,3 +3,4 @@ GlobalMatrixAuthorizationStrategy.DisplayName=\u884c\u5217\u306b\u3088\u308b\u6a LegacyAuthorizationStrategy.DisplayName=\u4e92\u63db\u6027\u30e2\u30fc\u30c9 HudsonPrivateSecurityRealm.Details.DisplayName=\u30d1\u30b9\u30ef\u30fc\u30c9 +HudsonPrivateSecurityRealm.Details.PasswordError=\u5165\u529b\u3055\u308c\u305f\uff12\u3064\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u3082\u3046\u4e00\u5ea6\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002