NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: walter.dasilva on November 10, 2014, 10:44:39 AM
-
Hi,
How to manage Main parameters if your application has a LoginForm?
i´m trying with IndexPage like this:
Clear(Ass:Record)
Ass:Codigo = p_web.GetValue('assid')
If Access:Associacao.TryFetch(Ass:PK_Associacao)
loc:Assid = 0
ELSE
loc:Assid = Ass:Codigo
END
p_web.SetValue('_parentPage','IndexPage')
If p_web.GetSessionLoggedIn() = 0
If p_web.site.LoginPageIsControl
p_web.MakePage(p_web.site.LoginPage)
else
p_web._SendFile(p_web.site.LoginPage)
End
Return <========= i didn't expect for this
End
if p_web.sessionId = '' then p_web.NewSession().
! Start of "Before Header"
! [Priority 5000]
p_web.SSV('global_brand',loc:assid)
Thanks
Walter - SOFTVALE
-
Hi Walter,
I'm not 100% sure what you are asking. Can you give us a bit more context?
In the code below, the RETURN is because the user is not yet logged in, and so needs to log in before they can access this page.
If you want to store p_web.GetValue('assid') for future use then use
p_web.StoreValue('assid') which moves the parameter into the Session Queue. (and hence in your code you would use
Ass:Codigo = p_web.GetSessionValue('assid')
cheers
Bruce
-
Hi Bruce,
In order to get the logo and smtp's configurations from customer table to show on HEADER, i want to pass a initial parameter to identify it.
Regards,
Walter - SOFTVALE
-
I believe my answer above explains how to do that using StoreValue.
cheers
Bruce
-
Hi Bruce,
i supposed it too, but i'm not sure if i did it right.
! Start of "Processed Code"
! [Priority 500]
Clear(Ass:Record)
If p_web.IfExistsValue('global_id')
loc:assid = p_web.GetValue('global_id')
ELSE
If p_web.IfExistsSessionValue('global_id')
loc:assid = p_web.GSV('global_id')
ELSE
loc:assid = 0
END
END
Ass:Codigo = loc:assid
If Access:Associacao.TryFetch(Ass:PK_Associacao)
p_web.SSV('global_id',0)
p_web.SSV('global_brand','images/logoVappcomerciosmal.jpg')
ELSE
p_web.SSV('global_id',Ass:Codigo)
p_web.SSV('global_brand',Ass:Logo)
END
p_web.StoreValue('global_id')
p_web.StoreValue('global_brand')
it is working 95% and it is ok for while.
Thanks
Walter - SOFTVALE
-
p_web.StoreValue('global_id')
p_web.StoreValue('global_brand')
loc:assid = p_web.GSV('global_id')
Ass:Codigo = loc:assid
If Access:Associacao.TryFetch(Ass:PK_Associacao)
p_web.SSV('global_id',0)
p_web.SSV('global_brand','images/logoVappcomerciosmal.jpg')
ELSE
p_web.SSV('global_id',Ass:Codigo)
p_web.SSV('global_brand',Ass:Logo)
END
-
Hummm... ]
Thanks
Walter - SOFTVALE