-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logout back to PREVIOUS_ADMINISTRATOR
- Loading branch information
hvle
committed
Jun 16, 2014
1 parent
4497430
commit 625bb8d
Showing
1 changed file
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,28 @@ | ||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | ||
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> | ||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> | ||
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%> | ||
<html> | ||
<body> | ||
<h1>Title : ${title}</h1> | ||
<h1>Message : ${message}</h1> | ||
|
||
<c:if test="${pageContext.request.userPrincipal.name != null}"> | ||
<h2>Welcome : ${pageContext.request.userPrincipal.name}</h2> | ||
<p><a href="<c:url value="/j_spring_security_logout" />" >Logout</a></p> | ||
<sec:authorize access="hasRole('ROLE_ADMINISTRATOR')"> | ||
<form action="j_spring_security_switch_user" method="POST"> | ||
Switch to user: <input type="text" name="j_username" /><br/> | ||
<input type="submit" value="Switch"/> | ||
</form> | ||
</sec:authorize> | ||
<h2>Welcome : ${pageContext.request.userPrincipal.name}</h2> | ||
|
||
<sec:authorize var="IS_PREVIOUS_ADMINISTRATOR" access="hasRole('ROLE_PREVIOUS_ADMINISTRATOR')" /> | ||
<c:choose> | ||
<c:when test="${IS_PREVIOUS_ADMINISTRATOR}"> | ||
<p><a href="<c:url value="/j_spring_security_exit_user" />">Logout</a></p> | ||
</c:when> | ||
<c:otherwise> | ||
<p><a href="<c:url value="/j_spring_security_logout" />">Logout</a></p> | ||
<sec:authorize access="hasRole('ROLE_ADMINISTRATOR')"> | ||
<form action="j_spring_security_switch_user" method="POST"> | ||
Switch to user: <input type="text" name="j_username" /><br /> | ||
<input type="submit" value="Switch" /> | ||
</form> | ||
</sec:authorize> | ||
</c:otherwise> | ||
</c:choose> | ||
</c:if> | ||
</body> | ||
</html> |