Forum OpenACS Development: ad_conn isconnected

Collapse
Posted by eivind aa on
Hi,

I am making a packet that is supposed to launch a Java applet if the user is currently logged into dotLRN. I thought maybe this variable was a boolean/integer which depended on whether a user was logged on or not. But when I just print the variable via the index.adp, I always get a "1".

Anyone who can help me?

Thanks for your time :)

Collapse
2: Re: ad_conn isconnected (response to 1)
Posted by Tom Jackson on

I think 'ad_conn isconnected' means you are in a connection thread. Check out http://zmbh.com/nsapi/ns_conn for the corresponding 'ns_conn isconnected'.

Collapse
3: Re: ad_conn isconnected (response to 1)
Posted by Tilmann Singer on
ad_conn isconnected checks wether the running code is being called from within a connected thread or a scheduled procedure that runs without a connection. If you want to check if the user is logged in use something like auth::get_user_id - if it returns 0 then the user is not logged in.