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

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


      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();

        if (parent instanceof SystemContext) {
          SystemContext<?> context = (SystemContext<?>) parent;
          LoginMember member = session.getMember();
          context.setSigninMember(member);
          logAccess(ctx, member);
          return;
        } else if (parent != null) {
          throw new RuntimeException(String.format("%s should extend %s!", ctx.getClass(), SystemContext.class));
View Full Code Here

TOP

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

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.