/*
 * Copyright (C) 2004-2007  exedio GmbH (www.exedio.com)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.exedio.cope.util;

public final class EditorFilter extends Editor
{
	public EditorFilter()
	{
		super(EditedServlet.model);
	}
	
	@Override
	protected Login login(final String user, final String password)
	{
		if(password.equals(user+"1234"))
			return new Login()
			{
				public String getName()
				{
					return "editor login name '" + user + '\'';
				}
			};
		return null;
	}
}

@@ -828,16 +828,46 @@
 .util;%0A%0A
+import java.io.Serializable;%0A%0A
 public f
@@ -973,41 +973,140 @@
 %0A%09%0A%09
-@Override%0A%09protected Login login(
+private static class Login implements Editor.Login, Serializable%0A%09%7B%0A%09%09private static final long serialVersionUID = 1l;%0A%09%09%0A%09%09private 
 fina
@@ -1118,18 +1118,29 @@
 ing user
-, 
+;%0A%09%09%0A%09%09Login(
 final St
@@ -1148,85 +1148,46 @@
 ing 
-password
+user
 )%0A
+%09
 %09%7B%0A%09%09
+%09
-if(password.equals(user+%221234%22))%0A%09%09%09return new Login()%0A%09%09%09%7B%0A%09%09
+this.user = user;%0A%09%09%7D%0A%09%09%0A
 %09%09pu
@@ -1210,22 +1210,18 @@
 ame()%0A%09%09
-%09%09%7B%0A%09%09
+%7B%0A
 %09%09%09retur
@@ -1265,17 +1265,159 @@
 ;%0A%09%09
-%09%09%7D%0A%09%09%09%7D;
+%7D%0A%09%7D;%0A%09%0A%09@Override%0A%09protected Login login(final String user, final String password)%0A%09%7B%0A%09%09if(password.equals(user+%221234%22))%0A%09%09%09return new Login(user);%0A%09%09
 %0A%09%09r

make session serializable