<!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).&nbsp;&nbsp;You can use the 
python 'commands' module to invoke cURL.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>HTH</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Jonathan</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</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>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp; We are using a Python&nbsp;External Method to&nbsp;send a 
  "post" request&nbsp;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>&nbsp;</DIV>
  <DIV>&nbsp;this is the code we are using:</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Args = 
  urllib.urlencode(Args)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Scheme, 
  Host, Path, Parameters, Query, Frag = 
  urlparse.urlparse(ActionUrl)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  </DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contact = 
  httplib.HTTP(Host)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Contact.putrequest( "POST", Path 
  )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contact.putheader( 
  "Content-type", "application/x-www-form-urlencoded" 
  )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contact.putheader( 
  "Content-length", "%d" %len(Args) 
  )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contact.putheader( "Accept", 
  "text/plain" )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Contact.putheader( "Host", Host 
  )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Contact.endheaders()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Contact.send( Args )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reply, Message, Headers = 
  Contact.getreply()</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strOutput = 
  Contact.getfile().read()</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>This is response we got from the server:</DIV>
  <DIV>&nbsp;</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&amp;retry=&amp;disable_cookie_login__=1">http://2ksvr:85/require_login?came_from=http%3A//2ksvr%3A85/cvs/custom_report/index_html&amp;retry=&amp;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&amp;retry=&amp;disable_cookie_login__=1">http://2ksvr:85/require_login?came_from=http%3A//2ksvr%3A85/cvs/custom_report/index_html&amp;retry=&amp;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>&nbsp;</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ruben Montejano.</DIV>
  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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&nbsp; 
  -&nbsp; 
  Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**&nbsp;&nbsp; 
  No cross posts or HTML encoding!&nbsp; **<BR>(Related lists - 
  <BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-dev 
  )<BR></BLOCKQUOTE></BODY></HTML>