Author: dongxu Date: Thu Sep 12 03:27:13 2013 New Revision: 1522205 URL: http://svn.apache.org/r1522205 Log: alert people "invilid login" for the wrong username and/or password, which should be improved with a gentle way
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserService.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserServiceImpl.java Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java?rev=1522205&r1=1522204&r2=1522205&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java Thu Sep 12 03:27:13 2013 @@ -120,10 +120,14 @@ import com.google.gwt.event.shared.Event ======= import com.google.gwt.place.shared.PlaceController; <<<<<<< HEAD +<<<<<<< HEAD >>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter import com.google.gwt.user.client.Window; ======= >>>>>>> introduce the top activity +======= +import com.google.gwt.user.client.Window; +>>>>>>> alert people "invilid login" for the wrong username and/or password, which should be improved with a gentle way import com.google.gwt.user.client.ui.AcceptsOneWidget; import com.google.gwt.user.client.ui.Focusable; import com.google.gwt.user.client.ui.HasValue; @@ -442,7 +446,10 @@ public class LoginActivity extends Abstr } @Override public void onFailure(ServerFailure error){ - placeController.goTo(new DefaultPlace()); + Window.alert(error.getMessage());//TODO a more gentle way + display.setLoading(false); + doReset(); +// placeController.goTo(new DefaultPlace()); } }); Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserService.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserService.java?rev=1522205&r1=1522204&r2=1522205&view=diff ============================================================================== --- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserService.java (original) +++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserService.java Thu Sep 12 03:27:13 2013 @@ -39,6 +39,10 @@ package org.apache.hupa.server.service; import org.apache.hupa.shared.domain.User; public interface LoginUserService { +<<<<<<< HEAD public User login(String username, String password); >>>>>>> Make chechsession and login work with RF, with refactoring fetch >>>>>>> folders. +======= + public User login(String username, String password) throws Exception; +>>>>>>> alert people "invilid login" for the wrong username and/or password, which should be improved with a gentle way } Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserServiceImpl.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserServiceImpl.java?rev=1522205&r1=1522204&r2=1522205&view=diff ============================================================================== --- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserServiceImpl.java (original) +++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/LoginUserServiceImpl.java Thu Sep 12 03:27:13 2013 @@ -24,6 +24,7 @@ <<<<<<< HEAD package org.apache.hupa.server.service; +<<<<<<< HEAD import javax.mail.MessagingException; import javax.servlet.http.HttpSession; ======= @@ -34,6 +35,8 @@ package org.apache.hupa.server.service; import javax.mail.MessagingException; >>>>>>> Make chechsession and login work with RF, with refactoring fetch >>>>>>> folders. +======= +>>>>>>> alert people "invilid login" for the wrong username and/or password, which should be improved with a gentle way import org.apache.hupa.server.utils.SessionUtils; import org.apache.hupa.shared.SConsts; import org.apache.hupa.shared.data.UserImpl; @@ -52,6 +55,7 @@ public class LoginUserServiceImpl extend @Inject private Provider<Settings> settingsProvider; <<<<<<< HEAD +<<<<<<< HEAD public User login(String username, String password) throws HupaException, MessagingException { HttpSession httpSession = httpSessionProvider.get(); SessionUtils.cleanSessionAttributes(httpSession); @@ -61,14 +65,18 @@ public class LoginUserServiceImpl extend cache.get(user); ======= public User login(String username, String password) { +======= + public User login(String username, String password) throws Exception { +>>>>>>> alert people "invilid login" for the wrong username and/or password, which should be improved with a gentle way SessionUtils.cleanSessionAttributes(httpSession); User user = new UserImpl(); user.setName(username); user.setPassword(password); try { cache.get(user); - } catch (MessagingException e) { + } catch (Exception e) { logger.error("Unable to authenticate user: " + username, e); + throw e; } >>>>>>> Make chechsession and login work with RF, with refactoring fetch >>>>>>> folders. user.setAuthenticated(true); --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org