Esempio n. 1
0
  /** @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    Boolean validCookieBool = false;
    Cookie[] cookies = request.getCookies();
    String userHash = getClientHash(cookies);
    SSOClientService ssocs = new SSOClientService();
    HistClientService hcs = new HistClientService();

    if (userHash != null) {
      String idPib = ssocs.getLoginName(userHash);
      hcs.logout(idPib);
      ssocs.logout(userHash);
    } else {
      System.out.println("<fyp2><Logout>userHash from Client is null!");
    }

    RequestDispatcher dispatcher = request.getRequestDispatcher("/Login/logout.jsp");
    if (dispatcher != null) dispatcher.forward(request, response);
  }
  /** @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */
  protected void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    Boolean validCookieBool = false;
    Cookie[] cookies = request.getCookies();
    String userHash = getClientHash(cookies);
    SSOClientService ssocs = new SSOClientService();
    RBKClientService rbkcs = new RBKClientService();

    if (userHash != null) {
      if (ssocs.checkTrust2FA(userHash)) {
        validCookieBool = true;
        System.out.println("<fyp2><userHash>userHash = " + userHash);
      }
    } else {
      System.out.println("<fyp2><AddPayee2FA1Action>userHash from Client is null!");
    }

    if (validCookieBool) {
      String userName = ssocs.getLoginName(userHash);
      String fromAccountString = request.getParameter("fromAccount");
      long fromAccount = Long.parseLong(fromAccountString);
      List<AccountLinkDataStructure> alds = rbkcs.getAccountLink(fromAccount);

      String[][] payee = getStringArrayForPayee(alds);

      request.setAttribute("payee", payee);
      request.setAttribute("fromAccount", fromAccountString);

      System.out.println("<fypWebService><AddPayee2FA1Action> userName    = "******"<fypWebService><AddPayee2FA1Action> fromAccount = " + fromAccountString);

      RequestDispatcher dispatcher =
          request.getRequestDispatcher("/addPayee/addPayee2FA1Action.jsp");
      if (dispatcher != null) dispatcher.forward(request, response);
    } else {
      RequestDispatcher dispatcher = request.getRequestDispatcher("/login/timedOut.jsp");
      if (dispatcher != null) dispatcher.forward(request, response);
    }
  }