Author: channa
Date: Wed Jan 23 10:36:19 2008
New Revision: 12783

Log:

Fixed user login disabling logic.

Modified:
   trunk/mashup/java/modules/www/signin.jsp

Modified: trunk/mashup/java/modules/www/signin.jsp
==============================================================================
--- trunk/mashup/java/modules/www/signin.jsp    (original)
+++ trunk/mashup/java/modules/www/signin.jsp    Wed Jan 23 10:36:19 2008
@@ -82,22 +82,22 @@
                 SecureRegistry secureRegistry =
                         RegistryUtils.createSecureRegistry(nameProvided, 
jdbcRegistry, realm);
 
-                
request.getSession().setAttribute(MashupConstants.USER_REGISTRY, 
secureRegistry);
-
-                ServerConfiguration serverConfig = 
ServerConfiguration.getInstance();
-                String rememberPeriod =
-                        
serverConfig.getFirstProperty(MashupConstants.SESSION_MANAGEMENT + "." +
-                                MashupConstants.REMEMBER_ME_PERIOD);
-                if (rememberPeriod != null) {
-                    int numDays = 0;
-                    try {
-                        numDays = Integer.parseInt(rememberPeriod);
-                    } catch (NumberFormatException e) {
-                    }
-                    int expireIn = 60 * 60 * 24 * numDays;
-
-                    // Check if the user is active - if not, fail login.
-                    if (ManageUsers.isUserActive(secureRegistry, 
nameProvided)) {
+                // Check if the user is active - if not, fail login.
+                if (ManageUsers.isUserActive(secureRegistry, nameProvided)) {
+                    request.getSession()
+                            .setAttribute(MashupConstants.USER_REGISTRY, 
secureRegistry);
+
+                    ServerConfiguration serverConfig = 
ServerConfiguration.getInstance();
+                    String rememberPeriod =
+                            
serverConfig.getFirstProperty(MashupConstants.SESSION_MANAGEMENT + "." +
+                                    MashupConstants.REMEMBER_ME_PERIOD);
+                    if (rememberPeriod != null) {
+                        int numDays = 0;
+                        try {
+                            numDays = Integer.parseInt(rememberPeriod);
+                        } catch (NumberFormatException e) {
+                        }
+                        int expireIn = 60 * 60 * 24 * numDays;
 
                         //Checking whether the user has opted to remember the 
session
                         if (rememberMe.equalsIgnoreCase("true")) {
@@ -114,21 +114,21 @@
                             // Encode the password
                             Cookie passwordCookie = new Cookie("password",
                                                                new 
sun.misc.BASE64Encoder().encode(
-                                                                       
passwordProvided.getBytes("UTF-8")));
+                                                                       
passwordProvided.getBytes(
+                                                                               
"UTF-8")));
                             passwordCookie.setMaxAge(expireIn);
                             passwordCookie.setSecure(true);
                             response.addCookie(passwordCookie);
                         }
 
+                        response.sendRedirect(bounceback);
                     }
-
-                    response.sendRedirect(bounceback);
                 } else {
                     success = false;
                 }
             } catch (MashupFault e) {
                 success = false;
-            } 
+            }
         }
     }
 

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

Reply via email to