GenericUserSource LoginManager with PythonScripts.
Zope 2.3.0 RHL 6.2 RPM install userExists [PythonScript] ------------ return 1 userAuthenticate [PythonScript] ------------ return 1 userRoles [PythonScript] ------------ return 'Manager' Trying to access the protected folder gives the following traceback. Any ideas? Error Type: TypeError Error Value: no arguments expected <!-- Traceback (innermost last): File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 222, in publish_module File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 187, in publish File /usr/share/zope/lib/python/Zope/__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File /usr/lib/python1.5/site-packages/ZPublisher/Publish.py, line 162, in publish File /usr/lib/python1.5/site-packages/ZPublisher/BaseRequest.py, line 444, in traverse File /var/zope/Products/LoginManager/LoginManager.py, line 237, in validate (Object: ProviderContainer) File /var/zope/Products/LoginManager/LoginMethods.py, line 147, in findLogin (Object: PlugInBase) File /var/zope/Products/LoginManager/LoginManager.py, line 194, in getItem (Object: ProviderContainer) File /var/zope/Products/ZPatterns/Rack.py, line 59, in getItem (Object: ProviderContainer) File /var/zope/Products/LoginManager/UserSources.py, line 510, in retrieveItem (Object: ProviderContainer) File /usr/share/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: userExists) File /usr/share/zope/lib/python/Shared/DC/Scripts/Bindings.py, line 353, in _bindAndExec (Object: userExists) File /usr/share/zope/lib/python/Products/PythonScripts/PythonScript.py, line 330, in _exec (Object: userExists) (Info: ({'script': <PythonScript instance at 87ce2d0>, 'context': <GenericUserSource instance at 87fae28>, 'container': <LoginManager instance at 8753088>, 'traverse_subpath': []}, (<GenericUserSource instance at 87fae28>, <h3>form</h3><table></table><h3>cookies</h3 ><table><tr valign="top" align="left"><th>zmi_use_css</th><td>'1'</ td></tr><tr valign="top" align="left"><th>__cp</th><td>'x%da%d3%60b%60 %60%c8%04b%86hf%20%a1%01%22%8aA%dcb%16%20%91%91%98%9c%5d,%08dT%94%16%a7%169% 96%96d%a4%e6%95d%26%27%96%a4bS%c8%0dS%e8Z%91Y%5cR%8cM%09%17LIP%7eNj1%00%92%c 4%1a%7e'</td></tr><tr valign="top" align="left"><th>tree-s</th><td>'eJyLjlZ3hANP W3UdhWiEiIe7o616LBAAALzfCe4'</td></tr><tr valign="top" align="left"><th>dtpref_cols</th><td>'60'< /td></tr><tr valign="top" align="left"><th>zmi_top_frame</th><td>'1'< ;/td></tr><tr valign="top" align="left"><th>dtpref_rows</th><td>'20'< /td></tr></table><h3>other</h3><table><t r valign="top" align="left"><th>__cp</th><td>'x%da%d3%60b%60 %60%c8%04b%86hf%20%a1%01%22%8aA%dcb%16%20%91%91%98%9c%5d,%08dT%94%16%a7%169% 96%96d%a4%e6%95d%26%27%96%a4bS%c8%0dS%e8Z%91Y%5cR%8cM%09%17LIP%7eNj1%00%92%c 4%1a%7e'</td></tr><tr valign="top" align="left"><th>dtpref_rows</th><td>'20'< /td></tr><tr valign="top" align="left"><th>PUBLISHED</th><td><Py thon Method object at 8663ca0></td></tr><tr valign="top" align="left"><th>URL0</th><td>'http://localho st/hack/manage_workspace'</td></tr><tr valign="top" align="left"><th>BASE3</th><td>'http://localh ost/hack/manage_workspace'</td></tr><tr valign="top" align="left"><th>URL2</th><td>'http://localho st'</td></tr><tr valign="top" align="left"><th>BASE1</th><td>'http://localh ost'</td></tr><tr valign="top" align="left"><th>BASE0</th><td>'http://localh ost'</td></tr><tr valign="top" align="left"><th>zmi_use_css</th><td>'1'</ td></tr><tr valign="top" align="left"><th>URL1</th><td>'http://localho st/hack'</td></tr><tr valign="top" align="left"><th>SERVER_URL</th><td>'http://l ocalhost'</td></tr><tr valign="top" align="left"><th>zmi_top_frame</th><td>'1'< ;/td></tr><tr valign="top" align="left"><th>tree-s</th><td>'eJyLjlZ3hANP W3UdhWiEiIe7o616LBAAALzfCe4'</td></tr><tr valign="top" align="left"><th>URL</th><td>'http://localhos t/hack/manage_workspace'</td></tr><tr valign="top" align="left"><th>AUTHENTICATED_USER</th><td>L oggingInUser</td></tr><tr valign="top" align="left"><th>LOGIN_METHODS</th><td>[]< /td></tr><tr valign="top" align="left"><th>TraversalRequestNameStack</th>< td>[]</td></tr><tr valign="top" align="left"><th>BASE2</th><td>'http://localh ost/hack'</td></tr><tr valign="top" align="left"><th>dtpref_cols</th><td>'60'< /td></tr><tr valign="top" align="left"><th>URL0</th><td>http://localhos t/hack/manage_workspace</td></tr><tr valign="top" align="left"><th>URL1</th><td>http://localhos t/hack</td></tr><tr valign="top" align="left"><th>URL2</th><td>http://localhos t</td></tr><tr valign="top" align="left"><th>BASE0</th><td>http://localho st</td></tr><tr valign="top" align="left"><th>BASE1</th><td>http://localho st</td></tr><tr valign="top" align="left"><th>BASE2</th><td>http://localho st/hack</td></tr><tr valign="top" align="left"><th>BASE3</th><td>http://localho st/hack/manage_workspace</td></tr></table><h3>enviro n</h3><table><tr valign="top" align="left"><th>DOCUMENT_ROOT</th><td>/home/ httpd/html</td></tr><tr valign="top" align="left"><th>SERVER_ADDR</th><td>192.168. 1.136</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT_ENCODING</th><td> ;gzip, deflate</td></tr><tr valign="top" align="left"><th>PCGI_NAME</th><td>Zope</t d></tr><tr valign="top" align="left"><th>SERVER_PORT</th><td>80</t d></tr><tr valign="top" align="left"><th>PATH_TRANSLATED</th><td>/hom e/httpd/cgi-bin/Zope/hack/manage_workspace</td></tr><tr valign="top" align="left"><th>REMOTE_ADDR</th><td>192.168. 1.136</td></tr><tr valign="top" align="left"><th>SERVER_SOFTWARE</th><td>Apac he/1.3.14 (Unix) (Red-Hat/Linux) PHP/3.0.18</td></tr><tr valign="top" align="left"><th>REQUEST_METHOD</th><td>GET&l t;/td></tr><tr valign="top" align="left"><th>SCRIPT_NAME</th><td></td& gt;</tr><tr valign="top" align="left"><th>HTTP_REFERER</th><td>http:// localhost/manage_menu?tree-e=eJyLVneEA09bdR0FON/D3dFWPRYAf/MHxg</td>&l t;/tr><tr valign="top" align="left"><th>PCGI_EXE</th><td>/usr/bin/py thon</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT_LANGUAGE</th><td> ;en-us</td></tr><tr valign="top" align="left"><th>PCGI_PUBLISHER</th><td>/var/ zope/pcgi_nullpublisher.py</td></tr><tr valign="top" align="left"><th>GATEWAY_INTERFACE</th><td>CG I/1.1</td></tr><tr valign="top" align="left"><th>SERVER_NAME</th><td>gfa.grco mputing.net</td></tr><tr valign="top" align="left"><th>HTTP_CONNECTION</th><td>Keep -Alive</td></tr><tr valign="top" align="left"><th>HTTP_USER_AGENT</th><td>Mozi lla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)</td></tr><tr valign="top" align="left"><th>Z_REALM</th><td>/var/zope/Zo pe.cgi</td></tr><tr valign="top" align="left"><th>PCGI_DISPLAY_ERRORS</th><td> 1</td></tr><tr valign="top" align="left"><th>HTTP_ACCEPT</th><td>image/gi f, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*</td></tr><tr valign="top" align="left"><th>REQUEST_URI</th><td>/hack/ma nage_workspace</td></tr><tr valign="top" align="left"><th>PATH</th><td>/sbin:/usr/sbin :/bin:/usr/bin:/usr/X11R6/bin</td></tr><tr valign="top" align="left"><th>QUERY_STRING</th><td></td ></tr><tr valign="top" align="left"><th>SCRIPT_FILENAME</th><td>/hom e/httpd/cgi-bin/Zope</td></tr><tr valign="top" align="left"><th>HTTP_HOST</th><td>localhost& lt;/td></tr><tr valign="top" align="left"><th>SCRIPT_URL</th><td>/hack/man age_workspace</td></tr><tr valign="top" align="left"><th>Z_DEBUG_MODE</th><td>1</t d></tr><tr valign="top" align="left"><th>PCGI_PID_FILE</th><td>/var/r un/zserver.pid</td></tr><tr valign="top" align="left"><th>SERVER_SIGNATURE</th><td>&am p;lt;ADDRESS>Apache/1.3.14 Server at gfa.grcomputing.net Port 80</ADDRESS> </td></tr><tr valign="top" align="left"><th>SCRIPT_URI</th><td>http://gf a.grcomputing.net/hack/manage_workspace</td></tr><tr valign="top" align="left"><th>PCGI_SOCKET_FILE</th><td>/va r/run/pcgi.soc</td></tr><tr valign="top" align="left"><th>SERVER_ADMIN</th><td>root@lo calhost</td></tr><tr valign="top" align="left"><th>PCGI_MODULE_PATH</th><td>/us r/share/zope/lib/python/Zope</td></tr><tr valign="top" align="left"><th>REMOTE_PORT</th><td>3005< /td></tr><tr valign="top" align="left"><th>PATH_INFO</th><td>/hack/mana ge_workspace</td></tr><tr valign="top" align="left"><th>HTTP_COOKIE</th><td>zmi_use_ css="1"; dtpref_cols="60"; zmi_top_frame="1"; dtpref_rows="20"; tree-s="eJyLjlZ3hANPW3UdhWiEiIe7o616LBAAALzfCe4"; __cp="x%da%d3%60b%60%60%c8%04b%86hf%20%a1%01%22%8aA%dcb%16%20%91%91 %98%9c%5d,%08dT%94%16%a7%169%96%96d%a4%e6%95d%26%27%96%a4bS%c8%0dS%e8Z%91Y%5 cR%8cM%09%17LIP%7eNj1%00%92%c4%1a%7e"</td></tr><tr valign="top" align="left"><th>PCGI_INFO_FILE</th><td>/home /httpd/cgi-bin/Zope</td></tr><tr valign="top" align="left"><th>INSTANCE_HOME</th><td>/var/z ope</td></tr><tr valign="top" align="left"><th>PCGI_ERROR_LOG</th><td>syslo g:local0</td></tr><tr valign="top" align="left"><th>SERVER_PROTOCOL</th><td>HTTP /1.1</td></tr></table>), {'username': 'steve'}, None)) TypeError: (see above)
Steve Drees wrote:
Error Type: TypeError Error Value: no arguments expected
That means one of your python scripts is getting parameters when it wasn't expecting any. try adding stuff in the 'Parameters List' box until it goes away and then find out what's in those parameters :-) cheers, Chris
participants (2)
-
Chris Withers -
Steve Drees