upayavira 2003/09/21 04:51:08
Modified: src/blocks/authentication-fw/conf authentication-fw.xsamples
src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/flow/javascript
auth.js
src/blocks/authentication-fw/samples flow.xmap
Log:
Protected page now shows correctly on clicking on 'login' when already
authenticated.
Added reference to flow sample to blocks samples page.
Auth flow sample should now be fully working.
Revision Changes Path
1.3 +3 -0
cocoon-2.1/src/blocks/authentication-fw/conf/authentication-fw.xsamples
Index: authentication-fw.xsamples
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/authentication-fw/conf/authentication-fw.xsamples,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- authentication-fw.xsamples 7 May 2003 19:16:35 -0000 1.2
+++ authentication-fw.xsamples 21 Sep 2003 11:51:08 -0000 1.3
@@ -6,6 +6,9 @@
<sample name="Authentication Framework" href="authentication-fw/login">
This is a demo of the authentication framework integrated into Cocoon.
</sample>
+ <sample name="Authentication Framework with Flow"
href="authentication-fw/flow/login">
+ This is the same demo, but using flow instead of actions.
+ </sample>
</group>
</xsamples>
1.4 +3 -5
cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/flow/javascript/auth.js
Index: auth.js
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/flow/javascript/auth.js,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- auth.js 20 Sep 2003 21:22:33 -0000 1.3
+++ auth.js 21 Sep 2003 11:51:08 -0000 1.4
@@ -62,10 +62,7 @@
// do authentication
authenticated = authMgr.checkAuthentication(null, handler,
application);
- if (authenticated) {
- state = authMgr.getState();
- map = state.getHandler().getContext().getContextInfo();
- } else {
+ if (!authenticated) {
cocoon.redirectTo(authMgr.getForwardingURI(handler));
}
} finally {
@@ -80,7 +77,8 @@
// ApplicationName, do we need it?
authMgr =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE);
- return authMgr.isAuthenticated(handler);
+ var userHandler = authMgr.isAuthenticated(handler);
+ return (userHandler!=null);
} finally {
cocoon.releaseComponent(authMgr);
}
1.3 +2 -1 cocoon-2.1/src/blocks/authentication-fw/samples/flow.xmap
Index: flow.xmap
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/blocks/authentication-fw/samples/flow.xmap,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- flow.xmap 20 Sep 2003 21:22:33 -0000 1.2
+++ flow.xmap 21 Sep 2003 11:51:08 -0000 1.3
@@ -41,6 +41,7 @@
<!-- ================= -->
<map:match pattern="login">
<map:call function="isLoggedIn">
+ <map:parameter name="handler" value="flowdemohandler"/>
<map:parameter name="protected-redirect" value="protected"/>
<map:parameter name="failure-internal" value="internal/login"/>
</map:call>