-
Notifications
You must be signed in to change notification settings - Fork 1
/
index_7_1.jsp
75 lines (65 loc) · 2.97 KB
/
index_7_1.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
<%--
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* 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 Lesser General Public License for more details.
*
* Copyright (c) 2002-2013 Pentaho Corporation.. All rights reserved.
--%>
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core'%>
<%@ page language="java"
import="
org.pentaho.platform.engine.core.system.PentahoSystem,
org.pentaho.platform.api.engine.IPentahoSession,
org.pentaho.platform.api.engine.IPluginManager,
java.util.List,
org.pentaho.platform.engine.core.system.PentahoSessionHolder,
java.util.ResourceBundle,
org.owasp.encoder.Encode,
java.net.URLClassLoader, java.net.URL"
%>
<%@page import="org.pentaho.platform.api.engine.IPentahoSession" %>
<%@page import="org.pentaho.platform.web.http.PentahoHttpSessionHelper" %>
<%@page import="org.pentaho.platform.api.engine.security.userroledao.IPentahoRole" %>
<%@page import="org.pentaho.platform.api.engine.security.userroledao.IPentahoUser" %>
<%@page import="org.pentaho.platform.api.engine.security.userroledao.IUserRoleDao" %>
<%@page import="java.util.ArrayList" %>
<html>
<head>
<%
URLClassLoader loader = new URLClassLoader( new URL[] { application.getResource( "/mantle/messages/" ) } );
ResourceBundle properties = ResourceBundle.getBundle( "mantleMessages", request.getLocale(), loader );
%>
<title><%= properties.getString("pentahoBATitle") %></title>
<script type="text/javascript" src="webcontext.js"></script>
<%
IPentahoSession userSession = PentahoSessionHolder.getSession();
String username = userSession.getName().toString();
IUserRoleDao userRoleDao = PentahoSystem.get( IUserRoleDao.class, "userRoleDaoProxy", PentahoSessionHolder.getSession());
List<IPentahoRole> userRoles = userRoleDao.getUserRoles( null, username );
List<String> listRoles = new ArrayList<String>();
for ( IPentahoRole role : userRoles ) {
listRoles.add(role.getName());
}
if(listRoles.contains("Administrator")) {
String url = "/pentaho/Home" ;
response.setStatus(response.SC_MOVED_TEMPORARILY);
response.setHeader("Location", url);
} else {
String url = "/pentaho/plugin/Gladiator/api/index" ; //Plugin Gladiator criado por Marco Antonio Smanioto
response.setStatus(response.SC_MOVED_TEMPORARILY);
response.setHeader("Location", url);
}
%>
</head>
<body>
</body>
</html>