<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3314.2100" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I don't know if this will solve your problem, but we use
command line cURL to invoke dtml routines (via http). You can use the
python 'commands' module to invoke cURL.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>HTH</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Jonathan</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:rubemontejano@yahoo.com" title=rubemontejano@yahoo.com>Ruben
Montejano</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A href="mailto:zope@zope.org"
title=zope@zope.org>zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> December 12, 2003 4:38 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] help external method and
security issue</DIV>
<DIV><BR></DIV>
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV> We are using a Python External Method to send a
"post" request to a dtml-method in</DIV>
<DIV>python using the httplib library. But it's not working because of the
security of the </DIV>
<DIV>method only allowes certain roles to access it. </DIV>
<DIV> </DIV>
<DIV> this is the code we are using:</DIV>
<DIV> </DIV>
<DIV> Args =
urllib.urlencode(Args)<BR> Scheme,
Host, Path, Parameters, Query, Frag =
urlparse.urlparse(ActionUrl)<BR>
</DIV>
<DIV> Contact =
httplib.HTTP(Host)<BR>
Contact.putrequest( "POST", Path
)<BR> Contact.putheader(
"Content-type", "application/x-www-form-urlencoded"
)<BR> Contact.putheader(
"Content-length", "%d" %len(Args)
)<BR> Contact.putheader( "Accept",
"text/plain" )<BR>
Contact.putheader( "Host", Host
)<BR>
Contact.endheaders()<BR>
Contact.send( Args )<BR>
<BR> Reply, Message, Headers =
Contact.getreply()</DIV>
<DIV>
<BR> strOutput =
Contact.getfile().read()</DIV>
<DIV> </DIV>
<DIV>This is response we got from the server:</DIV>
<DIV> </DIV>
<DIV>Reply = 302</DIV>
<DIV>Message = Moved Temporarily</DIV>
<DIV>Headers = Server: Zope/(Zope 2.6.1 (binary release, python 2.1,
win32-x86), python 2.1.3, win32) ZServer/1.1b1<BR>Date: Thu, 11 Dec 2003
23:45:02 GMT<BR>Bobo-Exception-File: C:\Program
Files\Plone\Data\Products\CMFCore\CookieCrumbler.py<BR>Bobo-Exception-Type:
Redirect<BR>Connection: close<BR>Location: <A
href="http://2ksvr:85/require_login?came_from=http%3A//2ksvr%3A85/cvs/custom_report/index_html&retry=&disable_cookie_login__=1">http://2ksvr:85/require_login?came_from=http%3A//2ksvr%3A85/cvs/custom_report/index_html&retry=&disable_cookie_login__=1</A><BR>Bobo-Exception-Value:
<A
href="http://2ksvr:85/require_login?came_from=http%3A//2ksvr%3A85/cvs/custom_report/index_html&retry=&disable_cookie_login__=1">http://2ksvr:85/require_login?came_from=http%3A//2ksvr%3A85/cvs/custom_report/index_html&retry=&disable_cookie_login__=1</A><BR>Etag:
<BR>Content-Length: 0<BR>Bobo-Exception-Line: 200<BR></DIV>
<DIV>Any suggestions so we can make it work???</DIV>
<DIV> </DIV>
<DIV> Ruben Montejano.</DIV>
<DIV> email: <A
href="mailto:rubemontejano@yahoo.com">rubemontejano@yahoo.com</A></DIV>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR><A
href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=21260/*http://photos.yahoo.com">New
Yahoo! Photos - easier uploading and sharing</A>
<P>
<HR>
<P></P>_______________________________________________<BR>Zope maillist
-
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BODY></HTML>