- // login failed: redirecting to login
- logger.warn("--login: failed!");
- _sendLoginPage(aResponse, aRequest, aResponse.getWriter());
-
- return;
- } else if ((moduleName != null) && moduleName.equals("login")) {
- // login successful
- logger.info("--login: successful! setting uid: " + userEntity.getId());
- session.setAttribute("login.uid", userEntity);
- logger.debug("--login: trying to retrieve login.target");
-
- String target = (String) session.getAttribute("login.target");
-
- if (target != null) {
- logger.debug("Redirect: " + target);
-
- int serverPort = aRequest.getServerPort();
- String redirect = "";
- String redirectString = "";
-
- if (serverPort == 80) {
- redirect =
- aResponse.encodeURL(http + "://" + aRequest.getServerName() + target);
- redirectString =
- "<html><head><meta http-equiv=refresh content=\"1;URL=" +
- redirect + "\"></head><body>going <a href=\"" + redirect +
- "\">Mir</a></body></html>";
- } else {
- redirect =
- aResponse.encodeURL(http + "://" + aRequest.getServerName() + ":" +
- aRequest.getServerPort() + target);
- redirectString =
- "<html><head><meta http-equiv=refresh content=\"1;URL=" +
- redirect + "\"></head><body>going <a href=\"" + redirect +
- "\">Mir</a></body></html>";
- }