Permalink
Browse files

#4276 added logged in status and log out feature

  • Loading branch information...
1 parent 1d48e99 commit 55a530dee1123064c53b50714692fc2ed90c4ec5 @ddossot ddossot committed Jan 27, 2014
View
@@ -200,6 +200,11 @@
<artifactId>spring-security-web</artifactId>
<version>${spring-security.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-taglibs</artifactId>
+ <version>${spring-security.version}</version>
+ </dependency>
<!-- CXF -->
<dependency>
@@ -57,6 +57,8 @@
access="isAuthenticated() and hasPermission(T(eu.openanalytics.rsb.component.AdminResource).ADMIN_SYSTEM_PATH, 'RSB_RESOURCE')" />
<intercept-url pattern="/**" access="isAuthenticated()" />
+ <logout logout-url="/logout" logout-success-url="/logout.html" invalidate-session="true" />
+
<!-- Pick the authentication mechanism (basic or OpenID) -->
<http-basic />
<!--
@@ -86,3 +86,8 @@ td, th {
#lRight{
float: right;
}
+
+.alignRight {
+ float: right;
+ position:relative;
+}
@@ -0,0 +1,42 @@
+<%--
+ R Service Bus
+
+ Copyright (c) Copyright of OpenAnalytics BVBA, 2010-2013
+
+ ===========================================================================
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+
+ @author rsb.development@openanalytics.eu
+--%>
+<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>RSB - Logout</title>
+
+ <link rel="stylesheet" href="<c:url value='/css/rsb.css'/>" />
+
+</head>
+
+ <body>
+ <ul>
+ <h1><img src="css/images/open_analytics_logo.jpg" style="vertical-align:middle;" title="OpenAnalytics" />&nbsp;RSB - R Service Bus</span></h1>
+
+ <p>You have been logged out. You should close your browser for security reasons.</p>
+
+ <p><a href="index.html">Log in RSB again</a>.</p>
+ </ul>
+ </body>
+</html>
View
@@ -20,8 +20,9 @@
@author rsb.development@openanalytics.eu
--%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<html xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page">
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
+<html xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:sec="http://www.springframework.org/security/tags">
<head>
<script type="text/javascript" src="js/date.js"></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
@@ -46,7 +47,11 @@
<link type="text/css" href="css/rsb.css" rel="stylesheet" />
</head>
<body>
+ <sec:authentication var="user" property="principal" />
<div class="box">
+ <sec:authorize access="isAuthenticated()">
+ <div class="alignRight">${user.username} - <a href="logout">Logout</a></div>
+ </sec:authorize>
<h1><img src="css/images/open_analytics_logo.jpg" style="vertical-align:middle;" title="OpenAnalytics" />&nbsp;<span id="formTitle"></span></h1>
<div class="container">

0 comments on commit 55a530d

Please sign in to comment.