<web-app id='/appfuse'
    document-directory="/opt/dev/tools/resin-3.0.4/webapps/appfuse">

    <database>
        <jndi-name>jdbc/appfuse</jndi-name>
        <driver type="com.mysql.jdbc.Driver">
            <url>jdbc:mysql://localhost:3306/appfuse</url>
            <user>root</user>
            <password></password>
        </driver>
    </database>

    <resource jndi-name="mail/Session" type="javax.mail.Session"> 
        <init> 
            <mail.transport.protocol>smtp</mail.transport.protocol> 
            <mail.host>localhost</mail.host> 
        </init> 
    </resource> 

    <!-- Resin-specific JdbcAuthenticator -->
    <authenticator type="com.caucho.server.security.JdbcAuthenticator">
        <init>
            <data-source>jdbc/appfuse</data-source>
            <password-query>
              SELECT username FROM app_user WHERE username=?
            </password-query>
            <cookie-auth-query>
              SELECT username FROM app_user WHERE cookie=?
            </cookie-auth-query>
            <cookie-auth-update>
              UPDATE app_user SET cookie=? WHERE username=? 
            </cookie-auth-update>
            <role-query>
              SELECT role_name FROM user_role r, app_user u
                WHERE r.username=? and r.user_id = u.id
            </role-query>
            <password-digest>none</password-digest>
        </init>
    </authenticator>

</web-app>
