Author: prabath
Date: Tue Dec 11 03:02:10 2007
New Revision: 10948

Log:

Added OpenID related actions

Modified:
   
branches/solutions/identity/openid-poc/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java

Modified: 
branches/solutions/identity/openid-poc/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
==============================================================================
--- 
branches/solutions/identity/openid-poc/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
        (original)
+++ 
branches/solutions/identity/openid-poc/modules/user-ui/src/main/java/org/wso2/solutions/identity/user/ui/interceptor/SessionInterceptor.java
        Tue Dec 11 03:02:10 2007
@@ -28,45 +28,53 @@
 
 public class SessionInterceptor extends AbstractInterceptor {
 
-    private static final long serialVersionUID = -998579259074120645L;
+       private static final long serialVersionUID = -998579259074120645L;
 
-    public String intercept(ActionInvocation invocation) throws Exception {
-        final ActionContext context = invocation.getInvocationContext();
-        HttpServletRequest request = (HttpServletRequest) context
-                .get(StrutsStatics.HTTP_REQUEST);
-        StringBuffer requestURL = request.getRequestURL();
-        if (requestURL.indexOf(UIConstants.LOGIN_ACTION) < 0
-                && requestURL.toString().indexOf(
-                        UIConstants.INFOCARD_SUBMIT_ACTION) < 0
-                && requestURL.toString().indexOf(
-                        UIConstants.USER_REGISTRATION_FORM_ACTION) < 0
-                && requestURL.toString().indexOf(
-                        UIConstants.USER_REGISTRATION_FORM_SUBMIT_ACTION) < 0
-                && requestURL.toString().indexOf(
-                        UIConstants.USER_REGISTRATION_CARD_ACTION) < 0
-                && requestURL.toString().indexOf(
-                        UIConstants.USER_REGISTRATION_CARD_SUBMIT_ACTION) < 0) 
{
-            // If the request is not Login.action
-            HttpSession session = request.getSession(true);
-            Object user = session.getAttribute(UIConstants.USER);
-            if (user == null) {
-                // If there is no session
-                return "login";
-            } else {
-                // Existing session
-                if (requestURL.toString().indexOf(UIConstants.LOGIN_JSP) > 0) {
-                    // If an already logged in used is trying to access the
-                    // login.jsp
-                    return "showMain";
-                } else {
-                    return invocation.invoke();
-                }
-            }
-        } else {
-            // If the request is for the Login.action then simply do it
-            return invocation.invoke();
-        }
+       public String intercept(ActionInvocation invocation) throws Exception {
+               final ActionContext context = invocation.getInvocationContext();
+               HttpServletRequest request = (HttpServletRequest) context
+                               .get(StrutsStatics.HTTP_REQUEST);
+               StringBuffer requestURL = request.getRequestURL();
+               if (requestURL.indexOf(UIConstants.LOGIN_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.INFOCARD_SUBMIT_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.USER_REGISTRATION_FORM_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.USER_REGISTRATION_FORM_SUBMIT_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.USER_REGISTRATION_CARD_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.USER_REGISTRATION_CARD_SUBMIT_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.OPENID_SUBMIT_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                                               
UIConstants.USER_REGISTRATION_OPENDID_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                                                               
UIConstants.OPENDID_CALLBACK_ACTION) < 0
+                               && requestURL.toString().indexOf(
+                                               
UIConstants.OPENID_LOGIN_ACTION) < 0) {
+                       // If the request is not Login.action
+                       HttpSession session = request.getSession(true);
+                       Object user = session.getAttribute(UIConstants.USER);
+                       if (user == null) {
+                               // If there is no session
+                               return "login";
+                       } else {
+                               // Existing session
+                               if 
(requestURL.toString().indexOf(UIConstants.LOGIN_JSP) > 0) {
+                                       // If an already logged in used is 
trying to access the
+                                       // login.jsp
+                                       return "showMain";
+                               } else {
+                                       return invocation.invoke();
+                               }
+                       }
+               } else {
+                       // If the request is for the Login.action then simply 
do it
+                       return invocation.invoke();
+               }
 
-    }
+       }
 
 }

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to