Thx for your help...
i'm having trouble understanding the principle of the {session-context}
As you can see in the Sitemap part "Authentication resource..."
I refer to userlist_cdls-nl.xml, following is the xml inside....
<?xml version="1.0"?>
<authentication>
<users>
<user>
<ID>CDLS</ID>
<password>MOOIEOGEN</password>
<role>lid</role> <!-- optional -->
<data>
Een lid van de Oudervereniging
<login>yes</login>
</data>
</user>
<user>
<ID>gerritjan</ID>
<password>koekkoek</password>
<role>lid</role> <!-- optional -->
<data>
Een lid van de Oudervereniging
<login>yes</login>
</data>
</user>
</users>
</authentication>
the xslt used is:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Get the name from the request paramter -->
<xsl:param name="user_id"/>
<xsl:param name="password"/>
<xsl:template match="authentication">
<authentication>
<xsl:apply-templates select="users"/>
</authentication>
</xsl:template>
<xsl:template match="users">
<xsl:apply-templates select="user"/>
</xsl:template>
<xsl:template match="user">
<!-- Compare the name of the user -->
<xsl:if test="normalize-space(ID) = $user_id and
normalize-space(password) = $password">
<!-- found, so create the ID -->
<ID><xsl:value-of select="ID"/></ID>
<role><xsl:value-of select="role"/></role>
<data><xsl:value-of select="data"/></data>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
How should I "correct data in "authentication/data/loged" ?
Gerritjan Koekkoek
Op 30-mei-05 om 0:10 heeft WeeZard het volgende geschreven:
You could do something like this (just a sketch):
<map:select type="parameter">
<map:parameter name="parameter-selector-test"
value="{session-context:authentication/authentication/data/loged}"/>
<map:when test="yes">
... user is already loged in
</map:when>
<map:otherwise>
... user hasnt loged in yet ...
</map:otherwise>
</map:select>
You have to prepare correct data in "authentication/data/loged" when
authenticating user.
This is probably just one solution. It's the first one that comes to
my mind at the moment.
Weez
----- Original Message ----- From: "gerritjan"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, May 29, 2005 9:26 PM
Subject: Authentication feedback
I've create a page wher a user can enter his/her login credentials
If succesful a page shows with secured information
If not succesful a page with a error message shows up...
so far so good
The problem is that if that user returns to the login page (in my
cases; it happens to be the home page of the site, so this is likely
to happen)
there is no feedback about the session; one can not see if already
logged in.
If credentials are entered again a hidious cocoon error happens.
My idea was to change the xslt that generates the login-page becomes
session aware
If no session aware generate username and password field with <login>
button (as it is today)
If a session is active, show text like "welcome on our site mr x!"
and a <logout> button
I'm not succesful in understanding the example, where this, sort of,
seems to happen!
can anyone help me with this:
following are the parts of my sitemap:
<map:component-configurations>
<authentication-manager>
<handlers>
<handler name="alleen_voor_leden">
<redirect-to uri="aanmeldfout.html"/>
<authentication uri="cocoon:raw:/cdls_authenticate"/>
</handler>
</handlers>
</authentication-manager>
<map:pipeline>
<!-- ================= -->
<!-- login page -->
<!-- ================= -->
<map:match pattern="cdls_login">
<map:act type="auth-login">
<map:parameter name="handler" value="alleen_voor_leden"/>
<map:parameter name="parameter_user_id"
value="{request-param:username}"/>
<map:parameter name="parameter_password"
value="{request-param:wachtwoord}"/>
<map:redirect-to uri="service_submenu_kinderen.html"/>
</map:act>
<!-- failed: -->
<map:redirect-to uri="aanmeldfout.html"/>
</map:match>
<!-- This is the authentication resource -->
<map:match pattern="cdls_authenticate">
<map:generate src="authentication/userlist_cdls-nl.xml"/>
<map:transform src="authentication/authenticate.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
Gerritjan Koekkoek
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]