[Zope] authenticated_user in Z SQL method not defined

Christoph Landwehr chris-zopemailing at gmx.de
Fri Oct 17 11:06:52 EDT 2003


Hi,

I'm using the exUserFolder together with a PostgreSQL-db to log in 
users. Works so far.

With <dtml-var "AUTHENTICATED_USER.getUserName()"> I get the username 
which is the same as the field "username" in the db users.

But I can not use AUTHENTICATED_USER in an sql-querry like
SELECT foo
FROM users
WHERE username=<dtml-var "AUTHENTICATED_USER.getUserName()" sql_quote>;

Why is AUTHENTICATED_USER not availabel in  Z SQL methods?

Traceback (innermost last):
     * Module ZPublisher.Publish, line 98, in publish
     * Module ZPublisher.mapply, line 88, in mapply
     * Module ZPublisher.Publish, line 39, in call_object
     * Module Shared.DC.ZRDB.DA, line 328, in manage_test
     * Module Shared.DC.ZRDB.DA, line 306, in manage_test
     * Module Shared.DC.ZRDB.DA, line 415, in __call__
     * Module DocumentTemplate.DT_String, line 474, in __call__
     * Module DocumentTemplate.DT_Var, line 221, in render
     * Module DocumentTemplate.DT_Util, line 201, in eval
       __traceback_info__: AUTHENTICATED_USER
     * Module <string>, line 2, in f

Error, exceptions.NameError: global name 'AUTHENTICATED_USER' is not defined

Regards Christoph





More information about the Zope mailing list