-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchangePassword.jsp
135 lines (125 loc) · 5.81 KB
/
changePassword.jsp
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
<%--
Document : changePassword
Created on : Dec 8, 2016, 1:41:41 PM
Author : QuynhNguyen
--%>
<%@page import="com.dal.UserContext"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Change password</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="css/headerStyle.css" rel="stylesheet" type="text/css"/>
<link href="css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="css/bootstrapValidator.min.css" rel="stylesheet" type="text/css"/>
<script src="js/jquery.min_2.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/bootstrapValidator.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#chgPassword').bootstrapValidator({
// To use feedback icons, ensure that you use Bootstrap v3.1.0 or later
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
oldPassword: {
validators: {
notEmpty: {
message: 'Please supply password'
}
// regexp: {
// regexp: /^[a-zA-Z\s]+$/,
// message: 'The username can only consist of alphabetical'
// }
}
},
newPassword: {
validators: {
notEmpty: {
message: 'Please supply password'
}
}
},
confirmPassword: {
validators: {
identical: {
field: 'newPassword',
message: 'The password and its confirm are not the same'
}
}
}
}
});
});
</script>
</head>
<body>
<% String usr = request.getParameter("username");
usr = (usr == null) ? "" : usr;
%>
<div id="wrapper">
<%@include file="header.jsp" %>
<div id="content">
<h2 class="text-primary text-center">Change password information</h2>
<form action="LoginController" class="form-horizontal" id="chgPassword" method="POST">
<div class="form-group">
<label class="control-label col-md-3 col-md-offset-2">User Name</label>
<div class="col-md-6">
<div class="input-group">
<input class="form-control" type="text" name="username" readonly="" value="<%=usr%>"/>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-md-offset-2">Old Password</label>
<div class="col-md-6">
<div class="input-group">
<input class="form-control" type="password" name="oldPassword" value=""/>
</div>
</div>
</div>
<!--username-->
<div class="form-group">
<label class="control-label col-md-3 col-md-offset-2">New Password</label>
<div class="col-md-6">
<div class="input-group">
<input class="form-control" type="password" name="newPassword" value=""/>
</div>
</div>
</div>
<!--password-->
<div class="form-group">
<label class="control-label col-md-3 col-md-offset-2">Confirm Password</label>
<div class="col-md-6">
<div class="input-group">
<input class="form-control" type="password" name="confirmPassword" value=""/>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label col-md-offset-2"></label>
<div class="col-md-6">
<button type="submit" name="action" value="changePassword" class="btn btn-warning"><span class="fa fa-edit"></span> Change</button>
</div>
</div>
</form>
<%
if (session.getAttribute("chgOK") != null) {
session.removeAttribute("chgPasswordOK");
%>
<div class="col-md-3 col-md-offset-5"><strong class="alert-success">${chgOK}</strong></div>
<% } else if (session.getAttribute("chgValid") != null) {
session.removeAttribute("chgPasswordValid");
%>
<div class="col-md-3 col-md-offset-5"><strong class="alert-danger">${chgValid}</strong></div>
<% }%>
</div>
<%@include file="footer.jsp" %>
</div>
</body>
</html>