//# 0 errors, 23 messages
//#
package net.sourceforge.pebble.security;
    //#authenticationprocessingfilter.java:1:1: class: net.sourceforge.pebble.security.AuthenticationProcessingFilter

import org.acegisecurity.AuthenticationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Overidden to redirect the user to the blog that they were trying to log in to.
 *
 * @author    Simon Brown
 */
public class AuthenticationProcessingFilter extends org.acegisecurity.ui.webapp.AuthenticationProcessingFilter {
    //#authenticationprocessingfilter.java:16: method: void net.sourceforge.pebble.security.AuthenticationProcessingFilter.net.sourceforge.pebble.security.AuthenticationProcessingFilter()
    //#authenticationprocessingfilter.java:16: Warning: method not available
    //#    -- call on void org.acegisecurity.ui.webapp.AuthenticationProcessingFilter()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.security.AuthenticationProcessingFilter
    //#    method: void net.sourceforge.pebble.security.AuthenticationProcessingFilter()
    //#    unanalyzed callee: void org.acegisecurity.ui.webapp.AuthenticationProcessingFilter()
    //#input(void net.sourceforge.pebble.security.AuthenticationProcessingFilter()): this
    //#authenticationprocessingfilter.java:16: end of method: void net.sourceforge.pebble.security.AuthenticationProcessingFilter.net.sourceforge.pebble.security.AuthenticationProcessingFilter()

  private static final Log log = LogFactory.getLog(AuthenticationProcessingFilter.class);
    //#authenticationprocessingfilter.java:18: method: net.sourceforge.pebble.security.AuthenticationProcessingFilter.net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init
    //#authenticationprocessingfilter.java:18: Warning: method not available
    //#    -- call on Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.security.AuthenticationProcessingFilter
    //#    method: net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init
    //#    unanalyzed callee: Log org.apache.commons.logging.LogFactory:getLog(Class)
    //#output(net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init): __Descendant_Table[net/sourceforge/pebble/security/AuthenticationProcessingFilter]
    //#output(net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init): __Dispatch_Table.onPreAuthentication(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V
    //#output(net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init): log
    //#post(net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init): __Descendant_Table[net/sourceforge/pebble/security/AuthenticationProcessingFilter] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init): __Dispatch_Table.onPreAuthentication(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V == &onPreAuthentication
    //#post(net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init): init'ed(log)
    //#authenticationprocessingfilter.java:18: end of method: net.sourceforge.pebble.security.AuthenticationProcessingFilter.net.sourceforge.pebble.security.AuthenticationProcessingFilter__static_init

  /**
   * Overidden to set the value of the defaultTargetUrl property based upon a form parameter.
   *
   * @param request
   * @param response
   * @throws AuthenticationException
   * @throws IOException
   */
  protected void onPreAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException {
//    PebbleContext context = PebbleContext.getInstance();
//    if (context.getConfiguration().isVirtualHostingEnabled()) {
//      Cookie cookie = CookieUtils.getCookie(request.getCookies(), TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY);
//      if (cookie != null) {
//        cookie.setDomain("." + context.getConfiguration().getDomainName());
//        response.addCookie(cookie);
//      }
//    }
//
    setDefaultTargetUrl(request.getParameter("redirectUrl"));
    //#authenticationprocessingfilter.java:38: method: void net.sourceforge.pebble.security.AuthenticationProcessingFilter.onPreAuthentication(HttpServletRequest, HttpServletResponse)
    //#authenticationprocessingfilter.java:38: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.security.AuthenticationProcessingFilter:setDefaultTargetUrl(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.security.AuthenticationProcessingFilter
    //#    method: void onPreAuthentication(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void net.sourceforge.pebble.security.AuthenticationProcessingFilter:setDefaultTargetUrl(String)
    //#input(void onPreAuthentication(HttpServletRequest, HttpServletResponse)): request
    //#input(void onPreAuthentication(HttpServletRequest, HttpServletResponse)): response
    //#input(void onPreAuthentication(HttpServletRequest, HttpServletResponse)): this
    //#pre[1] (void onPreAuthentication(HttpServletRequest, HttpServletResponse)): request != null
    super.onPreAuthentication(request, response);
    //#authenticationprocessingfilter.java:39: Warning: method not available
    //#    -- call on void org.acegisecurity.ui.webapp.AuthenticationProcessingFilter:onPreAuthentication(HttpServletRequest, HttpServletResponse)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.security.AuthenticationProcessingFilter
    //#    method: void onPreAuthentication(HttpServletRequest, HttpServletResponse)
    //#    unanalyzed callee: void org.acegisecurity.ui.webapp.AuthenticationProcessingFilter:onPreAuthentication(HttpServletRequest, HttpServletResponse)
  }
    //#authenticationprocessingfilter.java:40: end of method: void net.sourceforge.pebble.security.AuthenticationProcessingFilter.onPreAuthentication(HttpServletRequest, HttpServletResponse)

}    //#authenticationprocessingfilter.java:: end of class: net.sourceforge.pebble.security.AuthenticationProcessingFilter
