Robin Wyles wrote:
>Hi All...
>
>I am new to Cocoon 2 and am currently prototyping a login/authentication
>routine. I am using SessionIsValidAction to check if the user is logged in,
>and if this fails they are redirected to the login page, the
>DatabaseAuthenticatorAction is then used to check the user's submitted login
>details against values stored in a database. This all works great.
>
>Now I would like to be able to save the original request URI before the
>SessionIsValidAction is called so I can then re-direct the user to when the
>DatabaseAuthenticatorAction is successful. Here are the pipeline fragments
>that control this:
>
><!-- Check if user is logged in -->
> <map:match pattern="app/*.xml*">
> <map:act type="session-isvalid">
> <!-- user is logged in -->
> <map:generate type="file" src="app/{../1}.xml" />
> <map:transform src="app/default.xsl" />
> <map:serialize />
> </map:act>
> <!-- use is not logged in - redirect to login -->
> <map:generate type="file" src="app/login.xml" />
> <map:transform src="app/default.xsl" />
> <map:serialize />
> </map:match>
>
><!-- Do login -->
> <map:match pattern="app/sign-in*">
> <map:act set="checkUser">
> <map:parameter name="descriptor"
>value="app/users_descriptor.xml" />
> <!-- Re-direct to original requestURI here -->
> </map:act>
> <!-- User cannot be authenticated - back to login -->
> <map:generate type="file" src="app/login.xml" />
> <map:transform src="app/default.xsl" />
> <map:serialize />
> </map:match>
>
>Can I do this using the default set of actions that come with Cocoon 2? I
>know that I can set a session attribute using the sessionPropagatorAction,
>but how do I read it again? I also know I can read a request parameter using
>the RequestParamAction but how do I set a request parameter?
>
>I would like to do this within the sitemap rather than resorting to XSP if
>possible.
>
>Thanks in advance,
>
>Robin Wyles
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]>
>
see http://java.sun.com/products/servlet/2.2/javadoc/ and
http://xml.apache.org/cocoon/apidocs/index.html
Regards.
Yury.
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>