Authentication return weird string
Hello, I'm having problems with the AUTHENTICATED_USER variable. Normally, when the administrator authenticates itself, I should have the 'Manager' role returned by the AUTHENTICATED_USER.getRoles() method, right ? When I logon, and then access a web page with the following snippet: <!--#if "AUTHENTICATED_USER.getRoles()"--> You have the following roles: <!--#in "AUTHENTICATED_USER.getRoles()"--> <LI><!--#var sequence-item--> <!--#/in--> <!--#else--> You have no roles defined. <!--#/if--> I get 'manage' as a role, and not 'Manager' !? When browsing without authenticating, I get 'Anonymous', which is right. I'm using Zope 2.0a2, under Linux with Apache and PCGI to send requests to ZServer. For the authorizations, I'm passing them in httpd.conf with: RewriteEngine on RewriteCond %{HTTP:Authorization} ^(.*) RewriteRule ^/(.*) /usr/local/Zope/Zope.cgi/$1 [last,e=HTTP_CGI_AUTHORIZATION:%1 Is this a bug from Zope, from the PCGI wrapper, from Apache, from me, or is it normal and if so, what did I miss ? Thanks, Luc -- Luc Stepniewski <lstep@mail.dotcom.fr> http://lstep.free.fr/pubkey.txt KeyID: D93B2D2D PGP: 49 00 CC D1 69 03 E2 94 C8 78 ED 3C 75 89 A8 DE ICQ: 6104530
Hello! Sorry, this is not an answer for you question, I just want to stress that you do not need both #if and #in tags: #in works great with or without any data. On 20 Jun 1999 lstep@mail.dotcom.fr wrote:
<!--#if "AUTHENTICATED_USER.getRoles()"--> You have the following roles: <!--#in "AUTHENTICATED_USER.getRoles()"--> <LI><!--#var sequence-item--> <!--#/in--> <!--#else--> You have no roles defined. <!--#/if-->
You can rephrase this as follow: <!--#in "AUTHENTICATED_USER.getRoles()"--> <!--#if sequence-start--> You have the following roles: <!--#/if sequence-start--> <LI><!--#var sequence-item--> <!--#else--> You have no roles defined. <!--#/in--> I am not sure whether the #if tag caches its data, but if not - my version is faster (I hope) - my did only 1 (one) call to getRoles (but I did another #if inside the loop...)
Thanks, Luc -- Luc Stepniewski <lstep@mail.dotcom.fr> http://lstep.free.fr/pubkey.txt KeyID: D93B2D2D PGP: 49 00 CC D1 69 03 E2 94 C8 78 ED 3C 75 89 A8 DE ICQ: 6104530
Oleg. ---- Oleg Broytmann Netskate/Inter.Net.Ru phd@emerald.netskate.ru Programmers don't die, they just GOSUB without RETURN.
participants (2)
-
lstep@mail.dotcom.fr -
Oleg Broytmann