Author: bdaw
Date: 2008-06-17 09:17:08 -0400 (Tue, 17 Jun 2008)
New Revision: 11063
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/header.jsp
Log:
JBPORTAL-2039 Make the check in header generation based on Principal and not User
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2008-06-17
01:58:52 UTC (rev 11062)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2008-06-17
13:17:08 UTC (rev 11063)
@@ -69,6 +69,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.security.Principal;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -195,7 +196,11 @@
User user = controllerCtx.getUser();
rd.setAttribute("org.jboss.portal.header.USER", user);
- if (user == null)
+ Principal principal =
controllerCtx.getServerInvocation().getServerContext().getClientRequest().getUserPrincipal();
+ rd.setAttribute("org.jboss.portal.header.PRINCIPAL", principal);
+
+
+ if (principal == null)
{
PortalURL portalURL = null;
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/header.jsp
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/header.jsp 2008-06-17
01:58:52 UTC (rev 11062)
+++
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/header.jsp 2008-06-17
13:17:08 UTC (rev 11063)
@@ -1,10 +1,12 @@
<%@ page import="org.jboss.portal.api.PortalURL" %>
-<%@ page import="org.jboss.portal.identity.User" %>
+<%@ page import="java.security.Principal" %>
<%@page import="java.util.ResourceBundle"%>
+
<%
+
ResourceBundle rb = ResourceBundle.getBundle("Resource",
request.getLocale());
- User user = (User)request.getAttribute("org.jboss.portal.header.USER");
+ Principal principal =
(Principal)request.getAttribute("org.jboss.portal.header.PRINCIPAL");
PortalURL dashboardURL =
(PortalURL)request.getAttribute("org.jboss.portal.header.DASHBOARD_URL");
PortalURL loginURL =
(PortalURL)request.getAttribute("org.jboss.portal.header.LOGIN_URL");
PortalURL defaultPortalURL =
(PortalURL)request.getAttribute("org.jboss.portal.header.DEFAULT_PORTAL_URL");
@@ -15,7 +17,7 @@
%>
<%
- if (user == null)
+ if (principal == null)
{
%>
@@ -52,8 +54,9 @@
document.getElementById('loginIframe').src = '';
/* ]]> */
</script>
-<%= rb.getString("LOGGED") %>: <%= user.getUserName()
%><br/><br/>
+<%= rb.getString("LOGGED") %>: <%= principal.getName()
%><br/><br/>
+
<%
if (dashboardURL != null)
{
Show replies by date