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 2003/05/04 22:30:56 UTC
cvs commit: cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components Authenticator.java
cziegeler 2003/05/04 13:30:56
Modified: src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user
UserHandler.java
src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components
Authenticator.java
Log:
Adding user id
Revision Changes Path
1.5 +25 -8 cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user/UserHandler.java
Index: UserHandler.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/user/UserHandler.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- UserHandler.java 4 May 2003 20:19:39 -0000 1.4
+++ UserHandler.java 4 May 2003 20:30:56 -0000 1.5
@@ -91,13 +91,22 @@
/** Application contexts */
private List applicationContexts;
- /**
+ /** The unique user ID */
+ private String userID;
+
+ /**
* Create a new handler object.
*/
- public UserHandler(HandlerConfiguration handler) {
+ public UserHandler(HandlerConfiguration handler)
+ throws ProcessingException {
this.handler = handler;
+ this.context = new AuthenticationContext(this);
+ this.userID = (String) this.context.getContextInfo().get("ID");
}
+ /**
+ * Are all application contexts already loaded?
+ */
public boolean getApplicationsLoaded()
throws ProcessingException {
if ( this.handler.getApplications().isEmpty() ) {
@@ -114,11 +123,6 @@
return this.context;
}
- public AuthenticationContext createContext() {
- this.context = new AuthenticationContext(this);
- return this.context;
- }
-
/**
* Create Application Context.
* This context is destroyed when the user logs out of the handler
@@ -168,10 +172,16 @@
return this.handler;
}
+ /**
+ * Is the named application context already loaded?
+ */
public boolean isApplicationLoaded(ApplicationConfiguration appConf) {
return this.loadedApps.contains( appConf );
}
+ /**
+ * Notify that the application context has been loaded
+ */
public void setApplicationIsLoaded(ApplicationConfiguration appConf) {
this.loadedApps.add( appConf );
this.appsLoaded = (this.loadedApps.size() == this.handler.getApplications().size());
@@ -201,5 +211,12 @@
manager.release( (Component)contextManager);
}
}
+ }
+
+ /**
+ * Get the unique user id
+ */
+ public String getUserId() {
+ return this.getUserId();
}
}
1.6 +2 -2 cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/Authenticator.java
Index: Authenticator.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/authentication-fw/java/org/apache/cocoon/webapps/authentication/components/Authenticator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Authenticator.java 4 May 2003 20:19:40 -0000 1.5
+++ Authenticator.java 4 May 2003 20:30:56 -0000 1.6
@@ -218,7 +218,7 @@
handler = new UserHandler(configuration);
- AuthenticationContext context = handler.createContext();
+ AuthenticationContext context = handler.getContext();
MediaManager mediaManager = null;
String mediaType;