Пример #1
0
  public final void handle(Transaction transaction) throws Exception {
    SessionEnvironment sessionEnvironment = transaction.getSessionEnvironment();

    if (sessionEnvironment.getUser() != null) {

      Logs.log(
          Logs.SECURITY_WARNING_CAT,
          "User tries to login while logged.",
          Logs.USER_ID_TAG,
          Integer.toString(sessionEnvironment.getUser().userId));

      sessionEnvironment.setUser(null);
    }

    transaction.sendHttpRedirection(SSLLogin);
  }
Пример #2
0
 public void handle(Transaction transaction) throws Exception {
   if (transaction.getSessionEnvironment().getUser() == null) {
     if (transaction.getGzipOk()) {
       transaction.sendHtmlNoExpireHeaderOkGzip();
       transaction.write(loginOkGzipArray);
     } else {
       transaction.sendHtmlNoExpireHeaderNoGzip();
       transaction.write(loginNoGzipArray);
     }
   } else {
     if (transaction.getGzipOk()) {
       transaction.sendHtmlNoExpireHeaderOkGzip();
       transaction.write(logoutOkGzipArray);
     } else {
       transaction.sendHtmlNoExpireHeaderNoGzip();
       transaction.write(logoutNoGzipArray);
     }
   }
 }