You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Chris Joelly <ch...@unycom.com> on 2004/04/21 16:05:19 UTC

preventing users from logging in twice to turbine app

Hello!

i want to prevent users from logging in to a turbine app twice so i
derived the class org.apache.turbine.modules.actions.LoginUser as
follows:

package com.comp.stuff.modules.actions;

import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.apache.turbine.modules.actions.LoginUser;
import org.apache.turbine.om.security.TurbineUser;
import org.apache.turbine.services.session.TurbineSession;
import org.apache.turbine.util.RunData;
import org.apache.turbine.util.security.TurbineSecurityException;

public class APLoginUser extends LoginUser {
    
    public void doPerform(RunData data)
                throws TurbineSecurityException
    {
        String username = data.getParameters().getString(CGI_USERNAME, "");

        if (StringUtils.isEmpty(username)) {
            return;
        }
        
        try {
            Collection users = TurbineSession.getActiveUsers();
            Iterator i = users.iterator();
            
            while (i.hasNext()) {
                TurbineUser user = (TurbineUser) i.next();
                if (user.getName().equals(username)) {
                    return;
                }
            }
        }
        catch (Exception e) {
            return;
        }
        
        super.doPerform(data);
    }
}

when i use the APLoginUser action class for app login i check if the
user is already an active user, if he is not an active user then i call
the doPerform of the LoginUser object. The login is ok, but turbine
displays the login screen Login.vm again, only when i login one more
time then turbine displays the index screen Index.vm as expected.

why does turbine display the login screen again? 

thx, Chris

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

"Das Schwein trägt seinen Namen nicht umsonst" - Stilblüten aus
Kinderaufsätzen: (Musik)

Im Radio kommt oft ein Konzert von Antante und Allegro.


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: preventing users from logging in twice to turbine app

Posted by David Demner <tu...@demner.com>.
Hi Chris,

Well, I guess you could replace it with one line:

return (data.getUser().hasLoggedIn() || super.isAuthorized(data));

Or consider not extending SecureScreen from your Index screen class (maybe
if a user isn't logged in they can view the screen) and handle more in your
template rather than the screen class?

But if it works, elegance is secondary ;)

David

-----Original Message-----
From: Chris Joelly [mailto:chris.joelly@unycom.com] 
Sent: Thursday, April 22, 2004 7:30 AM
To: Turbine Users List
Subject: Re: preventing users from logging in twice to turbine app


Hello David!

i thought that the user is already logged in when i do a
super.doPerform(data)
in my LoginUser class (which is inherited from turbines LoginUser) where the
user actually logges in, but as i looked further i saw that the ACL for
that user has not been set. and the isAuthorized method in SecureScreen
checks for a ACL. in my case it then redirects me back to Login.vm even
though the user was already logged in...

so i override the isAuthorized method of my screen class to bypass this
issue ...

protected boolean isAuthorized( RunData data )  throws Exception
{
	boolean isAuthorized;
	
	if (data.getUser().hasLoggedIn()) {
		isAuthorized = true;
	}
	else {
		
		isAuthorized = super.isAuthorized(data);
	} 

	return isAuthorized;
}


maybe there's a more elegant way to handle this?

thx, Chris

Am Thu, Apr 22, 2004 at 06:56:13AM -0700, David Demner meinte:
> 
> Does your com.comp.portal.modules.screens.Index class extend SecureScreen
> from the TDK?  If so, maybe this is causing the problem?  In this, if the
> user isn't logged (or part of the proper group) the user is redirected
back
> to Login.vm.  If you didn't start with the tdk but you still extend
> VelocitySecureAction, check your isAuthorized anyway to make sure it isn't
> doing anything unexpected.

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

[Toplevel-Domain DDR?]

Die Topleveldomain lautete .DD.  Allerdings war diese nur reserviert
und es gab NIE einen aktiven Nameserver für .DD oder irgendwelche
Einträge für .DD.
		-- Heiko Schlichting in de.admin.misc


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: preventing users from logging in twice to turbine app

Posted by Chris Joelly <ch...@unycom.com>.
Hello David!

