i'd like to realise the following: http://server.url/people/krafft should call the DTML or ZPT script at /people and pass it the value krafft. in a CGI, i could do this with PATH_INFO. in Zope, the only way I can imagine is place a custom standard_error_template into /people which then does the magic, but this is an ugly hack. http://server.url/people?user=krafft is not really acceptable... thanks. -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck keyserver problems? http://keyserver.kjsl.com/~jharris/keyserver.html get my key here: http://madduck.net/me/gpg/publickey the reason that every major university maintains a department of mathematicsis is that it's cheaper than institutionalizing all those people.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of martin f krafft Sent: Thursday, May 01, 2003 9:31 AM To: zope users Subject: [Zope] PATH_INFO available?
i'd like to realise the following:
http://server.url/people/krafft
should call the DTML or ZPT script at /people and pass it the value krafft. in a CGI, i could do this with PATH_INFO. in Zope, the only way I can imagine is place a custom standard_error_template into /people which then does the magic, but this is an ugly hack.
http://server.url/people?user=krafft
is not really acceptable...
This is typically done with a python script. Look for traverse_subpath docs. If you are feeling brave, you can write a product and play with __before_publishing_traverse__ or __bobo_traverse__ (probably the latter).
On Thursday 01 May 2003 09:58 am, Charlie Reiman wrote:
If you are feeling brave, you can write a product and play with __before_publishing_traverse__ or __bobo_traverse__ (probably the latter).
When do those get called? I have a product in which I have overloaded __getattr__ (yes, there's a good reason for this, I realize the dangers). However, I'm trying to add a feature that depends on details in the REQUEST, which doesn't seem to be available from the namespace .__getattr__() receives. Would catching __bobo_traverse__ let me catch the REQUEST before it gets that far, perhaps? Basically I want to examine HTTP_REFERER and then decide whether to continue processing, or bounce the request. It's a limited amount of defense (I realize a determined user could probably fake the HTTP_REFERER, but I'm really interested in catching unintentional abuses). Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Terry Hancock Sent: Thursday, May 01, 2003 1:05 PM To: Charlie Reiman Cc: zope@zope.org Subject: Re: [Zope] PATH_INFO available?
On Thursday 01 May 2003 09:58 am, Charlie Reiman wrote:
If you are feeling brave, you can write a product and play with __before_publishing_traverse__ or __bobo_traverse__ (probably the latter).
When do those get called?
Look them up in the Zope Developer Guide. I would just be copying and pasting.
Use AccessRules to do this. Or there is a product called Path Handler I believe from NIP that will do this for you. martin f krafft wrote:
i'd like to realise the following:
http://server.url/people/krafft
should call the DTML or ZPT script at /people and pass it the value krafft. in a CGI, i could do this with PATH_INFO. in Zope, the only way I can imagine is place a custom standard_error_template into /people which then does the magic, but this is an ugly hack.
http://server.url/people?user=krafft
is not really acceptable...
thanks.
also sprach Andy McKay <andy@agmweb.ca> [2003.05.01.1908 +0200]:
Use AccessRules to do this. Or there is a product called Path Handler I believe from NIP that will do this for you.
I tried to do that. I created a new folder /test, put a ZPT in there called dispatch which does nothing but show the request structure. Then I configured an access rule for that script in the folder, Now when I surf to /test/sub/dir, I get a 404. shouldn't it call dispatch? Or am I misunderstanding? Thanks, -- martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck keyserver problems? http://keyserver.kjsl.com/~jharris/keyserver.html get my key here: http://madduck.net/me/gpg/publickey you can't assign IP address 127.0.0.1 to the loopback adapter, because it is a reserved address for loopback devices. -- micro$oft windows xp professional
martin f krafft wrote:
also sprach Andy McKay <andy@agmweb.ca> [2003.05.01.1908 +0200]:
Use AccessRules to do this. Or there is a product called Path Handler I believe from NIP that will do this for you.
This is largely redundant with the handling that Python scripts and ZPT's do...
I tried to do that. I created a new folder /test, put a ZPT in there called dispatch which does nothing but show the request structure. Then I configured an access rule for that script in the folder, Now when I surf to /test/sub/dir, I get a 404. shouldn't it call dispatch? Or am I misunderstanding?
no, you should have: /test/dispatch/sub/dir cheers, Chris
participants (5)
-
Andy McKay -
Charlie Reiman -
Chris Withers -
martin f krafft -
Terry Hancock