NetTalk Central

Author Topic: How do I stop some users continuing using the server app until further notice ?  (Read 3293 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
I have a nettalk webserver app.
it has different types of users
eg. admin and general users
when certain processes have to be done, its important that no one can continue to update the database until processing is complete.
I have a global variable which an admin user can set to say siteclosed.
I check this in the login form and make sure no general user can signon while the variable is set.
But how do I intercept the next request from a general user that is allready signed on from not doing what they want.
I assume somewhere in the webhandler procedure
But where exactly and how do I notify them ?
 

MikeR

  • Sr. Member
  • ****
  • Posts: 257
    • View Profile
    • Email
Hi Bruce just a gentle reminder , yesterday on the webinar you said you would reply to this request when you have time

Matthew

  • Full Member
  • ***
  • Posts: 137
    • View Profile
    • Email
I am also interested of that problem, so I am waiting for any news of that topic.

Regards,
Matthew

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Hallo Mike,

I keep all active sessions in a table then I loop to session queue and take them out.... Or you can exclude yours and delete the rest.
After you run this code all active user at next request from the server will redirect them to login page.
Hope this will help you.


Code: [Select]

stt.Trace('wait server')
 p_web.requestdata.webserver._Wait()
 p_web.RequestData.Webserver._SessionQueue.SessionId = UTI:LastSessionID !This is your sessionID
 get(p_web.RequestData.Webserver._SessionQueue, p_web.RequestData.Webserver._SessionQueue.SessionId)
  if errorcode()
     stt.Trace(errorcode() &' '& error())
    ELSE        
    p_web.RequestData.Webserver._SessionQueue.LoggedIn=0
    put(p_web.RequestData.Webserver._SessionQueue, p_web.RequestData.Webserver._SessionQueue.LoggedIn)
    Z#=1
     !DELETE(p_web.RequestData.Webserver._SessionQueue)
  END

 p_web.requestdata.webserver._Release()