i thought that the user is already logged in when i do a super.doPerform(data)
in my LoginUser class (which is inherited from turbines LoginUser) where the
user actually logges in, but as i looked further i saw that the ACL for
that user has not been set. and the isAuthorized method in SecureScreen
checks for a ACL. in my case it then redirects me back to Login.vm even
though the user was already logged in...

so i override the isAuthorized method of my screen class to bypass this
issue ...

protected boolean isAuthorized( RunData data )  throws Exception
{
	boolean isAuthorized;
	
	if (data.getUser().hasLoggedIn()) {
		isAuthorized = true;
	}
	else {
		
		isAuthorized = super.isAuthorized(data);
	} 

	return isAuthorized;
}


maybe there's a more elegant way to handle this?

thx, Chris

Am Thu, Apr 22, 2004 at 06:56:13AM -0700, David Demner meinte:
> 
> Does your com.comp.portal.modules.screens.Index class extend SecureScreen
> from the TDK?  If so, maybe this is causing the problem?  In this, if the
> user isn't logged (or part of the proper group) the user is redirected back
> to Login.vm.  If you didn't start with the tdk but you still extend
> VelocitySecureAction, check your isAuthorized anyway to make sure it isn't
> doing anything unexpected.

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

[Toplevel-Domain DDR?]

Die Topleveldomain lautete .DD.  Allerdings war diese nur reserviert
und es gab NIE einen aktiven Nameserver für .DD oder irgendwelche
Einträge für .DD.
		-- Heiko Schlichting in de.admin.misc


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: preventing users from logging in twice to turbine app

Posted by David Demner <tu...@demner.com>.
<large snip>

Hi Chris,

Does your com.comp.portal.modules.screens.Index class extend SecureScreen
from the TDK?  If so, maybe this is causing the problem?  In this, if the
user isn't logged (or part of the proper group) the user is redirected back
to Login.vm.  If you didn't start with the tdk but you still extend
VelocitySecureAction, check your isAuthorized anyway to make sure it isn't
doing anything unexpected.

Good luck,

David



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: preventing users from logging in twice to turbine app

Posted by Chris Joelly <ch...@unycom.com>.
Hello again!

i have debugged inside turbine and found the following thing i don't
really understand.

the check if a user is already logged in works as i would like it to do,
but the redirection to the Index.vm screen unfortunately does not. as i
can see in the logs the screen turbine wants to redirect me to is
Index.vm after a successfull login, but then turbine set the screen to
Login.vm again:

DefaultPage.java, line 187 (cvs: 1.10):

// If the Layout has been set to be null, attempt to execute
// the Screen that has been defined.
if (layout != null)
{
	LayoutLoader.getInstance().exec(data, layout);
}
else
{
	ScreenLoader.getInstance().exec(data, screenName);
}

logfile:

[DEBUG] LayoutLoader - -Loading Layout VelocityOnlyLayout from the Assembler Broker
[DEBUG] JavaLayoutFactory - -Class Fragment is VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Trying com.comp.portal.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -com.comp.portal.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Returning: org.apache.turbine.modules.layouts.VelocityOnlyLayout@e6f711
[DEBUG] VelocityOnlyLayout - -Loading Screen Index
[DEBUG] ScreenLoader - -Loading Screen Index from the Assembler Broker
[DEBUG] JavaScreenFactory - -Class Fragment is Index
[DEBUG] JavaScreenFactory - -Trying com.comp.portal.modules.screens.Index
[DEBUG] JavaScreenFactory - -Returning: com.comp.portal.modules.screens.Index@16686c8

HERE comes the Login.vm screen for some reason ...

