Hello, :-(

I try to modify the protected example for managing authentification.
So, I added this sentence in the hsqldb database WEB-INF/db/cocoondb.script :
CREATE TABLE IDENTIFICATION_TABLE(ID INTEGER,NAME VARCHAR,PASSWORD VARCHAR,UNIQUE(ID))

I populated the base with two records
INSERT INTO IDENTIFICATION_TABLE VALUES(1,'Redacteur','password')
INSERT INTO IDENTIFICATION_TABLE VALUES(2,'Lecteur','password')

I changed login.xml in order to have two textboxes
            <input type="text" name="name"/>
            <input type="password" name="password"/>

I changed the sitemap like this :
            <map:match pattern="do-login">
                <!-- first validate whether submitted values are ok -->
                <map:act type="form-validator">
                    <map:parameter name="descriptor" value="context://protected/descriptors/params.xml"/>
                    <map:parameter name="validate" value="name"/>
                    <map:parameter name="validate" value="password"/>
                    <!-- now try to log in -->
                    <map:act type="db-authenticator">
                        <map:parameter name="descriptor" value="context://protected/descriptors/auth.xml"/>
                        <!-- now go to protected area -->
                        <map:redirect-to uri="protected"/>
                    </map:act>
                </map:act>
                <!-- something was wrong, try it again -->
                <map:redirect-to uri="login"/>
            </map:match>

I changed params.xml like this :
<parameters-descriptor>
    <parameter name="name" type="string" nullable="no"/>
    <parameter name="password" type="string" nullable="no"/>
</parameters-descriptor>

And the auth.xml like this :
<auth-descriptor>
    <connection>personnel</connection>
    <table name="identification_table">
         <select dbcol="name" request-param="name" to-session=" name"/>
        <select dbcol="password" request-param="password " to-session="password"/>
    </table>
</auth-descriptor>

The login page work, but the site don't recognize me, when i try to log with any of the base entry.
I tried to upcase a lot of thing without a lot of thing.
I feel that the solution isn't very far,

Please give me your help please !

Xavier
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to