Author: tyrell
Date: Wed Jan 16 18:17:26 2008
New Revision: 12363

Log:

Handling the initial setup, when for some reason the cookies were set on the 
client browser.

Modified:
   trunk/mashup/java/modules/www/index.jsp
   trunk/mashup/java/modules/www/register_admin.jsp

Modified: trunk/mashup/java/modules/www/index.jsp
==============================================================================
--- trunk/mashup/java/modules/www/index.jsp     (original)
+++ trunk/mashup/java/modules/www/index.jsp     Wed Jan 16 18:17:26 2008
@@ -60,6 +60,23 @@
 <%
     if (!MashupUtils.isInitialSetupComplete() && 
MashupConstants.LOCALHOST.equalsIgnoreCase(
             request.getLocalName())) {
+        //Deleting previous user login cookies, if found
+        Cookie[] cookies = request.getCookies();
+        Cookie curCookie = null;
+        for (int x = 0; x < cookies.length; x++) {
+            curCookie = cookies[x];
+            if (curCookie.getName().equalsIgnoreCase("rememberMe")) {
+                curCookie.setMaxAge(0);
+                response.addCookie(curCookie);
+            } else if (curCookie.getName().equalsIgnoreCase("username")) {
+                curCookie.setMaxAge(0);
+                response.addCookie(curCookie);
+            } else if (curCookie.getName().equalsIgnoreCase("password")) {
+                curCookie.setMaxAge(0);
+                response.addCookie(curCookie);
+            }
+        }
+
         response.sendRedirect("register_admin.jsp?firstcall=true");
     }
 

Modified: trunk/mashup/java/modules/www/register_admin.jsp
==============================================================================
--- trunk/mashup/java/modules/www/register_admin.jsp    (original)
+++ trunk/mashup/java/modules/www/register_admin.jsp    Wed Jan 16 18:17:26 2008
@@ -19,11 +19,10 @@
 <%@ page import="org.wso2.mashup.webapp.utils.RegistryUtils" %>
 <%@ page import="org.wso2.registry.Registry" %>
 
-<!--Required to keep a user logged in if 'Remember Me' option is selected-->
-<%@ include file="validate_login.jsp" %>
-
 <%
     String firstCall = request.getParameter("firstcall");
+
+    Registry registry = RegistryUtils.getRegistry(request);
 %>
 <jsp:useBean id="registrationHandler" 
class="org.wso2.mashup.webapp.identity.RegistrationBean"
              scope="request">

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to