[DEBUG] LayoutTemplateMapper - -doMapping(Login.vm)
[DEBUG] LayoutTemplateMapper - -templateName is Login.vm
[DEBUG] LayoutTemplateMapper - -templatePackage is now: 
[DEBUG] LayoutTemplateMapper - -Looking for layouts/Login.vm
[DEBUG] LayoutTemplateMapper - -Found it, returning Login.vm
[DEBUG] DefaultTurbineRunData - -getCharSet()
[DEBUG] DefaultTurbineRunData - -Charset was null!
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] ServerData - -Constructor(null, 80, http, null, null)
[DEBUG] ServerData - -setServerName(null)
[DEBUG] ServerData - -setServerPort(80)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(null)
[DEBUG] ServerData - -setContextPath(null)
[DEBUG] BaseURI - -init(http://ws.comp.com:8080/portal/ap)
[DEBUG] ServerData - -clone()
[DEBUG] ServerData - -Copy Constructor(http://ws.comp.com:8080/portal/ap)
[DEBUG] ServerData - -setServerName(ws.comp.com)
[DEBUG] ServerData - -setServerPort(8080)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(/ap)
[DEBUG] ServerData - -setContextPath(/portal)
[DEBUG] ServerData - -setScriptName(resources/ui/skins/default/images/1x1_blank.gif)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://ws.comp.com:8080/portal/resources/ui/skins/default/images/1x1_blank.gif
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] VelocityOnlyLayout - -Now trying to render layout Login.vm
[DEBUG] DefaultTurbineRunData - -getCharSet()
[DEBUG] DefaultTurbineRunData - -Charset was null!
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] ServerData - -setScriptName(style_IE5_sap.css)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://ws.comp.com:8080/portal/style_IE5_sap.css
[DEBUG] ServerData - -setScriptName(scripts.js)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://ws.comp.com:8080/portal/scripts.js

...

i don't know whats going wrong and where to look. why does turbine switch to the
Login.vm screen back again?

when i, after turbine displays the Login.vm screen again, hit the browsers reload button the same
APLoginUser action was called and now the correct Index.vm screen is displayed as you can see in
this log messages:

