A5v10 Web Application
I need the initial value of a form element to contain the logged in user's userid.
Following whatever I could find, I now have this as the initial value of that field:
<%A5 ?session.__protected__userid%>
Of course, this does not work. It displays nothing, or else it just displays the code, depending on how I use it.
Similarly, I have tested this in a random place on an .a5w page: "ME <%A5 ?session.__protected__userid%>" which also produces nothing. ("ME: ")
I have been also trying to use the following:
1) Login redirects to logincheck.a5w
2) logincheck.a5w contains only the following:
<%A5
DIM pUser as p
a5ws_logged_in_user_values(pUser,request,session)
if eval_valid("pUser.userid") = .T. then
session.__protected__userid = pUser.userid
response.redirect("AfterLoginPage.a5w")
end if
%>
With that setup, I was successfully redirected to the correct page, but I can't seem to grab that session variable anywhere, and trying to simply print it on that same logincheck.a5w page produces nothing, just as the other attempts did.
Here are my questions:
1) In which file can I find and modify the post-login stuff? By that I mean whatever A5 normally does with its standard login process ... where is the file that defines the AfterValidate and whatnot? Can I modify it? Searching my hard drive turns up no files that contain "AfterValidate", and neither does A5's internal search process.
2) What is the everyday procedure used by A5 afficianados to grab the logged in user info and use it? It must happen every day, in almost every web app, right? Where can I lay my hands on this information?
Thank you for your help.
I need the initial value of a form element to contain the logged in user's userid.
Following whatever I could find, I now have this as the initial value of that field:
<%A5 ?session.__protected__userid%>
Of course, this does not work. It displays nothing, or else it just displays the code, depending on how I use it.
Similarly, I have tested this in a random place on an .a5w page: "ME <%A5 ?session.__protected__userid%>" which also produces nothing. ("ME: ")
I have been also trying to use the following:
1) Login redirects to logincheck.a5w
2) logincheck.a5w contains only the following:
<%A5
DIM pUser as p
a5ws_logged_in_user_values(pUser,request,session)
if eval_valid("pUser.userid") = .T. then
session.__protected__userid = pUser.userid
response.redirect("AfterLoginPage.a5w")
end if
%>
With that setup, I was successfully redirected to the correct page, but I can't seem to grab that session variable anywhere, and trying to simply print it on that same logincheck.a5w page produces nothing, just as the other attempts did.
Here are my questions:
1) In which file can I find and modify the post-login stuff? By that I mean whatever A5 normally does with its standard login process ... where is the file that defines the AfterValidate and whatnot? Can I modify it? Searching my hard drive turns up no files that contain "AfterValidate", and neither does A5's internal search process.
2) What is the everyday procedure used by A5 afficianados to grab the logged in user info and use it? It must happen every day, in almost every web app, right? Where can I lay my hands on this information?
Thank you for your help.
Comment