Package com.dianping.cat.system.page.login.service

Examples of com.dianping.cat.system.page.login.service.SigninContext


  @Inject
  private SigninService m_signinService;

  private SigninContext createSigninContext(Context ctx) {
    return new SigninContext(ctx.getHttpServletRequest(), ctx.getHttpServletResponse());
  }
View Full Code Here


    if (payload.isSubmit() && action == Action.LOGIN) {
      String account = payload.getAccount();
      String password = payload.getPassword();

      if (account != null && account.length() != 0 && password != null) {
        SigninContext sc = createSigninContext(ctx);
        Credential credential = new Credential(account, password);
        Session session = m_signinService.signin(sc, credential);

        if (session == null) {
          ctx.addError(new ErrorObject("biz.login"));
        } else {
          redirect(ctx, payload);
          return;
        }
      } else {
        ctx.addError(new ErrorObject("biz.login.input").addArgument("account", account).addArgument("password",
              password));
      }
    } else if (action == Action.LOGOUT) {
      SigninContext sc = createSigninContext(ctx);

      m_signinService.signout(sc);
      redirect(ctx, payload);
      return;
    } else {
      SigninContext sc = createSigninContext(ctx);
      Session session = m_signinService.validate(sc);

      if (session != null) {
        ActionContext<?> parent = ctx.getParent();
View Full Code Here

TOP

Related Classes of com.dianping.cat.system.page.login.service.SigninContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.