You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2005/02/12 05:04:50 UTC
svn commit: r153483 -
cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
Author: antonio
Date: Fri Feb 11 20:04:48 2005
New Revision: 153483
URL: http://svn.apache.org/viewcvs?view=rev&rev=153483
Log:
Format code
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java?view=diff&r1=153482&r2=153483
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/DefaultAuthenticationManager.java Fri Feb 11 20:04:48 2005
@@ -202,43 +202,43 @@
Authenticator authenticator = this.lookupAuthenticator( config );
try {
Authenticator.AuthenticationResult result = authenticator.authenticate( config, parameters );
- if ( result != null && result.valid ) {
- AuthenticationContext authContext = new AuthenticationContext(this.context, this.xpathProcessor, this.resolver);
- handler = new UserHandler(config, authContext);
- // store the authentication data in the context
- authContext.init(result.result);
- } else if ( result != null ) {
- // now set the failure information in the temporary context
- ContextManager contextManager = null;
- try {
- contextManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
- SessionContext temp = contextManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
-
- final DocumentFragment fragment = result.result.createDocumentFragment();
- final Node root = result.result.getDocumentElement();
- root.normalize();
- Node child;
- boolean appendedNode = false;
- while (root.hasChildNodes() ) {
- child = root.getFirstChild();
- root.removeChild(child);
- // Leave out empty text nodes before any other node
- if (appendedNode
- || child.getNodeType() != Node.TEXT_NODE
- || child.getNodeValue().trim().length() > 0) {
- fragment.appendChild(child);
- appendedNode = true;
+ if (result != null) {
+ if (result.valid) {
+ AuthenticationContext authContext = new AuthenticationContext(this.context, this.xpathProcessor, this.resolver);
+ handler = new UserHandler(config, authContext);
+ // store the authentication data in the context
+ authContext.init(result.result);
+ } else {
+ // now set the failure information in the temporary context
+ ContextManager contextManager = null;
+ try {
+ contextManager = (ContextManager) this.manager.lookup( ContextManager.ROLE );
+ SessionContext temp = contextManager.getContext( SessionConstants.TEMPORARY_CONTEXT );
+
+ final DocumentFragment fragment = result.result.createDocumentFragment();
+ final Node root = result.result.getDocumentElement();
+ root.normalize();
+ Node child;
+ boolean appendedNode = false;
+ while (root.hasChildNodes() ) {
+ child = root.getFirstChild();
+ root.removeChild(child);
+ // Leave out empty text nodes before any other node
+ if (appendedNode
+ || child.getNodeType() != Node.TEXT_NODE
+ || child.getNodeValue().trim().length() > 0) {
+ fragment.appendChild(child);
+ appendedNode = true;
+ }
}
+ temp.appendXML("/", fragment);
+ } catch ( ServiceException se ) {
+ throw new ProcessingException("Unable to lookup session manager.", se);
+ } finally {
+ this.manager.release( contextManager );
}
- temp.appendXML("/", fragment);
- } catch ( ServiceException se ) {
- throw new ProcessingException("Unable to lookup session manager.", se);
- } finally {
- this.manager.release( contextManager );
}
-
}
-
} finally {
this.releaseAuthenticator( authenticator, config );
}