You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/07/05 09:16:34 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/acting LoginAction.java
cziegeler 2002/07/05 00:16:34
Modified: src/java/org/apache/cocoon/webapps/authentication
AuthenticationConstants.java
src/java/org/apache/cocoon/webapps/authentication/acting
LoginAction.java
Log:
Changed authentication. If the authentication fails, the error information is stored into the temporary context
Revision Changes Path
1.3 +1 -8 xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/AuthenticationConstants.java
Index: AuthenticationConstants.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/AuthenticationConstants.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AuthenticationConstants.java 29 May 2002 15:58:21 -0000 1.2
+++ AuthenticationConstants.java 5 Jul 2002 07:16:33 -0000 1.3
@@ -69,13 +69,6 @@
/** The name of the authentication context. */
String SESSION_CONTEXT_NAME = "authentication";
- /**
- * The name of the request attribute containing error information for
- * a failed login to a handler. The real name of the attribute is
- * obtained by adding the handler name.
- * The value of the attribute is a document fragment.
- */
- String REQUEST_ATTRIBUTE_FAILED_LOGIN = "org.apache.cocoon.webapps.authentication.LoginFailedFor";
}
1.4 +15 -3 xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/acting/LoginAction.java
Index: LoginAction.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/webapps/authentication/acting/LoginAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LoginAction.java 25 Jun 2002 08:52:58 -0000 1.3
+++ LoginAction.java 5 Jul 2002 07:16:33 -0000 1.4
@@ -69,9 +69,16 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.webapps.authentication.AuthenticationConstants;
import org.apache.cocoon.webapps.authentication.components.AuthenticationManager;
+import org.apache.cocoon.webapps.session.SessionConstants;
+import org.apache.cocoon.webapps.session.components.SessionManager;
+import org.w3c.dom.DocumentFragment;
/**
- * This action logs the current user into a given handler
+ * This action logs the current user into a given handler. If the
+ * authentication is successful, a map is returned with the authentication
+ * information and a session is created (if it not already exists).
+ * If the authentication is not successful, the error information is stored
+ * into the temporary context.
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
* @version CVS $Id$
@@ -127,7 +134,12 @@
map = authManager.createMap();
} else {
- request.setAttribute(AuthenticationConstants.REQUEST_ATTRIBUTE_FAILED_LOGIN + handlerName, o);
+ SessionManager sessionManager = (SessionManager) this.manager.lookup(SessionManager.ROLE);
+ try {
+ sessionManager.getContext(SessionConstants.TEMPORARY_CONTEXT).appendXML("/", (DocumentFragment)o);
+ } finally {
+ this.manager.release(sessionManager);
+ }
}
} finally {
this.manager.release(authManager);
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org