taylor 2004/09/01 14:21:56
Modified: fusion/src/java/org/apache/jetspeed/fusion/engine/servlet
FusionServletRequestImpl.java
Log:
Fusion (J1) still needs the anoymous user, this override voids the fix to J2 to
re-enabled login by correctly using the authenticated principal from the application
server
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.5 +25 -2
jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/engine/servlet/FusionServletRequestImpl.java
Index: FusionServletRequestImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed/fusion/src/java/org/apache/jetspeed/fusion/engine/servlet/FusionServletRequestImpl.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FusionServletRequestImpl.java 25 Aug 2004 02:09:47 -0000 1.4
+++ FusionServletRequestImpl.java 1 Sep 2004 21:21:56 -0000 1.5
@@ -15,11 +15,14 @@
*/
package org.apache.jetspeed.fusion.engine.servlet;
+import java.security.Principal;
import java.util.Iterator;
+import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.jetspeed.engine.servlet.ServletRequestImpl;
+import org.apache.jetspeed.request.JetspeedRequestContext;
import org.apache.jetspeed.services.JetspeedSecurity;
import org.apache.jetspeed.services.rundata.JetspeedRunDataService;
import org.apache.jetspeed.services.security.JetspeedSecurityException;
@@ -33,8 +36,8 @@
import org.apache.turbine.services.rundata.RunDataService;
/**
- * @author <a href="mailto:[EMAIL PROTECTED]">Jeremy Ford</a>
* @version $Id$
+ * @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Jeremy Ford</a>
*/
public class FusionServletRequestImpl extends ServletRequestImpl
@@ -121,5 +124,25 @@
{
this._getHttpServletRequest().setAttribute(name, value);
}
+
+ public Principal getUserPrincipal()
+ {
+ JetspeedRequestContext context = (JetspeedRequestContext)
getAttribute("org.apache.jetspeed.request.RequestContext");
+ if (context != null)
+ {
+ Set principals = context.getSubject().getPrincipals();
+ if (principals != null)
+ {
+ Iterator it = principals.iterator();
+ if (it.hasNext())
+ {
+ return (Principal) it.next();
+ }
+ }
+ }
+ return super.getUserPrincipal();
+
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]