Author: michiel
Date: 2009-06-30 20:07:44 +0200 (Tue, 30 Jun 2009)
New Revision: 36512
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloudContext.java
Log:
moved the in-log part to BasicCloudContext which seems more clear
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
===================================================================
---
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
2009-06-30 13:58:19 UTC (rev 36511)
+++
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloud.java
2009-06-30 18:07:44 UTC (rev 36512)
@@ -95,37 +95,7 @@
account = cloud.account;
}
- /**
- * @param name name of cloud
- * @param authenticationType authentication type
- * @param loginInfo Map with login credentials
- * @param cloudContext cloudContext of cloud
- * @throws NotFoundException If MMBase not yet started, or shutting down.
- * @throws BridgeException No security could be obtained.
- * @throws SecurityException Could not perform login
- */
- BasicCloud(String name, String authenticationType, Map<String, ?>
loginInfo, BasicCloudContext cloudContext) {
- // get the cloudcontext and mmbase root...
- this.cloudContext = cloudContext;
- init();
- userContext =
BasicCloudContext.mmb.getMMBaseCop().getAuthentication().login(authenticationType,
loginInfo, null);
- if (userContext == null) {
- log.debug("Login failed");
- throw new java.lang.SecurityException("Login invalid
(login-module: " + authenticationType + " on " +
BasicCloudContext.mmb.getMMBaseCop().getAuthentication());
- }
- // end authentication...
- if (userContext.getAuthenticationType() == null) {
- log.warn("Security implementation did not set 'authentication
type' in the user object.");
- }
-
- // normally, we want the cloud to read it's context from an xml file.
- // the current system does not support multiple clouds yet,
- // so as a temporary hack we set default values
- this.name = name;
- description = name;
- }
-
/**
* @param name name of cloud
* @param authenticationType authentication type
Modified:
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloudContext.java
===================================================================
---
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloudContext.java
2009-06-30 13:58:19 UTC (rev 36511)
+++
mmbase/trunk/core/src/main/java/org/mmbase/bridge/implementation/BasicCloudContext.java
2009-06-30 18:07:44 UTC (rev 36512)
@@ -150,7 +150,17 @@
public Cloud getCloud(String cloudName, String authenticationType,
Map<String, ?> loginInfo) throws NotFoundException {
checkExists(cloudName);
- return new BasicCloud(cloudName, authenticationType, loginInfo, this);
+ UserContext userContext =
mmb.getMMBaseCop().getAuthentication().login(authenticationType, loginInfo,
null);
+ if (userContext == null) {
+ log.debug("Login failed");
+ throw new java.lang.SecurityException("Login invalid
(login-module: " + authenticationType + " on " +
BasicCloudContext.mmb.getMMBaseCop().getAuthentication());
+ }
+ // end authentication...
+
+ if (userContext.getAuthenticationType() == null) {
+ log.warn("Security implementation did not set 'authentication
type' in the user object.");
+ }
+ return getCloud(cloudName, userContext);
}
public Cloud getCloud(String cloudName, UserContext user) throws
NotFoundException {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs