You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Franco Andrao <fr...@gruppo4.com> on 2005/06/09 16:34:37 UTC
authentication-fw with mysql
Hi,
I'm trying to use the sample Authentication-fw using mysql, but
actually is not working and I'm lost.
I modify the pipelines with:
<map:pipeline internal-only="true">
<map:match pattern="authenticate">
<map:generate src="userSql.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="mdgDB"/>
<map:parameter name="show-nr-of-rows" value="true"/>
<map:parameter name="clob-encoding" value="UTF-8"/>
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:transform src="stylesheets/authenticate.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
where userSql.xml"
<?xml version="1.0" encoding="UTF-8"?>
<authentication>
<execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
<query name="authUser">
select ut_login,ut_psw from dbutenti
where
ut_login='<substitute-value name="parameter_name"/>
AND ut_psw='<substitute-value name="parameter_passwd"/>'
</query>
</execute-query>
</authentication>
and authenticate.xsl
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<xsl:param name="ut_login"/>
<xsl:param name="ut_psw"/>
<xsl:template match="authentication">
<authentication>
<xsl:apply-templates select="rowset"/>
</authentication>
</xsl:template>
<xsl:template match="row">
<!-- Compare the name of the user -->
<xsl:if test="normalize-space(ut_login) = $ut_login">
<xsl:if test="normalize-space(ut_psw) = $ut_psw">
<ID><xsl:value-of select="name"/></ID>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
The connection to the db is working but i don't know how test is the
parameter are passed properly...
Someone could help me to understand what is wrong
Thanks
Franco
Re: Betr.: authentication-fw with mysql
Posted by Franco Andrao <fr...@gruppo4.com>.
Yes, it right but it's not theonly error I made in the code. I
modify the sitemap but I don't login. Probably depends from the
authenticate.xls.
Thanks
On 09/giu/05, at 17:29, Peter.Urbanus@mediacenter.nl wrote:
> Like this
> <map:pipeline internal-only="true">
> <map:match pattern="authenticate">
> <map:generate src="userSql.xml"/>
> <map:transform type="sql">
> <map:parameter name="use-connection" value="mdgDB"/>
> <map:parameter name="show-nr-of-rows" value="true"/>
> <map:parameter name="clob-encoding" value="UTF-8"/>
> <map:parameter name="parameter_name"
> value="{request-param:parameter_name}"/>
> <map:parameter name="parameter_passwd"
> value="{request-param:parameter_passwd}"/>
> <map:parameter name="use-request-parameters"
> value="true"/>
> </map:transform>
> <map:transform src="stylesheets/authenticate.xsl">
> <map:parameter name="use-request-parameters" value="true"/>
> </map:transform>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
>
> authenticate.xsl
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
> <xsl:param name="ut_login"/>
> <xsl:param name="ut_psw"/>
>
> <xsl:template match="authentication">
> <authentication>
> <xsl:apply-templates select="rowset"/>
> </authentication>
> </xsl:template>
>
> <xsl:template match="row">
> <!-- Compare the name of the user -->
> <xsl:if test="normalize-space(ut_login) = $ut_login">
> <xsl:if test="normalize-space(ut_psw) = $ut_psw">
> <ID><xsl:value-of select="name"/></ID>
> </xsl:if>
> </xsl:if>
> </xsl:template>
>
> </xsl:stylesheet>
:-)Franco
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Betr.: authentication-fw with mysql
Posted by Pe...@mediacenter.nl.
Hi Franco
I think is's because SQLTransformer doesn't understand
use-request-parameters, you'll have to specify them explicitly: Tripped me
up a couple of times too!
Like this
<map:pipeline internal-only="true">
<map:match pattern="authenticate">
<map:generate src="userSql.xml"/>
<map:transform type="sql">
<map:parameter name="use-connection" value="mdgDB"/>
<map:parameter name="show-nr-of-rows" value="true"/>
<map:parameter name="clob-encoding" value="UTF-8"/>
<map:parameter name="parameter_name"
value="{request-param:parameter_name}"/>
<map:parameter name="parameter_passwd"
value="{request-param:parameter_passwd}"/>
<map:parameter name="use-request-parameters"
value="true"/>
</map:transform>
<map:transform src="stylesheets/authenticate.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
Franco Andrao <fr...@gruppo4.com> wrote on 09-06-2005 16:34:37:
> Hi,
> I'm trying to use the sample Authentication-fw using mysql, but
> actually is not working and I'm lost.
>
> I modify the pipelines with:
>
> <map:pipeline internal-only="true">
> <map:match pattern="authenticate">
> <map:generate src="userSql.xml"/>
> <map:transform type="sql">
> <map:parameter name="use-connection" value="mdgDB"/>
> <map:parameter name="show-nr-of-rows" value="true"/>
> <map:parameter name="clob-encoding" value="UTF-8"/>
> <map:parameter name="use-request-parameters"
value="true"/>
> </map:transform>
> <map:transform src="stylesheets/authenticate.xsl">
> <map:parameter name="use-request-parameters" value="true"/>
> </map:transform>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
>
> where userSql.xml"
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <authentication>
> <execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
> <query name="authUser">
> select ut_login,ut_psw from dbutenti
> where
> ut_login='<substitute-value name="parameter_name"/>
> AND ut_psw='<substitute-value name="parameter_passwd"/>'
> </query>
> </execute-query>
> </authentication>
>
> and authenticate.xsl
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
> <xsl:param name="ut_login"/>
> <xsl:param name="ut_psw"/>
>
> <xsl:template match="authentication">
> <authentication>
> <xsl:apply-templates select="rowset"/>
> </authentication>
> </xsl:template>
>
> <xsl:template match="row">
> <!-- Compare the name of the user -->
> <xsl:if test="normalize-space(ut_login) = $ut_login">
> <xsl:if test="normalize-space(ut_psw) = $ut_psw">
> <ID><xsl:value-of select="name"/></ID>
> </xsl:if>
> </xsl:if>
> </xsl:template>
>
> </xsl:stylesheet>
>
> The connection to the db is working but i don't know how test is the
> parameter are passed properly...
> Someone could help me to understand what is wrong
> Thanks
>
> Franco
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org