authentication in a pythonscript
how do I call a python-script form python. I am using the LoginManage and wrote the authenticate function as a python-script. But when this is called from within the login-manager, I get Type Error Traceback (innermost last): File ...Zope-2.4.1/lib/python/ZPublisher/Publish.py, line 223, in publish_module File ...Zope-2.4.1/lib/python/ZPublisher/Publish.py, line 187, in publish File ...Zope-2.4.1/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: LockableItem) File ...Zope-2.4.1/lib/python/ZPublisher/Publish.py, line 162, in publish File ...Zope-2.4.1/lib/python/ZPublisher/BaseRequest.py, line 447, in traverse File ...ZInstanceHome/Products/LoginManager/LoginManager.py, line 238, in validate (Object: ProviderContainer) File .../ZInstanceHome/Products/LoginManager/LoginMethods.py, line 302, in findLogin (Object: PlugInBase) File ...Zope-2.4.1/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: authenticate) File ...Zope-2.4.1/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec (Object: authenticate) File ...Zope-2.4.1/lib/python/Products/PythonScripts/PythonScript.py, line 363, in _exec (Object: authenticate) (Info: (None, ('test', <h3>form</h3><table><tr valign="t.....the whole source of the loginForm TypeError: (see above) I tried serveral bindings for the python-script but none worked. Mit freundlichen Grüßen Joachim Schmitz AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163
Hi Joachim, Here is one that works for me: ## Script (Python) "userAuthenticate" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=manager, request, username, password ##title=Authenticate a User ## # # Get user inforamtion from Gadfly and check password given. # result = container.selectSQL(personID=username) if result and result[0].passwd == password: return 1 else: return 0 On Monday, October 22, 2001, at 10:33 AM, Joachim Schmitz wrote:
how do I call a python-script form python. I am using the LoginManage and wrote the authenticate function as a python-script. But when this is called from within the login-manager, I get
Type Error
Traceback (innermost last): File ...Zope-2.4.1/lib/python/ZPublisher/Publish.py, line 223, in publish_module File ...Zope-2.4.1/lib/python/ZPublisher/Publish.py, line 187, in publish File ...Zope-2.4.1/lib/python/Zope/__init__.py, line 226, in zpublisher_exception_hook (Object: LockableItem) File ...Zope-2.4.1/lib/python/ZPublisher/Publish.py, line 162, in publish File ...Zope-2.4.1/lib/python/ZPublisher/BaseRequest.py, line 447, in traverse File ...ZInstanceHome/Products/LoginManager/LoginManager.py, line 238, in validate (Object: ProviderContainer) File .../ZInstanceHome/Products/LoginManager/LoginMethods.py, line 302, in findLogin (Object: PlugInBase) File ...Zope-2.4.1/lib/python/Shared/DC/Scripts/Bindings.py, line 324, in __call__ (Object: authenticate) File ...Zope-2.4.1/lib/python/Shared/DC/Scripts/Bindings.py, line 354, in _bindAndExec (Object: authenticate) File ...Zope-2.4.1/lib/python/Products/PythonScripts/PythonScript.py, line 363, in _exec (Object: authenticate) (Info: (None, ('test', <h3>form</h3><table><tr valign="t.....the whole source of the loginForm TypeError: (see above)
I tried serveral bindings for the python-script but none worked.
Mit freundlichen Grüßen
Joachim Schmitz
AixtraWare, Ing. Büro für Internetanwendungen Hüsgenstr. 33a, D-52457 Aldenhoven Telefon: +49-2464-8851, FAX: +49-2464-905163
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Joachim Schmitz -
Steve Spicklemire