I would like to how does the below script works. I am trying to implement a pop up for every hr to give user an option to continue else it will get logged out automatically. It is working but my doubt is what will happen when multiple users login. will others get logged out when u press logout in your page? To be specific will
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.stop(taskPoll);
stop the taskPoll of the current script ?
<script>
var counter = 3600;
var counter1 = 20;
var taskPoll =
{
run: function()
{
counter -= 1;
if( counter < 1 )
{
Ext.TaskMgr.stop(taskPoll);
countDownComplete();
return false;
}
else
{
}
},
interval:1000
}
countDownComplete = function()
{
var taskPoll1 =
{
run: function()
{
counter1 -= 1;
if( counter1 < 1 )
{
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.stop(taskPoll);
// Ext.TaskMgr.stopAll();
logout('imagelogout');
return false;
}
else
{
Ext.MessageBox.updateText('You will be logged out in next <b>' + counter1+' </b> seconds. Please click on <b> Continue </b> if you do not wish to be logged out.');
}
},
interval:1000
}
Ext.MessageBox.maxWidth=420;
Ext.MessageBox.buttonText.yes = 'Continue';
Ext.MessageBox.buttonText.no = 'LogOut';
Ext.MessageBox.confirm('Attention', 'You will be logged out in next 30 seconds. Please click on <b> Continue </b> if you do not wish to be logged out.',
function(btn)
{
if(btn == 'yes')
{
counter=3600;
counter1=20;
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.start(taskPoll);
return false;
}
else
{
Ext.TaskMgr.stop(taskPoll1);
Ext.TaskMgr.stop(taskPoll);
// Ext.TaskMgr.stopAll();
logout('imagelogout');
return false;
}
});
Ext.TaskMgr.start(taskPoll1);
}
// Ext.TaskMgr.start(taskPoll); is the starting point of timeout Pop up
Ext.TaskMgr.start(taskPoll);
</script>
You are talking about a frontend script which runs locally... And I don't know any site where multiple users stays logged in on a single site, so where is the multiuserproblem?
Talking about scope & tasks: For that case I would recommend you to destroy all all task on logout and create new on start, otherwise you may get problems with still running tasks.