Update of 
/var/cvs/contributions/CMSContainer_Portlets/portlets-login/src/java/com/finalist/cmsc/portlets
In directory 
james.mmbase.org:/tmp/cvs-serv2612/portlets-login/src/java/com/finalist/cmsc/portlets

Modified Files:
        LoginPortlet.java 
Log Message:
CMSC-830 - *added* some functionality to send the password, but at the same 
time *removed* it from the portlet because it doesn't belong there.


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer_Portlets/portlets-login/src/java/com/finalist/cmsc/portlets
See also: http://www.mmbase.org/jira/browse/CMSC-830


Index: LoginPortlet.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer_Portlets/portlets-login/src/java/com/finalist/cmsc/portlets/LoginPortlet.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- LoginPortlet.java   14 Mar 2008 12:52:11 -0000      1.8
+++ LoginPortlet.java   7 Apr 2008 09:50:09 -0000       1.9
@@ -29,18 +29,20 @@
  * @author Remco Bos
  */
 public class LoginPortlet extends CmscPortlet {
+   protected static final String ACTION_PARAMETER = "action";
 
        private static final String ACEGI_SECURITY_FORM_USERNAME_KEY = 
"j_username";
-
        private static final String ACEGI_SECURITY_FORM_PASSWORD_KEY = 
"j_password";
 
        private static final Log log = LogFactory.getLog(LoginPortlet.class);
 
+   @Override
        public void processView(ActionRequest request, ActionResponse response) 
throws PortletException, IOException {
-               String action = request.getParameter("action");
+      String action = request.getParameter(ACTION_PARAMETER);
                if ("login".equals(action)) {
                        String userName = 
request.getParameter(ACEGI_SECURITY_FORM_USERNAME_KEY);
                        String password = 
request.getParameter(ACEGI_SECURITY_FORM_PASSWORD_KEY);
+
                        if (!StringUtils.isBlank(userName) && 
!StringUtils.isBlank(password)) {
                            Community.login(userName, password);
                        }
@@ -51,16 +53,9 @@
                                log.info(String.format("Login failed for user 
%s", userName));
                                response.setRenderParameter("errormessage", 
"login.failed");
                        }
-
                } else if ("logout".equals(action)) {
                        Community.logout();
-               } else if ("send_password".equals(action)) {
-            throw new UnsupportedOperationException("Community module does not 
have all methods yet");
-//            String username = request.getParameter("username");
-//            if (!StringUtils.isBlank(username)) {
-//            }
-               }
-               else {
+      } else {
                    // Unknown
                        log.error(String.format("Unknown action '%s'", action));
                }
@@ -68,21 +63,20 @@
 
        @Override
        protected void doView(RenderRequest request, RenderResponse response) 
throws PortletException, IOException {
+
+      String template;
+
            String error = request.getParameter("errormessage");
            if (!StringUtils.isBlank(error)) {
                request.setAttribute("errormessage", error);
            }
            
-               String template = null;
                if (Community.isAuthenticated()) {
                        template = "login/logout.jsp";
                } else {
                        template = "login/login.jsp";
-               String action = request.getParameter("action");
-               if (!StringUtils.isBlank(action) && 
"send_password".equals(action)) {
-                   template = "login/send_password.jsp";
-               }
                }
+
                doInclude("view", template, request, response);
        }
 }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to