[Moin-user] I think I am approaching this wrong? -- Macro not working reliably...

Schollnick, Benjamin Benjamin.Schollnick at XEROX.COM
Mon Jul 31 09:57:35 EDT 2006


Folks,

I am running into a issue, that I can seemingly debug...

This Macro works fine in a PREVIEW, but when you browse normally to a
page with this macro, it acts as if it was cached somewhere (ie
application / moinmoin level?)....

Are macros cached in some manner?  Is there a better approach?

I am doing this simply because our proxy servers seem to take *minutes*
to return a page off the wiki.

The script is designed to place a notice on the website when the user is
browsing via one of our proxy servers.  It simply checks the
environmental REMOTE_ADDR against of a list of proxies and if it matches
it returns a rawHTML message, otherwise nothing...

# -*- coding: iso-8859-1 -*-

from MoinMoin.util import pysupport
from MoinMoin import user
from MoinMoin import wikiutil
import os
Dependencies = []
 
def execute(macro, args):
    output = []

    macro.request.http_headers(macro.request.nocache)
    remote_ip_name = os.environ["REMOTE_HOST"]
    remote_ip_address = os.environ["REMOTE_ADDR"]

    x = macro.formatter.rawHTML (" ")
    if (remote_ip_address in ["13.131.1.241", "13.131.1.242",
"13.131.1.243"]):
        x = macro.formatter.rawHTML ("<HR><B>You are currently using a
proxy server (%s)</B><HR>" % remote_ip_address)
    return x




More information about the Moin-user mailing list