Re: [Zope] Re: VIRTUAL_URL Failure

2005-11-09 Thread George Lee
> I fear you fight a CookieCrumbler bug.

Vicious monsters, indeed.

Thanks for the REQUEST['URL'] tip. It's a pretty good workaround for
now, although not exactly right. If I am going to an object

http://here.org/object

with default page or default method "default", then REQUEST['URL'] equals

http://here.org/object/default

instead of

http://here.org/object

This works for purposes of redirecting after login but isn't exactly
what should happen. From what I recall browsing a few ACTUAL_URL, etc.
threads, this is one reason there's a difference between the few
different URL variables.

Also, I opened up a collector issue at
  http://www.zope.org/Collectors/CMF/393

Peace,
George


>
> The most natural "REQUEST['URL']" will give the correct value
> (as it gives what the primary HHTP cleint sees).
>
> --
> Dieter
>
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Re: VIRTUAL_URL Failure

2005-11-09 Thread Dieter Maurer
George Lee wrote at 2005-11-9 11:21 -0500:
> ... "request['ACTUAL_PATH']" ...
>This gives something like http://ip:port/path/to/subdomain though
>rather than http://subdomain.mydomain.org ... what if anything gives
>the latter?

I fear you fight a CookieCrumbler bug.

The most natural "REQUEST['URL']" will give the correct value
(as it gives what the primary HHTP cleint sees).

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: VIRTUAL_URL Failure

2005-11-09 Thread George Lee
> The correct thing to use in a recent Zope is REQUEST['ACTUAL_URL'].
>
> Florent


This gives something like http://ip:port/path/to/subdomain though
rather than http://subdomain.mydomain.org ... what if anything gives
the latter?


Peace,
George
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: VIRTUAL_URL Failure

2005-11-09 Thread Florent Guillaume

The correct thing to use in a recent Zope is REQUEST['ACTUAL_URL'].

Florent

George Lee wrote:

Two main questions:
  (1) Does anybody *have* good documentation on VIRTUAL_URL and how it
interacts with CookieCrumbler and VirtualHostMonster?
  (2) Does anyone know how to debug VirtualHostMonster or other Python
libraries while running a Zope instance (it lives in Python not in
Zope, so I don't know if I change the code there if those changes will
actually get executed)?



For people who care to read more about what I think is going on:



Well, where is VIRTUAL_URL documented? Why doesn't Plohn do something
sane if it's not there?



It's not Plone's issue from what I can tell. CookieCrumbler, which
lives in CMF, does do something sane if VIRTUAL_URL is not there -- it
tries to create a substitute URL.

VIRTUAL_URL is set by the VirtualHostMonster. Does anyone know how to
debug it? Because it is in the python directories used to build Zope,
not in a Zope product which I know how to debug. (Is there a way to
restart python to register changes in VirtualHostMonster.py)?

Here is what I can tell of what is going on:

(1) VIRTUAL_URL is supposed to return the actual URL when there is a
Virtual Hosting Monster, for instance http://subdomain.mydomain.org
instead of http://ip:port/path/to/subdomain/object or
http://mydomain.org/path/to/subdomain/object.

(2) There's an Apache rewrite rule set to transform URL requests like
http://subdomain.org to
http://ip:port/VirtualHostBase/http/subdomain.mydomain.org before they
get sent into Zope.

(3) When VirtualHostMonster receives a request like
http://ip:port/VirtualHostBase/http/subdomain.mydomain.org, it is
supposed to return the currect object at
http://ip:port/path/to/subdomain/object and set a variable VIRTUAL_URL
http://subdomain.mydomain.org in the REQUEST variable.

(4) When navigating to an authenticated-only page, CMFCore's
CookieCrumbler sets a "came_from" variable to remember where to go. To
set the "came_from" variable, it first looks for VIRTUAL_URL. If it
doesn't find it, it uses another method to set "came_from" -- but this
returns an URL, and one that does not work.

(5) During login in Plone to a authenticated-only page, it uses
CMFCore's CookieCrumbler came_from variable.







I'm wondering if CookieCrumbler is supposed
to set VIRTUAL_URL given that there's a VHM installed and doesn't?


It's probably some code in the publisher or vhm. Maybe it's something
that didn't get merged from a branch or the trunk.

Your best bet is to come up with minimal (ie: no plone, no cookie
crumbler, etc) way to reproduce this and file a bug report in the collector.

Oh, and grab yourself a copy of grep and see where this should be
defined ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
   - http://www.simplistix.co.uk




___
Zope maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce

 http://mail.zope.org/mailman/listinfo/zope-dev )




--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )