提交 e0779a67 编写于 作者: K kohsuke

Added password confirmation field


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6943 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c9701162
......@@ -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() + ':';
......
......@@ -2,4 +2,7 @@
<f:entry title="${%Password}:">
<input name="user.password" type="password" value="${instance.protectedPassword}" />
</f:entry>
<f:entry title="${%Confirm Password}:">
<input name="user.password2" type="password" value="${instance.protectedPassword}" />
</f:entry>
</j:jelly>
\ No newline at end of file
......@@ -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}
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册