/*
 * $Id$
 * $URL$
 */

package org.subethamail.web.action.auth;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.subethamail.web.Backend;
import org.tagonist.RedirectException;

/**
 * If the user is logged in, issue a redirect to the
 * destination specified by actionParam "dest".  If
 * dest is not supplied, defaults to /home.jsp.
 * 
 * An auto login will occur if proper cookies are available.
 * 
 * @author Jeff Schnitzer
 */
public class AuthRedirect extends AutoLogin 
{
	/** */
	@SuppressWarnings("unused")
	private static Log log = LogFactory.getLog(AuthRedirect.class);
	
	/**
	 */
	protected void execute2() throws Exception
	{
		if (this.isLoggedIn())
		{
			String loc = null;
			String siteUrl = Backend.instance().getAdmin().getDefaultSiteUrl().toString();
			if ("http://needsconfiguration/se/".equals(siteUrl))
				loc = this.getCtx().getRequest().getContextPath();
			else
				loc = siteUrl;

			String redir = this.getActionParam("dest");
			if (redir != null)
				loc = loc + redir;
			else
				loc = loc + "/home.jsp";

			throw new RedirectException(this.getCtx().getResponse().encodeRedirectURL(loc));
		}
	}
}

@@ -158,45 +158,8 @@
 y;%0D%0A
-import org.subethamail.web.Backend;%0D%0A
 impo
@@ -714,258 +714,8 @@
 %09%7B%0D%0A
-%09%09%09String loc = null;%0D%0A%09%09%09String siteUrl = Backend.instance().getAdmin().getDefaultSiteUrl().toString();%0D%0A%09%09%09if (%22http://needsconfiguration/se/%22.equals(siteUrl))%0D%0A%09%09%09%09loc = this.getCtx().getRequest().getContextPath();%0D%0A%09%09%09else%0D%0A%09%09%09%09loc = siteUrl;%0D%0A%0D%0A
 %09%09%09S
@@ -789,25 +789,42 @@
 %09%09%09%09
-loc = loc + 
+throw new RedirectException(
 redir
+)
 ;%0D%0A%09
@@ -836,39 +836,8 @@
 e%0D%0A%09
-%09%09%09loc = loc + %22/home.jsp%22;%0D%0A%0D%0A
 %09%09%09t
@@ -863,16 +863,24 @@
 ception(
+%0D%0A%09%09%09%09%09%09
 this.get
@@ -921,11 +921,75 @@
 URL(
-loc
+%0D%0A%09%09%09%09%09%09%09%09this.getCtx().getRequest().getContextPath() + %22/home.jsp%22
 ));%0D

revert url redirection changes i made as it causes jeff problems.