NetTalk Central

Author Topic: Force the user to login  (Read 3706 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Force the user to login
« on: April 09, 2009, 01:25:17 PM »
Hi,
For when the app logsout the user automatically I´ve added to some procs the following code:

IF p_web.GSV('login_id')=''
   LoginForm(p_web)
   RETURN
end

It works ok, but...

1- Is there any other way to check the session is out than cheking a session value?

2- If I want to add this code to all my pages except the LoginForm, in which WebHandler embed must I add the code?
I´ve tried in MakePage but weird things happened...

Thanks

Alberto
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Force the user to login
« Reply #1 on: April 09, 2009, 11:05:14 PM »
Hi Alberto,

you're doing this completely the wrong way.
On every page, browse and form, advanced tab, is an option
"must be logged in". If you tick this on, and the control is called as a page, then it will automatically redirect to the login screen.

If the control is _embedded_ on a page, then the control will be excluded, and no redirect will happen.

To know if a session is logged in use p_web.GetSessionLoggedIn()

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Force the user to login
« Reply #2 on: April 12, 2009, 01:34:20 PM »
Hi Bruce,
For some reazon this is not working, I will check it and let you know.

Thanks
Alberto
-----------
Regards
Alberto