portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r584924 - in /portals/jetspeed-2/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginProxyServlet.java jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/web.xml
Date Mon, 15 Oct 2007 21:15:18 GMT
Author: taylor
Date: Mon Oct 15 14:15:17 2007
New Revision: 584924

URL: http://svn.apache.org/viewvc?rev=584924&view=rev
Log:
https://issues.apache.org/jira/browse/JS2-789

Modified:
    portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginProxyServlet.java
    portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/web.xml

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginProxyServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginProxyServlet.java?rev=584924&r1=584923&r2=584924&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginProxyServlet.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginProxyServlet.java
Mon Oct 15 14:15:17 2007
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
@@ -40,12 +41,23 @@
  */
 public class LoginProxyServlet extends HttpServlet
 {
+    private boolean credentialsFromRequest = true;
+    
+    public void init(ServletConfig config) throws ServletException
+    {
+        super.init(config);
+        String s = config.getInitParameter("credentialsFromRequest");
+        if (s != null)
+        {
+            credentialsFromRequest = s.equalsIgnoreCase("true");
+        }
+    }
 
     public void doGet(HttpServletRequest request,
             HttpServletResponse response) throws IOException, ServletException
     {
         String parameter;
-
+        String username;
         request.setCharacterEncoding( "UTF-8" );
                 
         HttpSession session = request.getSession(true);
@@ -55,17 +67,25 @@
             session.setAttribute(LoginConstants.DESTINATION, parameter);
         else
             session.removeAttribute(LoginConstants.DESTINATION);
-        String username = request.getParameter(LoginConstants.USERNAME);
-        if (username != null)
-            session.setAttribute(LoginConstants.USERNAME, username);
+        if (credentialsFromRequest)
+        {
+            username = request.getParameter(LoginConstants.USERNAME);
+            if (username != null)
+                session.setAttribute(LoginConstants.USERNAME, username);
+            else
+                session.removeAttribute(LoginConstants.USERNAME);
+            parameter = request.getParameter(LoginConstants.PASSWORD);
+            if (parameter != null)
+                session.setAttribute(LoginConstants.PASSWORD, parameter);
+            else
+                session.removeAttribute(LoginConstants.PASSWORD);
+        }
         else
-            session.removeAttribute(LoginConstants.USERNAME);
-        parameter = request.getParameter(LoginConstants.PASSWORD);
-        if (parameter != null)
-            session.setAttribute(LoginConstants.PASSWORD, parameter);
-        else
-            session.removeAttribute(LoginConstants.PASSWORD);
-
+        {
+            username = (String)session.getAttribute(LoginConstants.USERNAME);
+            parameter = (String)session.getAttribute(LoginConstants.PASSWORD);          
 
+        }
+        
         // Globaly override all psml themes
         if (request
                 .getParameter(PortalReservedParameters.PAGE_THEME_OVERRIDE_ATTRIBUTE) !=
null)

Modified: portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/web.xml?rev=584924&r1=584923&r2=584924&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/web.xml
(original)
+++ portals/jetspeed-2/trunk/jetspeed-portal-resources/src/main/resources/webapp/WEB-INF/web.xml
Mon Oct 15 14:15:17 2007
@@ -118,6 +118,10 @@
   <servlet>
     <servlet-name>LoginProxyServlet</servlet-name>
     <servlet-class>org.apache.jetspeed.login.LoginProxyServlet</servlet-class>
+	<init-param>
+		<param-name>credentialsFromRequest</param-name>
+		<param-value>true</param-value>
+	</init-param>        
   </servlet>
 
   <servlet>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message