cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 321...@gmail.com
Subject Problems with authentication fw
Date Mon, 24 Jul 2006 14:39:51 GMT
Hi,
I am trying to modify the auth-fw sample, but with username & password.

the relevants parts:

login.xml:
<form target="do-login" method="post">
     <input type="text" name="username"/>
     <input type="text" name="password"/>
     <input type="submit">Login</input>
 </form>


userlist.xml:
<user>
            <name>cocoon</name>
            <pw>test</pw>
 </user>


authenticate.xsl:
<xsl:param name="name"/>
<xsl:param name="pw"/>
.
.
.
<xsl:template match="user">
    <!-- Compare the name of the user -->
    <xsl:if test="normalize-space(name) = $name" and "normalize-space(pw) =
$pw">
        <!-- found, so create the ID -->
        <ID><xsl:value-of select="name"/></ID>
    </xsl:if>
</xsl:template>

sitemap:
<map:match pattern="do-login">
        <!-- try to login -->
        <map:act type="auth-login">
          <map:parameter name="handler" value="demohandler"/>
          <map:parameter name="parameter_name"
value="{request-param:username}"/>
          <map:parameter name="parameter_pw"
value="{request-param:password}"/>
          <map:redirect-to uri="protected"/>
        </map:act>
        <!-- something was wrong, try it again -->
        <map:redirect-to uri="login"/>
      </map:match>

But that does not work. Where is my mistake ?

Thanks for helping
Marco

Mime
View raw message