NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Mike Grigsby on December 13, 2007, 12:57:55 PM
-
I'm using as the basis for my web app, the Basic login example.
I wanted to collect the User ID and password, then get the user from the User table, and based on their security level, give them either an administrators page, or a page to view records.
I tried to set the 'URL on save' based on the security level, but realized after about 4 hours of trying to trick the system into sending the user to the right URL, that the 'URL on save' is already set before the form is even validated.
Anyone have any simple recommendations on how to do redirect the user to the right page. If it's too complex, maybe a conditional URL on save could be added to the template.
-
Well, I figured out a way to do it, but it wasn't easy for this novice.
Using Philippe's example with javascript as the basis (http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=240.msg828#new)
... I simply used what he had, but instead of adding code to the "body" routine, I left it blank so it gets generated. Then, before the part where that routine's code is generated, I did a simple case statement:
CASE p_web.GetSessionValue('LLVL')
OF 1
packet = clip(packet) & |
'<<body onload="load1()" ><13,10>'&|
'<</body><13,10>'&|
''
OF 2
packet = clip(packet) & |
'<<body onload="load2()" ><13,10>'&|
'<</body><13,10>'&|
''
END !Case
Then, as you can imagine, I simply added two functions instead of the one:
<script type="text/javascript">
function load1()
{
window.location="ListRequisitions"
}
function load2()
{
window.location="HomePage"
}
</script>
The reason I was doing it this way is because I was not finding the SetCookie stuff to be persistent for some reason, so I used session values instead. It would be nice to have this in a template though.
-
Mike ,
Have you looked at controlling access to pages via a condition in a menu?
I have a site where the customer needed different employees to have access to different features. I found the easiest way for me to do this was use a condition in a menu to allow access to differnet pages such as "accesslevel > 1 AND clienttype = owner" . this gave access to the dealership owner so he could admin orders while restricting others to mostly a read only capability.
Just a thought,
Regards,
Gregg Matteson
-
I do limit menu choices for various users. The problem I was encountering was the landing page after the employee has logged in though. For example, if they log in and the landing page requires a certain access level that the user doesn't require, I'm not sure what he result would be... the cancel page? I hadn't tried that, but I'm not sure it would work.
-
If the landing page has a menu with the appropriate menu items exposed doesn't that take care of itself?
Regards,
Gregg Matteson
-
Mike,
If you want to see an example of what I'm talking about email me.
glmcps at comcast dot net