[DEBUG] LayoutLoader - -Loading Layout VelocityOnlyLayout from the Assembler Broker
[DEBUG] JavaLayoutFactory - -Class Fragment is VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Trying com.unycom.aportal.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -com.unycom.aportal.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Returning: org.apache.turbine.modules.layouts.VelocityOnlyLayout@1ec6b9
[DEBUG] VelocityOnlyLayout - -Loading Screen Index
[DEBUG] ScreenLoader - -Loading Screen Index from the Assembler Broker
[DEBUG] JavaScreenFactory - -Class Fragment is Index
[DEBUG] JavaScreenFactory - -Trying com.unycom.aportal.modules.screens.Index
[DEBUG] JavaScreenFactory - -Returning: com.unycom.aportal.modules.screens.Index@88a80e
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=18 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=5 ms
[DEBUG] DefaultTurbineRunData - -getCharSet()
[DEBUG] DefaultTurbineRunData - -Charset was null!
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] ServerData - -Constructor(null, 80, http, null, null)
[DEBUG] ServerData - -setServerName(null)
[DEBUG] ServerData - -setServerPort(80)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(null)
[DEBUG] ServerData - -setContextPath(null)
[DEBUG] BaseURI - -init(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -clone()
[DEBUG] ServerData - -Copy Constructor(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -setServerName(uny-ws-30.unycom.com)
[DEBUG] ServerData - -setServerPort(8080)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(/ap)
[DEBUG] ServerData - -setContextPath(/aportal)
[DEBUG] ServerData - -setScriptName(resources/ui/skins/default/images/header_diagonale.gif)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://uny-ws-30.unycom.com:8080/aportal/resources/ui/skins/default/images/header_diagonale.gif

[DEBUG] LayoutLoader - -Loading Layout VelocityOnlyLayout from the Assembler Broker
[DEBUG] JavaLayoutFactory - -Class Fragment is VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Trying com.unycom.aportal.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -com.unycom.aportal.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Returning: org.apache.turbine.modules.layouts.VelocityOnlyLayout@1ec6b9
[DEBUG] VelocityOnlyLayout - -Loading Screen Index
[DEBUG] ScreenLoader - -Loading Screen Index from the Assembler Broker
[DEBUG] JavaScreenFactory - -Class Fragment is Index
[DEBUG] JavaScreenFactory - -Trying com.unycom.aportal.modules.screens.Index
[DEBUG] JavaScreenFactory - -Returning: com.unycom.aportal.modules.screens.Index@88a80e
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=18 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=5 ms
[DEBUG] DefaultTurbineRunData - -getCharSet()
[DEBUG] DefaultTurbineRunData - -Charset was null!
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] ServerData - -Constructor(null, 80, http, null, null)
[DEBUG] ServerData - -setServerName(null)
[DEBUG] ServerData - -setServerPort(80)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(null)
[DEBUG] ServerData - -setContextPath(null)
[DEBUG] BaseURI - -init(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -clone()
[DEBUG] ServerData - -Copy Constructor(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -setServerName(uny-ws-30.unycom.com)
[DEBUG] ServerData - -setServerPort(8080)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(/ap)
[DEBUG] ServerData - -setContextPath(/aportal)
[DEBUG] ServerData - -setScriptName(resources/ui/skins/default/images/header_diagonale.gif)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://uny-ws-30.unycom.com:8080/aportal/resources/ui/skins/default/images/header_diagonale.gif

[DEBUG] LayoutLoader - -Loading Layout VelocityOnlyLayout from the Assembler Broker
[DEBUG] JavaLayoutFactory - -Class Fragment is VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Trying com.unycom.aportal.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -com.unycom.aportal.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Returning: org.apache.turbine.modules.layouts.VelocityOnlyLayout@1ec6b9
[DEBUG] VelocityOnlyLayout - -Loading Screen Index
[DEBUG] ScreenLoader - -Loading Screen Index from the Assembler Broker
[DEBUG] JavaScreenFactory - -Class Fragment is Index
[DEBUG] JavaScreenFactory - -Trying com.unycom.aportal.modules.screens.Index
[DEBUG] JavaScreenFactory - -Returning: com.unycom.aportal.modules.screens.Index@88a80e
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=18 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=5 ms
[DEBUG] DefaultTurbineRunData - -getCharSet()
[DEBUG] DefaultTurbineRunData - -Charset was null!
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] ServerData - -Constructor(null, 80, http, null, null)
[DEBUG] ServerData - -setServerName(null)
[DEBUG] ServerData - -setServerPort(80)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(null)
[DEBUG] ServerData - -setContextPath(null)
[DEBUG] BaseURI - -init(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -clone()
[DEBUG] ServerData - -Copy Constructor(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -setServerName(uny-ws-30.unycom.com)
[DEBUG] ServerData - -setServerPort(8080)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(/ap)
[DEBUG] ServerData - -setContextPath(/aportal)
[DEBUG] ServerData - -setScriptName(resources/ui/skins/default/images/header_diagonale.gif)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://uny-ws-30.unycom.com:8080/aportal/resources/ui/skins/default/images/header_diagonale.gif

[DEBUG] LayoutLoader - -Loading Layout VelocityOnlyLayout from the Assembler Broker
[DEBUG] JavaLayoutFactory - -Class Fragment is VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Trying com.unycom.aportal.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -com.unycom.aportal.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -org.apache.turbine.flux.modules.layouts.VelocityOnlyLayout: Not found
[DEBUG] JavaLayoutFactory - -Trying org.apache.turbine.modules.layouts.VelocityOnlyLayout
[DEBUG] JavaLayoutFactory - -Returning: org.apache.turbine.modules.layouts.VelocityOnlyLayout@1ec6b9
[DEBUG] VelocityOnlyLayout - -Loading Screen Index
[DEBUG] ScreenLoader - -Loading Screen Index from the Assembler Broker
[DEBUG] JavaScreenFactory - -Class Fragment is Index
[DEBUG] JavaScreenFactory - -Trying com.unycom.aportal.modules.screens.Index
[DEBUG] JavaScreenFactory - -Returning: com.unycom.aportal.modules.screens.Index@88a80e
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=4 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=18 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID, TURBINE_ROLE.ROLE_NAME, TURBINE_ROLE.OBJECTDATA, UPPER(TURBINE_ROLE.ROLE_NAME) FROM TURBINE_ROLE ORDER BY UPPER(TURBINE_ROLE.ROLE_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_ROLE.ROLE_ID FROM TURBINE_ROLE WHERE TURBINE_ROLE.ROLE_NAME='turbine_root'
[DEBUG] BasePeer - -Elapsed time=3 ms
[DEBUG] BasePeer - -SELECT TURBINE_PERMISSION.PERMISSION_ID, TURBINE_PERMISSION.PERMISSION_NAME, TURBINE_PERMISSION.OBJECTDATA, UPPER(TURBINE_PERMISSION.PERMISSION_NAME) FROM TURBINE_PERMISSION, TURBINE_ROLE_PERMISSION WHERE TURBINE_ROLE_PERMISSION.ROLE_ID=1 AND TURBINE_ROLE_PERMISSION.PERMISSION_ID=TURBINE_PERMISSION.PERMISSION_ID ORDER BY UPPER(TURBINE_PERMISSION.PERMISSION_NAME) ASC
[DEBUG] BasePeer - -Elapsed time=5 ms
[DEBUG] DefaultTurbineRunData - -getCharSet()
[DEBUG] DefaultTurbineRunData - -Charset was null!
[DEBUG] DefaultTurbineRunData - -getDefaultCharSet()
[DEBUG] DefaultTurbineRunData - -Returning default Charset of ISO-8859-1
[DEBUG] ServerData - -Constructor(null, 80, http, null, null)
[DEBUG] ServerData - -setServerName(null)
[DEBUG] ServerData - -setServerPort(80)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(null)
[DEBUG] ServerData - -setContextPath(null)
[DEBUG] BaseURI - -init(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -clone()
[DEBUG] ServerData - -Copy Constructor(http://uny-ws-30.unycom.com:8080/aportal/ap)
[DEBUG] ServerData - -setServerName(uny-ws-30.unycom.com)
[DEBUG] ServerData - -setServerPort(8080)
[DEBUG] ServerData - -setServerScheme(http)
[DEBUG] ServerData - -setScriptName(/ap)
[DEBUG] ServerData - -setContextPath(/aportal)
[DEBUG] ServerData - -setScriptName(resources/ui/skins/default/images/header_diagonale.gif)
[DEBUG] BaseURI - -No Response Object!
[DEBUG] BaseURI - -encodeResponse():  http://uny-ws-30.unycom.com:8080/aportal/resources/ui/skins/default/images/header_diagonale.gif

...

maybe anybody has an idea whats going wrong ...

thx, Chris

Am Wed, Apr 21, 2004 at 04:05:19PM +0200, Chris Joelly meinte:
> Hello!
> 
> i want to prevent users from logging in to a turbine app twice so i
> derived the class org.apache.turbine.modules.actions.LoginUser as
> follows:
> 
> package com.comp.stuff.modules.actions;
> 
> import java.util.Collection;
> import java.util.Iterator;
> 
> import org.apache.commons.lang.StringUtils;
> import org.apache.turbine.modules.actions.LoginUser;
> import org.apache.turbine.om.security.TurbineUser;
> import org.apache.turbine.services.session.TurbineSession;
> import org.apache.turbine.util.RunData;
> import org.apache.turbine.util.security.TurbineSecurityException;
> 
> public class APLoginUser extends LoginUser {
>     
>     public void doPerform(RunData data)
>                 throws TurbineSecurityException
>     {
>         String username = data.getParameters().getString(CGI_USERNAME, "");
> 
>         if (StringUtils.isEmpty(username)) {
>             return;
>         }
>         
>         try {
>             Collection users = TurbineSession.getActiveUsers();
>             Iterator i = users.iterator();
>             
>             while (i.hasNext()) {
>                 TurbineUser user = (TurbineUser) i.next();
>                 if (user.getName().equals(username)) {
>                     return;
>                 }
>             }
>         }
>         catch (Exception e) {
>             return;
>         }
>         
>         super.doPerform(data);
>     }
> }
> 
> when i use the APLoginUser action class for app login i check if the
> user is already an active user, if he is not an active user then i call
> the doPerform of the LoginUser object. The login is ok, but turbine
> displays the login screen Login.vm again, only when i login one more
> time then turbine displays the index screen Index.vm as expected.
> 
> why does turbine display the login screen again? 
> 
> thx, Chris
> 

-- 
mit freundlichen Grüßen / with kind regards
 
Ing. Christian Jölly @ Solutions
unycom  Information Technology Services GmbH
A-8042 Graz | Schmiedlstraße 1 / III

Tel: ++43 (0)316 / 818 828 - 30
Fax: ++43 (0)316 / 818 828 - 38
chris.joelly@unycom.com
http://www.unycom.com

Ich habe in der Vergangenheit gute Entscheidungen getroffen,
und ich habe in der Zukunft gute Entscheidungen getroffen.
		-- George W. Bush


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org