Forum OpenACS Development: Re: returning to a url after execution of auth::require_login

I tried to reproduce the problem with the form/script below (placed in www), but everything works correctly for me with the HEAD version (in logged-in and logged-out state). Can you check the results with this script on your installation?

Form:

<html> <head><title>Iuri form</title></head>
<body>
<h1>Enter some values</h1>
<form action="/iuri.tcl" method="POST">
<input type="string" name="op" value="a">
<input type="string" name="period" value="b">
<input type="submit">
</form>
</body> </html>

Script (iuri.tcl):

auth::require_login
ns_return 200 text/plain [export_entire_form_as_url_vars]

Result (in browser):

op=a&period=b
Hi Gustaf

thanks for this. I mentioned in another comment that we have the kernel parameter RegisterRestrictEntireServerToRegisteredUsersFilters set to 1. In our case, when I place your script in a directory under /packages, it loses the form parameters when logged out i.e. after logging back in, it redirects to iuri.tcl? (with no params).

I tried this too in a recent OpenACS version, with RegisterRestrictEntireServerToRegisteredUsersFilters set to 1, and I still get the problem.

regards
Brian

Hi Brian,

Sorry for delay. Here's the piece of code (palliative) that I added to my script in order to make it work. (i.e. Passing arguments from one page to another, with login authentication in the middle)

ad_set_cookie -replace "t" -path "/" op $id
ad_set_cookie -replace "t" -path "/" period $period

Once that is executed in the previous page (before login auth), both variables are stored in the session. And later on, in the next page, and after login auth, I grab them and destroy the session

# Unset vars from sesssion
ad_unset_cookie op
ad_unset_cookie period

Gustaf,
Indeed, I need to upgrade my instance to the latest code. I haven't done it yet, because I forked a few notifications (to recover password and register confirmation), thus I need to replace them into a new custom pkg (outside acs-authentication).

Best wishes,
I