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 Fri, 27 Feb 2004 13:45:11 GMT
Zoltan
I give you a sample to see what you have in your context authentication. It
will help you to find the path to retrieve your login.
Declare this match in you sitemap
            <map:match pattern="session-account.ccn">
                <map:act type="auth-protect">
                    <map:parameter name="handler" value="demohandler" />
                    
                    <map:generate src="session-account.xml"/>
                    <map:transform type="session"/>
                    <map:serialize type="xml" />
                </map:act>
            </map:match>
with the following session-account.xml
<?xml version="1.0" encoding="UTF-8"?>
<doc xmlns:session="http://apache.org/cocoon/session/1.0">
	<session:getxml context="authentication" path="/"/>
</doc>
You should see something like
<doc>
 <authenticate>
  <ID>MyLoginName</ID>
  ... and so on depends of your authenticate.xsl
  ... the tag ID depends also of your authenticate.xsl
 </authenticate>
</doc>
Assuming that the login is store in the ID tag. To access it use the
following pipeline
<map:match pattern="show-login">
 <map:generate src="dummy.xml"/>
 <map:transform src="xml2html.xsl"> 
  <map:parameter name="username" value="{ID}"/
 </map:transform>            
 <map:serialize type="html"/>
</map:match>
Hope, that will be useful.
Laurent Trillaud

> Thanks for response, but I am a beginner in Cocoon and I don´t understand
> it, or it doesn´t works for me. :-(
> My goal is make different menus depending to valid users or anonymous
> user.
> I would like to make it my xsl if it possible.



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


Mime
View raw message