Re: [Zope-dev] LoginManager question

2001-03-28 Thread Bertrand Croq

Phillip J. Eby wrote :
 Get rid of the "id_user" DTML method and add the following
 to a SkinScript method inside your UserSource:

 WITH QUERY SQL_id_user(username=self.id) COMPUTE id_user

 You should then be able to do "AUTHENTICATED_USER.id_user" to retrieve the
 attribute.

I had to update ZPatterns (md error) and configure STUPID_LOG_FILE (I/O 
error) but it works.

Thanks a lot.
-- 
Bertrand Croq - VIRTUAL NET (http://www.virtual-net.fr)
80, avenue des Buttes de Coesmes - 35700 RENNES
tel: +33 2 23 21 06 30 - fax: +33 2 99 38 16 85

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] LoginManager question

2001-03-27 Thread Bertrand Croq

Hi,
  I am currently using LoginManager to authenticate users from a MySQL 
database. I followed the tutorials and it works quite well; but there are 
other data associated with users in the database that I would like to use in 
Zope. I have found a solution but I think it is quite complicated:

- first, I added SQL_id_user (ZSQL-method) in the acl_users:

select id_user
from user
where dtml-sqltest username column=user_name type=string

- then, I added id_user (DTML-method) in the acl_users:

dtml-in expr="SQL_id_user(username=username)"
  dtml-return id_user 
/dtml-in

- now, when I want to get the id_user value associated with the current user, 
I need to do:

dtml-with REQUEST
 dtml-var
  expr = "AUTHENTICATED_USER.id_user(
   AUTHENTICATED_USER,
   username=AUTHENTICATED_USER
  )"
 
/dtml-with

Isn't there an easier way to get the id_user value?

-- 
Bertrand Croq - VIRTUAL NET (http://www.virtual-net.fr)
80, avenue des Buttes de Coesmes - 35700 RENNES
tel: +33 2 23 21 06 30 - fax: +33 2 99 38 16 85

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] LoginManager error

2001-02-07 Thread Bertrand CROQ

Hi,
  I am using Zope 2.3.0 with ZPatterns 0.4.3b2 and LoginManager 0.8.8b1. When 
I try to use LoginManager (following the tutorial about LoginManager and 
SQL), here is the error I get in the browser:

Type: TypeError
Value: not enough arguments; expected 3, got 2

Traceback (innermost last):
  File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 222, 
in publish_module
  File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 187, 
in publish
  File /usr/local/Zope-2.3.0-src/lib/python/Zope/__init__.py, line 221, in 
zpublisher_exception_hook
(Object: Traversable)
  File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 162, 
in publish
  File /usr/local/Zope-2.3.0-src/lib/python/ZPublisher/BaseRequest.py, line 
444, in traverse
  File /usr/local/zope/lib/python/Products/LoginManager/LoginManager.py, line 
237, in validate
(Object: ProviderContainer)
  File /usr/local/zope/lib/python/Products/LoginManager/LoginMethods.py, line 
149, in findLogin
(Object: PlugInBase)
  File /usr/local/Zope-2.3.0-src/lib/python/Shared/DC/Scripts/Bindings.py, 
line 324, in __call__
(Object: authenticate)
  File /usr/local/Zope-2.3.0-src/lib/python/Shared/DC/Scripts/Bindings.py, 
line 353, in _bindAndExec
(Object: authenticate)
  File 
/usr/local/Zope-2.3.0-src/lib/python/Products/PythonScripts/PythonScript.py, 
line 330, in _exec
(Object: authenticate)
(Info: ... cut ...)
TypeError: (see above)

I don't know a lot about Zope/Python (I work on it since 2 weeks) so I don't 
know if this is an install error, a development error (I mean, did I do 
something wrong when using LoginManager, surely!!), or an error in 
LoginManager; is this a known error?

The error seams to be in LoginMethods.py:149 as it calls user.authenticate() 
with two parameters where LoginUser's authenticate() takes 3 
parameters; but, once again, I might be missing something as I am a 
beginner...

Thanks
-- 
Bertrand Croq - VIRTUAL NET (http://www.virtual-net.fr)
80, avenue des Buttes de Coesmes - 35700 RENNES
tel: +33 2 23 21 06 30 - fax: +33 2 99 38 16 85

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )