Re: [Zope] LoginManager dlpierson example

2001-01-31 Thread Fred Yankowski

I just realized that I responded in terms of a PythonMethod when you
asked about a PythonScript.  My ZClass functions for my LoginManager
subclass are all PythonMethods, yet to be converted to Python
Scripts.  My 'authenticate' method takes (self, password, request) as
parameters and has for the function body only

return password == self.password

I suspect that an equivalent PythonScript will need to take password
and request as parameters (not so sure about 'request') and will have
a body like this:

return password == container.password

Ah, what the heck...  OK, I just converted my authenticate script as
above and it seems to still work fine.

On Wed, Jan 31, 2001 at 07:32:14PM +1300, W. Robert Kellock wrote:
 On passing 'request' (why the extra argument anyway?) I got
 
 Error Type: TypeError
 Error Value: not enough arguments; expected 3, got 2
 
 so I'm wondering have you got LoginManager to work on the Zope 2.3.0 release?

-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] LoginManager dlpierson example

2001-01-30 Thread W. Robert Kellock




Hi,

I'm new to Zope and I've been examining the LoginManager 
example given by dlpierson (http://www.zope.org/Members/dlpierson/sqlLogin). 
Although I am nowhere near understanding what it is doing, I'm very close to 
getting it to work - I think! It looks to me like I'm falling down in the 
PythonMethods (PythonScripts) in the Member ZClass. Are PythonScript 
arguments typeless? I keep getting an error

Error Type: AttributeErrorError 
Value: 'string' object has no attribute 'password'

from the authenticate method which I'm passing 
self,password.

Strangely following this error, I can hit the back button on 
my browser and reach the protected HTML page anyway! Here is the 
traceback.Your help would be appreciated.

!--
Traceback (innermost last):
File D:\PROGRA~1\WEBSITE\lib\python\ZPublisher\Publish.py, line 
222, in publish_module
File D:\PROGRA~1\WEBSITE\lib\python\ZPublisher\Publish.py, line 
187, in publish
File D:\PROGRA~1\WEBSITE\lib\python\Zope\__init__.py, line 221, 
in zpublisher_exception_hook
(Object: Traversable)
File D:\PROGRA~1\WEBSITE\lib\python\ZPublisher\Publish.py, line 
162, in publish
File D:\PROGRA~1\WEBSITE\lib\python\ZPublisher\BaseRequest.py, 
line 444, in traverse
File 
D:\PROGRA~1\WEBSITE\lib\python\Products\LoginManager\LoginManager.py, line 237, 
in validate
(Object: ProviderContainer)
File 
D:\PROGRA~1\WEBSITE\lib\python\Products\LoginManager\LoginMethods.py, line 246, 
in findLogin
(Object: PlugInBase)
File 
D:\PROGRA~1\WEBSITE\lib\python\Shared\DC\Scripts\Bindings.py, line 324, in 
__call__
(Object: authenticate)
File 
D:\PROGRA~1\WEBSITE\lib\python\Shared\DC\Scripts\Bindings.py, line 353, in 
_bindAndExec
(Object: authenticate)
File 
D:\PROGRA~1\WEBSITE\lib\python\Products\PythonScripts\PythonScript.py, line 330, 
in _exec
(Object: authenticate)
(Info: ({'script': lt;PythonScript instance at 
01596818gt;, 'context': SMKELLOCK, 'container': SMKELLOCK, 
'traverse_subpath': []}, ('colenso9', 
lt;h3gt;formlt;/h3gt;lt;tablegt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;__ac_passwordlt;/thgt;lt;tdgt;'colenso9'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt; Log In 
lt;/thgt;lt;tdgt;' Log In 
'lt;/tdgt;lt;/trgt;lt;tr valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;__ac_namelt;/thgt;lt;tdgt;'SMKELLOCK'lt;/tdgt;lt;/trgt;lt;/tablegt;lt;h3gt;cookieslt;/h3gt;lt;tablegt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;sql_pref__colslt;/thgt;lt;tdgt;'50'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;dtpref_colslt;/thgt;lt;tdgt;'85'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;sql_pref__rowslt;/thgt;lt;tdgt;'15'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;dtpref_rowslt;/thgt;lt;tdgt;'15'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;tutorialExamplesURLlt;/thgt;lt;tdgt;'http://sharonk:8080/ZopeTutorial/examples/lesson3'lt;/tdgt;lt;/trgt;lt;/tablegt;lt;h3gt;otherlt;/h3gt;lt;tablegt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;dtpref_rowslt;/thgt;lt;tdgt;'15'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;__ac_passwordlt;/thgt;lt;tdgt;'colenso9'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;__ac_namelt;/thgt;lt;tdgt;'SMKELLOCK'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;dtpref_colslt;/thgt;lt;tdgt;'85'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;BASE3lt;/thgt;lt;tdgt;'http://sharonk:8080/FinanceNow/index_html'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;BASE2lt;/thgt;lt;tdgt;'http://sharonk:8080/FinanceNow'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;BASE1lt;/thgt;lt;tdgt;'http://sharonk:8080'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;BASE0lt;/thgt;lt;tdgt;'http://sharonk:8080'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;URL1lt;/thgt;lt;tdgt;'http://sharonk:8080/FinanceNow'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;SERVER_URLlt;/thgt;lt;tdgt;'http://sharonk:8080'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;AUTHENTICATED_USERlt;/thgt;lt;tdgt;LoggingInUserlt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;TraversalRequestNameStacklt;/thgt;lt;tdgt;[]lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;sql_pref__rowslt;/thgt;lt;tdgt;'15'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;URL2lt;/thgt;lt;tdgt;'http://sharonk:8080'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt;URL0lt;/thgt;lt;tdgt;'http://sharonk:8080/FinanceNow/index_html'lt;/tdgt;lt;/trgt;lt;tr 
valign=quot;topquot; 
align=quot;leftquot;gt;lt;thgt; Log In 
lt;/thgt;lt;tdgt;' Log In 

Re: [Zope] LoginManager dlpierson example

2001-01-30 Thread Fred Yankowski

On Wed, Jan 31, 2001 at 09:25:08AM +1300, W. Robert Kellock wrote:
 Are PythonScript arguments typeless?  I keep getting an
 error
 
 Error Type: AttributeError
 Error Value: 'string' object has no attribute 'password'
  
 from the authenticate method which I'm passing self,password.


I think you should pass (self, password, request).


-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] LoginManager dlpierson example

2001-01-30 Thread W. Robert Kellock



Thanks Fred,

On passing 'request' (why the extra argument anyway?) I 
got

Error Type: TypeErrorError Value: 
not enough arguments; expected 3, got 2
so I'm wondering have you got LoginManager to work on the Zope 
2.3.0 release?

On Wed, Jan 31, 2001 at 09:25:08AM +1300, W. Robert 
Kellock wrote: Are PythonScript arguments typeless? I keep 
getting an error  Error Type: 
AttributeError Error Value: 'string' object has no attribute 
'password'  from the authenticate method which I'm 
passing self,password.I think you should pass (self, password, 
request).-- Fred 
Yankowski [EMAIL PROTECTED] 
tel: +1.630.879.1312Principal Consultant 
www.OntoSys.com fax: 
+1.630.879.1370OntoSys, 
Inc 
38W242 Deerpath Rd, Batavia, IL 60510, USA
-W.Robert 
Kellock 
Ph: 
+64 3 326 6115Sales 
Manager 
Fax: 
+64 3 326 6115Credit Systems Control 
Ltd 
Web: www.creditscore.co.nz 
"making decisions 
easy"-