Sending an alarm message to all logged-in users
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
Hi, Am So, den 17.10.2004 schrieb Dennis Allison um 17:52:
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
HTTP is stateless. There is no such thing like "logged in". Calls are only send from client to server, never the other way round. Thus, you cannot "send" something to all users. You can only put your information in place and hope it gets picked up by the user. Control the process of picking up by means of session. HTH Tino
On Oct 17, 2004, at 18:14, Tino Wildenhain wrote:
Hi,
Am So, den 17.10.2004 schrieb Dennis Allison um 17:52:
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
HTTP is stateless. There is no such thing like "logged in". Calls are only send from client to server, never the other way round. Thus, you cannot "send" something to all users.
One way to fake this out (as Tino already says, the concept of "logged in user" is kind of meaningless) would be to have a slot in your main template that would display something if... - the current visitor has sent valid login information for the request (meaning the user for the duration of the request is not "Anonymous User") - you fill some variable, maybe a property at the site root, or change a script that returns something, with your message. Those things can be tested for easily. jens
We have a fairly complex multi-frame presentation. As I indicated, I could do it by doing a test, but that's costly in our particular situation. I'm looking for something a bit lower overhead. On Sun, 17 Oct 2004, Jens Vagelpohl wrote:
On Oct 17, 2004, at 18:14, Tino Wildenhain wrote:
Hi,
Am So, den 17.10.2004 schrieb Dennis Allison um 17:52:
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
HTTP is stateless. There is no such thing like "logged in". Calls are only send from client to server, never the other way round. Thus, you cannot "send" something to all users.
One way to fake this out (as Tino already says, the concept of "logged in user" is kind of meaningless) would be to have a slot in your main template that would display something if...
- the current visitor has sent valid login information for the request (meaning the user for the duration of the request is not "Anonymous User")
- you fill some variable, maybe a property at the site root, or change a script that returns something, with your message.
Those things can be tested for easily.
jens
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
It is possible to have the clients browser poll the server for a message every N seconds. Your standard page template can include a small frame that calls a page containing an HTML reload directive. The reload would call a function for maintaining "logged in" state, and returning a page with messages, and another reload in N seconds command. Your concept of "Logged In" then becomes any user that still has your page open on their web browser - a user is no longer "logged in" when the server has not recorded such a request in the last N+1 seconds. The function could also check for any new server status or alarm messages and include them in the returned page, display status messages discreetly in the small frame, and alarm messages as a JavaScript popup window activated from an onLoad command on the returned page. One annoying side effect would be that some browsers play a CLICK noise whenever reloading a page, and this would happen every N seconds - although it might serve as a reminder to users that they have left themselves "logged in" to your system. :-) --Sean
-----Original Message----- From: zope-bounces@zope.org [mailto:zope-bounces@zope.org]On Behalf Of Dennis Allison Sent: Monday, October 18, 2004 12:20 AM To: Jens Vagelpohl Cc: Zope List Mailing Subject: Re: [Zope] Sending an alarm message to all logged-in users
We have a fairly complex multi-frame presentation. As I indicated, I could do it by doing a test, but that's costly in our particular situation. I'm looking for something a bit lower overhead.
On Sun, 17 Oct 2004, Jens Vagelpohl wrote:
On Oct 17, 2004, at 18:14, Tino Wildenhain wrote:
Hi,
Am So, den 17.10.2004 schrieb Dennis Allison um 17:52:
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
HTTP is stateless. There is no such thing like "logged in". Calls are only send from client to server, never the other way round. Thus, you cannot "send" something to all users.
One way to fake this out (as Tino already says, the concept of "logged in user" is kind of meaningless) would be to have a slot in your main template that would display something if...
- the current visitor has sent valid login information for the request (meaning the user for the duration of the request is not "Anonymous User")
- you fill some variable, maybe a property at the site root, or change a script that returns something, with your message.
Those things can be tested for easily.
jens
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Am Mo, den 18.10.2004 schrieb Dennis Allison um 6:19:
We have a fairly complex multi-frame presentation. As I indicated, I could do it by doing a test, but that's costly in our particular situation. I'm looking for something a bit lower overhead.
Well frames... you always shoot in the foot with them :) But no matter. If you want to do it via HTML, you have to put the message into a page which will be requested by the user the next time. If you cant do this, you should simply send your users an e-mail... Regards Tino
Many Zope sysems (ours included) use authentication and maintain session information. Logged in users are those for which we have session information and which we believe (for some reason) are still active. On Sun, 17 Oct 2004, Tino Wildenhain wrote:
Hi,
Am So, den 17.10.2004 schrieb Dennis Allison um 17:52:
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
HTTP is stateless. There is no such thing like "logged in". Calls are only send from client to server, never the other way round. Thus, you cannot "send" something to all users.
You can only put your information in place and hope it gets picked up by the user. Control the process of picking up by means of session.
HTH Tino
On Oct 18, 2004, at 6:17, Dennis Allison wrote:
Many Zope sysems (ours included) use authentication and maintain session information. Logged in users are those for which we have session information and which we believe (for some reason) are still active.
That's one of the ways to "fake out" this information. It still does not reflect the true "logged in users", but it's a useful approximation that works in most cases. But that still doesn't allow you to somehow contact them from the server. You won't get around coding something that adds your message to the page the next time a user requests one. jens
Hi, Am Mo, den 18.10.2004 schrieb Dennis Allison um 6:17:
Many Zope sysems (ours included) use authentication and maintain session information. Logged in users are those for which we have session information and which we believe (for some reason) are still active.
I wonder which userfolder and session management you use. The default of Zope2.6 and up opens sessions for anonymous users as well. However, no session management ever knows if a subsequent request by the user will happen. Needless to tell me about session management because I mentioned a 'solution' using sessions. Regards Tino
One approach you might try when a logged-in user requests a new page: If the alert condition exists (test) and a the user is logged-in (test), include some Javascript in the returned page to display the alert message. This could be a simple Alert box or a pop-up window. Cliff Dennis Allison wrote:
Many Zope sysems (ours included) use authentication and maintain session information. Logged in users are those for which we have session information and which we believe (for some reason) are still active.
On Sun, 17 Oct 2004, Tino Wildenhain wrote:
Hi,
Am So, den 17.10.2004 schrieb Dennis Allison um 17:52:
Occasionally I have wished for a mechanism that would allow me to write all logged-in users. Of course, this could be acomplished with an explicit test, but making the test costs a lot of overhead. Is there a better way?
HTTP is stateless. There is no such thing like "logged in". Calls are only send from client to server, never the other way round. Thus, you cannot "send" something to all users.
You can only put your information in place and hope it gets picked up by the user. Control the process of picking up by means of session.
HTH Tino
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (5)
-
Cliff Ford -
Dennis Allison -
Jens Vagelpohl -
Sean Hastings -
Tino Wildenhain