99cd2512a9983690802adb52542fee1b0d3b31a6.svn-base
4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>修改密码</title>
<meta name="decorator" content="default"/>
<script type="text/javascript">
$(document).ready(function() {
$("#oldPassword").focus();
$("#inputForm").validate({
rules: {
newPassword: {abcNumber: true, capitalAbc: true}
},
messages: {
newPassword: {abcNumber: "密码必须包括英文字母和数字", capitalAbc: "必须包含有大写字母"},
confirmNewPassword: {equalTo: "输入与上面相同的密码"}
},
submitHandler: function(form){
loading('正在提交,请稍等...');
form.submit();
},
errorContainer: "#messageBox",
errorPlacement: function(error, element) {
$("#messageBox").text("输入有误,请先更正。");
if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
error.appendTo(element.parent().parent());
} else {
error.insertAfter(element);
}
}
});
});
/**
function checkPass(pass){
if(pass.length < 6){
return 0;
}
var ls = 0;
if(pass.match(/([a-z])+/)){
ls++;
}
if(pass.match(/([0-9])+/)){
ls++;
}
if(pass.match(/([A-Z])+/)){
ls++;
}
if(pass.match(/[^a-zA-Z0-9]+/)){
ls++;
}
return ls;
}
function Validate(){
var oldLogPWD = document.InfoForm.oldLogPWD;
var newLogPWD = document.InfoForm.newLogPWD;
var confirmLogPWD = document.InfoForm.confirmLogPWD;
if(oldLogPWD.value.checkEmpty()){
alert("旧登录密码不能为空!")
oldLogPWD.focus();
return false;
}
if(newLogPWD.value.checkEmpty()){
alert("新登录密码不能为空!")
newLogPWD.focus();
return false;
}
if(checkPass(newLogPWD.value)<3){
alert("新登录密码复杂度不够,请重新设置!");
newLogPWD.focus();
return false;
}
if(newLogPWD.value!=confirmLogPWD.value){
alert("确认新登录密码必须和新登录密码相等!");
confirmLogPWD.focus();
return false;
}
if(newLogPWD.value==oldLogPWD.value){
alert("新登录密码不可以与旧登录密码相等!");
newLogPWD.focus();
return false;
}
return true;
}
function SubmitForm(){
if(Validate()){
var con;
con=confirm("请牢记您的密码,确认执行该操作吗?");
if(con==true){
document.InfoForm.submit();
}
}
*/
</script>
</head>
<body>
<ul class="nav nav-tabs">
<li><a href="${ctx}/sys/user/info">个人信息</a></li>
<li class="active"><a href="${ctx}/sys/user/modifyPwd">修改密码</a></li>
</ul><br/>
<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/modifyPwd?forcedModify=${ForcedModify}" method="post" class="form-horizontal">
<form:hidden path="id"/>
<sys:message content="${message}"/>
<c:if test="${not empty ForcedModify}">
<font color="red">您当前密码为系统默认密码,为了保证数据权限和安全,请您在此修改密码!修改成功后,系统会自动进入您的任务列表!</font>
<br/><br/>
</c:if>
<div class="control-group">
<label class="control-label">旧密码:</label>
<div class="controls">
<input id="oldPassword" name="oldPassword" type="password" value="" maxlength="50" minlength="3" class="required"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="control-group">
<label class="control-label">新密码:</label>
<div class="controls">
<input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="6" class="required"/>
<span class="help-inline"><font color="red">* (说明:密码由六位以上的字母加数字组成,并且必须含有大写字母。)</font></span>
</div>
</div>
<div class="control-group">
<label class="control-label">确认新密码:</label>
<div class="controls">
<input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="6" class="required" equalTo="#newPassword"/>
<span class="help-inline"><font color="red">*</font> </span>
</div>
</div>
<div class="form-actions">
<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
</div>
</form:form>
</body>
</html>