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 )



Re: [Zope-dev] LoginManager question

2001-03-27 Thread Phillip J. Eby

At 12:19 PM 3/27/01 +0200, Bertrand Croq wrote:
>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 
>
>- then, I added id_user (DTML-method) in the acl_users:
>
>
>   
>
>
>- now, when I want to get the id_user value associated with the current
user, 
>I need to do:
>
>
>   expr = "AUTHENTICATED_USER.id_user(
>   AUTHENTICATED_USER,
>   username=AUTHENTICATED_USER
>  )"
> >
>
>
>Isn't there an easier way to get the id_user value?
>

Yes, there is.  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.  


___
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 

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


   


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


 


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 )