Turbine throws an error if the LogoutUser action is called on the Anynomous
user - the UserName is "null" . This happens e.g. on reload after logout.
The patch below verifies the the user is actually logged in.
ingo.
Index: LogoutUser.java
===================================================================
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/actions/LogoutUser.java,v
retrieving revision 1.6
diff -u -r1.6 LogoutUser.java
--- LogoutUser.java 2001/02/12 18:46:41 1.6
+++ LogoutUser.java 2001/02/15 10:30:50
@@ -89,13 +89,18 @@
public void doPerform( RunData data )
throws Exception
{
- data.setMessage(TurbineResources.getString("logout.message"));
+ User user = data.getUser();
- if ( data.getUser() != null )
+ if ( user != null )
{
- data.getUser().setHasLoggedIn(new Boolean(false) );
- TurbineSecurity.saveUser(data.getUser());
+ // Make sure that the user has really logged in...
+ if ( !user.hasLoggedIn() ) return;
+
+ user.setHasLoggedIn( new Boolean(false) );
+ TurbineSecurity.saveUser( user );
}
+
+ data.setMessage(TurbineResources.getString("logout.message"));
// This will cause the acl to be removed from the session in
// the Turbine servlet code.
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]