NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: alex.kolaric on February 02, 2009, 05:00:58 AM

Title: Is there any way to display login screen on timeout automatically
Post by: alex.kolaric on February 02, 2009, 05:00:58 AM
Hi,

Is there any way to display login screen on timeout automatically on client side, even when user doesn't click on some page control. Basically what I need is to show login form in client browser as soon as timeout occurs.

thanks,
Alex
Title: Re: Is there any way to display login screen on timeout automatically
Post by: random69 on February 02, 2009, 04:38:22 PM
Hi Alex, I do that now using javascript and a timer. When it expires, it forces the location to the login page. Also shows the countdown in a span on all my pages when logged in.

Do a search for "countdown javascript".
Title: Re: Is there any way to display login screen on timeout automatically
Post by: alex.kolaric on February 02, 2009, 11:38:34 PM
Hi,

thanks for the tip.

cheers,
Alex
Title: Re: Is there any way to display login screen on timeout automatically
Post by: Alberto on February 03, 2009, 06:19:18 AM
Hi, I´ve been searching one but I cant find one that redirects to another page.
May you please post yours?
Thanks
Alberto
Title: Re: Is there any way to display login screen on timeout automatically
Post by: Johan de Klerk on February 04, 2009, 05:04:29 AM
Hi Alberto,

Since you first posted this I thought it would be a great idea to let the user know when the system will automatically log him out if he does not keep on working.

Below is the script that I found and then modified to work for me.
I use this one once the user has logged in and another one if he is not logged in.

I hope this helps you.

Regards

Johan de Klerk

<form name="counter">
    <p align="center">
    <input type="text" size="82" name="d2" style="font-weight: bold; border: 3px solid #FF0000; color:#FF0000; background-color:#FFFF00; text-align:center">
</form>
<script>
<!--
var seconds=60
var minutes = 1
document.counter.d2.value="If you do not work you will automatically be logged out in "+minutes+" minutes and "+seconds+" seconds."
function display(){
if (seconds<=0){
    seconds=60
    minutes-=1
}
if (minutes<0){
    seconds=0
    minutes=0
    window.open('http://www.dynamicdrive.com/forums/showthread.php?t=6138','_top');
}
else
    seconds-=1
    document.counter.d2.value="If you do not work you will automatically be logged out in "+minutes+" minutes and "+seconds+" seconds."
    setTimeout("display()",1000)
}
display()
-->
</script>