cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laurent Trillaud" <ltrill...@jouve.fr>
Subject RE: getting username from session after authentication
Date Thu, 26 Feb 2004 09:34:27 GMT

Zoltan
I guess that the authenticate action is missing. The authentication context
isn't loaded
Try this stuff
<map:match pattern="*.html">
  <map:act type="auth-protect">
    blah blah
    <map:parameter name="username" value="{name}"/>
    blah blah
  </map:act>
</map:match>

{name} or {user/name} that depend what you have done in the handler
authentication uri.

Laurent Trillaud

> -----Message d'origine-----
> De : Zamek [mailto:zamek@vili.pmmf.hu]
> Envoyé : mercredi 25 février 2004 17:42
> À : users@cocoon.apache.org
> Objet : getting username from session after authentication
> 
> Hello All,
> 
> I need authenticated user's name in my xsl stylesheet to make different
> menus.
> There is a session transformer in my sitemap.xmap:
> 
>    <map:match pattern="*.html">
>        <map:aggregate element="office:document">
>          <map:part src="zip://content.xml@{1}.sxw"/>
>          <map:part src="zip://meta.xml@{1}.sxw"/>
>          <map:part src="zip://styles.xml@{1}.sxw"/>
>        </map:aggregate>
> 
>        <map:transform type="session"/>
>        <map:transform src="../style/ooo2html.xsl">
> 
>          <map:parameter name="username" value="{session-context:user}"/>
> <----------------------- Here is my trying to get username
> 
>          <map:parameter name="template" value="nomenu.xml"/>
>          <map:parameter name="doc_name" value="{1}"/>
>          <map:parameter name="metaFileURL"
> value="zip://meta.xml@{1}.sxw"/>
>          <map:parameter name="stylesFileURL"
> value="zip://styles.xml@{1}.sxw"/>
>          <map:parameter name="absoluteSourceDirRef" value="{1}.sxw"/>
>        </map:transform>
> 
>        <map:serialize type="html"/>
>    </map:match>
> 
> 
> and username variable is empty when I logged in :-(
> 
> How can I retrieve logged username in my sitemap or my stylesheet?
> 
> users.xml is:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!-- $Id: userlist.xml,v 1.1 2003/03/09 00:02:23 pier Exp $ Description:
> All
> users -->
> <authentication>
>   <users>
>     <user>
>      <name>cocoon</name>
>     </user>
>     <user>
>      <name>guest</name>
>     </user>
>   </users>
> </authentication>
> 
> 
> --
> thx,
> Zoltan Zidarics programmer
> PTE University Pecs, Hungary
> icq: 43288694
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message