antonio 2004/01/19 01:10:54
Modified:
src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/flow/javascript
auth.js
Log:
Some changes + text formatting
Revision Changes Path
1.8 +10 -11
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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- auth.js 24 Nov 2003 03:42:44 -0000 1.7
+++ auth.js 19 Jan 2004 09:10:54 -0000 1.8
@@ -59,7 +59,7 @@
function auth_checkAuthentication(handler, application) {
- var authMgr = null;
+ var authMgr;
var authenticated = false;
try {
authMgr =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE);
@@ -76,13 +76,13 @@
}
function auth_isAuthenticated(handler) {
- var authMgr = null;
+ var authMgr;
try {
// ApplicationName, do we need it?
authMgr =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE);
-
+
var userHandler = authMgr.isAuthenticated(handler);
- return (userHandler!=null);
+ return userHandler != null;
} finally {
cocoon.releaseComponent(authMgr);
}
@@ -96,8 +96,7 @@
authParams.setParameter(name.substring(10), params[name]);
}
}
-
- var authMgr = null;
+ var authMgr;
try {
authMgr =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE);
return authMgr.login( handler, application, authParams) != null;
@@ -108,16 +107,16 @@
function auth_logout(handler, modeString) {
var mode;
- if ( modeString == null || modeString == "" || modeString ==
"if-not-authenticated" ) {
+ if (modeString == null || modeString == "" || modeString ==
"if-not-authenticated") {
mode =
Packages.org.apache.cocoon.webapps.authentication.AuthenticationConstants.LOGOUT_MODE_IF_NOT_AUTHENTICATED;
- } else if ( modeString == "if-unused" ) {
+ } else if (modeString == "if-unused") {
mode =
Packages.org.apache.cocoon.webapps.authentication.AuthenticationConstants.LOGOUT_MODE_IF_UNUSED;
- } else if ( modeString == "immediately" ) {
+ } else if (modeString == "immediately") {
mode =
Packages.org.apache.cocoon.webapps.authentication.AuthenticationConstants.LOGOUT_MODE_IMMEDIATELY;
} else {
throw new Error("Unknown mode"); // " + modeString);
}
- var authMgr = null;
+ var authMgr;
try {
authMgr =
cocoon.getComponent(Packages.org.apache.cocoon.webapps.authentication.AuthenticationManager.ROLE);
var state = authMgr.getState();
@@ -131,4 +130,4 @@
} finally {
cocoon.releaseComponent(authMgr);
}
-}
\ No newline at end of file
+}