[Zope] AUTHENTICATED_USER in ZSQL

Andreas andreas@aHIT.de
Fri, 18 Feb 2000 18:05:08 -0700


Michiel Toneman wrote:
> 
> On Fri, 18 Feb 2000, Ulrich Wisser wrote:
> 
> > Hello,
> >
> > I tried to use the AUTHENTICATED_USER object in a ZSQL
> > method. Like:
> >
> > INSERT INTO MYTABLE(USER)
> > VALUES('<dtml-var "AUTHENTICATED_USER.getName()" sql_quote>')
> >
> > But Zope tells me that AUTHENTICATD_USER is not known.
> > Why that?
> 
> I had that problem too. Put AUTHENTICATED_USER in
> the "Arguments" field. That should solve it.

Hi ,
you do not have to put it in your arguments field.
You can use things like 
INSERT INTO YOURTABLE(USER) VALUES (<!--#sqlvar
"REQUEST.get('AUTHENTICATED_USER')" type=string-->)

or

SELECT USER,ROLE FROM YOURTABLE WHERE ROLE IN
(
<!--#in "(REQUEST.get('AUTHENTICATED_USER')).roles"-->
    '<!--#var sequence-item-->'<!--#unless
sequence-end-->,<!--#/unless-->
<!--#/in-->
)
anywhere in your ZSQLMethode.

-- 
_________________________________________________________
Andreas Heckel                            andreas@aHIT.de