[Zope] Intercept request

David Chelimsky dchelimsky at gmail.com
Mon Jan 7 09:39:40 EST 2008


On Jan 7, 2008 8:35 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> On Jan 7, 2008 8:23 AM, Andreas Jung <lists at zopyx.com> wrote:
> >
> >
> > --On 7. Januar 2008 08:18:14 -0600 David Chelimsky <dchelimsky at gmail.com>
> > wrote:
> >
> > > On Jan 7, 2008 8:06 AM, Andreas Jung <lists at zopyx.com> wrote:
> > >> --On 7. Januar 2008 08:00:27 -0600 David Chelimsky <dchelimsky at gmail.com>
> > >> wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > I want to show different things to different viewers based on their IP
> > >> > addresses. How can I do this?
> > >>
> > >>
> > >> Basically you look at the clients ip address (from the REQUEST object)
> > >> and perform any action you need (redirections, conditions within scripts,
> > >> templates)...but no idea what the sense of this usecase is. If you have
> > >> different audiences, setup sites with different content or something
> > >> similar. In addition: using Zope behind proxy will lead in request coming
> > >> from the IP address of your reverse proxy. Additional
> > >> configuration/programming is necessary to get hold of the original IP.
> > >
> > > Thanks for the reply.
> > >
> > > The use case is that my client wants to block a range of IP addresses
> > > from being able to view their site.
> >
> > You have a firewall for this purpose or you use apache rewrite rules for
> > performing URL rewriting.
>
> Our host uses nginx, not apache. We can still do this w/ nginx
> configuration, but it means maintaining a configuration file rather
> than application code (which in my experience is more
> flexible/maintainable). Right now I'm just exploring options, so I'd
> still like to know how I can do this with Zope.

BTW - I'm using ZPT, not DTML. I'm guessing I can do this with a
simple script that I include on every page, yes? That could work, but
seems a bit error prone - that's why I'm looking for some sort of
request hook. But maybe that's my best option within Zope. Thoughts?

>
> Thanks,
> David
>
> >
> > -aj
> >
> >
>


More information about the Zope mailing list