redirect to user's folder not working
I am using this line in my index_html DTML method in the base root folder to redirect users to their proper folder so content can be specialized for each of them: <dtml-call "RESPONSE.redirect(URL1 + '/' + AUTHENTICATED_USER)"> I get an error: Error Type: TypeError Error Value: illegal argument type for built-in operation It works fine like hard-coded like this: <dtml-call "RESPONSE.redirect(URL1 + '/' + 'username')"> I can use <dtml-var AUTHENTICATED_USER> on the page and get the appropriate username though?! Any help appreciated. -- Erik Myllymaki erik@pacific-shores.com
AUTHENTICATED_USER is not a string so need to cast it before doing the string operation: <dtml-call "RESPONSE.redirect(URL1 + '/' + _.str(AUTHENTICATED_USER))"> <dtml-var AUTHENTICATED_USER> effectively does the same thing, it calls the string representation of AUTHENTICATED_USER. ----- Original Message ----- From: "Erik Myllymaki" <erik@pacific-shores.com> To: <zope@zope.org> Sent: Thursday, October 05, 2000 8:48 AM Subject: [Zope] redirect to user's folder not working
I am using this line in my index_html DTML method in the base root folder to redirect users to their proper folder so content can be specialized for each of them:
<dtml-call "RESPONSE.redirect(URL1 + '/' + AUTHENTICATED_USER)">
I get an error:
Error Type: TypeError Error Value: illegal argument type for built-in operation
It works fine like hard-coded like this:
<dtml-call "RESPONSE.redirect(URL1 + '/' + 'username')">
I can use <dtml-var AUTHENTICATED_USER> on the page and get the appropriate username though?!
Any help appreciated.
-- Erik Myllymaki erik@pacific-shores.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Fri, 06 Oct 2000, Andy McKay wrote:
AUTHENTICATED_USER is not a string so need to cast it before doing the string operation:
<dtml-call "RESPONSE.redirect(URL1 + '/' + _.str(AUTHENTICATED_USER))">
<dtml-var AUTHENTICATED_USER> effectively does the same thing, it calls the string representation of AUTHENTICATED_USER.
A more 'polite' way to get the user name is to use AUTHENTICATED_USER.getUserName(). Not as short, true, but definitely more explicit. Have a better one, Curtis
On Fri, 06 Oct 2000, Andy McKay wrote:
AUTHENTICATED_USER is not a string so need to cast it before doing the string operation:
<dtml-call "RESPONSE.redirect(URL1 + '/' + _.str(AUTHENTICATED_USER))">
<dtml-var AUTHENTICATED_USER> effectively does the same thing, it calls the string representation of AUTHENTICATED_USER.
A more 'polite' way to get the user name is to use AUTHENTICATED_USER.getUserName(). Not as short, true, but definitely more explicit.
Agreed. Any remember, several user managers don't completely conform to the AUTHENTICATED_USER "standards", and you might see calling AUTHENTICATED_USER directly fail completely. ;] Knight knight@phunc.com
participants (4)
-
Andy McKay -
Curtis Maloney -
Erik Myllymaki -
knight