[Zope] AUTHENTICATED_USER in zsql db connections?

Jens Vagelpohl tommymi@concentric.net
Wed, 22 Sep 1999 19:56:34 -0400


hi jim,

<snippers>
> Is there any way to accomplish this?  (I tried the obvious, making the
> connection string be
> 	dbname@localhost AUTHENTICATED_USER
> ; that didn't work... :)
>
<snippers>

this cannot work because when the user accesses the database through zope
the connection is usually already there. it's a persistent connection that
is opened right away. if your goal is to keep track of who does stuff you
might do a dirty workaround and create another table in your database to
capture the name of AUTHENTICATED_USER and other information needed and
timestamp. important interactions (updates, inserts, etc) could write this
info into the database by providing a second part to the ZSQL methods
involved.

<untested>

<first part of ZSQL method>

<dtml-var sql_delimiter>

INSERT tracking_table_name VALUES (
       <dtml-sqlvar AUTHENTICATED_USER.name type=string>,
       <dtml-sqlvar ZopeTime() type=date>,
       <dtml-sqlvar.... etc etc etc....)

</untested>

hope this helps

jens

Jens Vagelpohl

Systems Administrator
Washtenaw Development Council