view MoinMoin/xmlrpc/RemoteScript.py @ 2374:629dea07759f

do not parse single-quoted page names as quoted fixes bugs with ['text_html'] being a link
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 12 Jul 2007 14:40:06 +0200
parents bb2e053067fb
children ea5383222f2f
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - Remote Script Execution Server part

    @copyright: 2006 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

from MoinMoin.script import MoinScript

def execute(xmlrpcobj, their_secret, argv):
    request = xmlrpcobj.request
    their_secret = xmlrpcobj._instr(their_secret)

    our_secret = request.cfg.remote_script_secret
    if not our_secret:
        return u"No password set"

    if our_secret != their_secret:
        return u"Invalid password"

    try:
        request.log("RemoteScript argv: %r" % argv)
        MoinScript(argv).run(showtime=0)
    except Exception, err:
        e = str(err)
        request.log(e)
        return xmlrpcobj._outstr(e)
    return xmlrpcobj._outstr(u"OK")