updatePasswordForm.jsp 4.7 KB
<%@ page import="com.myproject.bean.Language" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8"%>


<c:choose>
    <c:when test="${not empty token}">
        <fmt:message key="updatePassword.passwordReset.message" var="subtitle"/>
    </c:when>
    <c:otherwise>

    </c:otherwise>
</c:choose>

<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
    <fmt:message key="user.profile.edit"/> <small><fmt:message key="profile.password.subtitle"/></small>
</h3>

<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PORTLET-->
        <div class="portlet box yellow-crusta">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-gift"></i><fmt:message key="profile.password.subtitle"/>
                </div>
            </div>
            <div class="portlet-body form">

                <%@include file="/common/success.jsp"%>
                <form method="post" id="updatePassword" action="updatePassword.html" class="form-horizontal form-bordered" >
                    <%--<input type="hidden" name="username" value="${username}"/>--%>
                    <div class="form-group">
                        <label class="col-sm-3 control-label"><fmt:message key="user.username"/></label>
                        <div class="col-sm-4">
                            <div class="input-group">
											<span class="input-group-addon">
											<i class="fa fa-user"></i>
											</span>
                                <input type="text" name="username" class="form-control" id="username"  value="<c:out value="${username}" escapeXml="true"/>" required readonly>
                            </div>
                        </div>
                    </div>


                    <%--有管理用户的权限,且不是自己,不需要密码--%>
                    <c:set var="needOldPwd" value="true"/>
                    <security:authorize ifAnyGranted="ROLE_MANAGE_USER">
                        <c:if test="${loginUser.username != username}">
                            <c:set var="needOldPwd" value="false"/>
                        </c:if>
                    </security:authorize>
                    <c:if test="${needOldPwd == 'true'}">
                        <c:choose>
                            <c:when test="${not empty token}">
                                <input type="hidden" name="token" value="<c:out value="${token}" escapeXml="true" />"/>
                            </c:when>
                            <c:otherwise>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label"><fmt:message
                                            key="updatePassword.currentPassword.label"/></label>

                                    <div class="col-sm-4">
                                        <div class="input-group">
											<span class="input-group-addon">
											<i class="fa fa-cogs"></i>
											</span>
                                            <input type="password" class="form-control" name="currentPassword"
                                                   id="currentPassword" required autofocus>
                                        </div>
                                    </div>
                                </div>
                            </c:otherwise>
                        </c:choose>
                    </c:if>
                        <div class="form-group">
                            <label class="col-sm-3 control-label"><fmt:message key="updatePassword.newPassword.label"/></label>
                            <div class="col-sm-4">
                                <div class="input-group">
											<span class="input-group-addon">
											<i class="fa fa-cogs"></i>
											</span>
                                    <input type="password" class="form-control" name="password" id="password" required>
                                </div>
                            </div>
                        </div>


                    <div class="form-actions">
                        <div class="row">
                            <div class="col-md-offset-3 col-md-9">
                                <button type="submit" class="btn purple"><i class="fa fa-check"></i> <fmt:message key='updatePassword.changePasswordButton'/></button>
                                <button type="button" class="btn default" onclick="window.location=''"><i class="fa fa-history"></i><fmt:message key="button.cancel"/></button>
                            </div>
                        </div>
                    </div>
                </form>

            </div>
        </div>
        <!-- END PORTLET-->
    </div>
</div>