Forum OpenACS Development: Re: HEAD redirect to registration behavior is different/broken
- logout from the site
- browse to some page that requires a registered user by entering the url directly into the browser address field
- when presented with the login page, enter an unknown set of credentials
- the login form will be re-displayed with an error indication
- click the Register link and complete your registration
- upon registration completion, you should (old behavior) be redirected to the page that was initially requested (above).
This functionality is important because it allows an unregistered user to follow a link provided to him (say) in an email (invitation) message, register, and land on a page that requires that the requester be registered.
In fact, it would be much smoother if the requester did not have to click the Register link but was instead guided directly to the new registration page (as it has worked in previous releases). Anything to smooth the way for the unitiated is good IMO.
This message is also included as a comment to the bug I filed a few days back.
(a few messages have been exchanged through the bug tracker's "comment" mechanism, but I would like to continue the discussion here since the problem resolution may benefit others searching through the forums. When it's resolved, I'll summarize to the open bug.)
I've whittled the code down to the minimum required to illustrate the problem. The following used to work under both 4.x and 5.x. I turned debug off to make logging clearer.
The following short script goes into the /www/register/ directory.
#=========================================================== # This is a minimal illustration of the problem: # the second ns_log is never reached. set p "user-join-custom" ns_log notice "$p: before ad_maybe_redirect_for_registration" ad_maybe_redirect_for_registration ns_log notice "$p: after ad_maybe_redirect_for_registration" # more stuff... #===========================================================
Now, do the following:
- request http://yourserver/register/user-join-custom?group_id=552&invitation_code=1 (url vars to illustrate what I'm trying to accomplish)
- login as some existing user, or go ahead and register new. The failure occurs either way. I need it to work under both conditions.
- after login, you will land in /pvt/home
- check your server error log for the ns_log entries and you'll see that the first one appears. The second one doesn't.
[18/Oct/2003:20:51:04][20583.1080589904][-conn3-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1 [18/Oct/2003:20:51:04][20583.1080589904][-conn3-] Notice: user-join-custom: before ad_maybe_redirect_for_registration [18/Oct/2003:20:51:18][20583.1081093712][-conn4-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1 [18/Oct/2003:20:55:59][20583.1074716240][-sched-] Notice: Swept developer support information for 0 requests (103 nsv elements)