Author: keith
Date: Tue Dec 18 01:18:36 2007
New Revision: 11358

Log:

Need to check whether the users exist before adding them



Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Tue Dec 18 01:18:36 2007
@@ -684,13 +684,15 @@
             realm.init(config);
 
             UserStoreAdmin us = realm.getUserStoreAdmin();
-            
-            us.addUser(RegistryConstants.ANONYMOUS_USER, 
RegistryConstants.ANONYMOUS_PASSWORD);
-            us.addUser(RegistryConstants.ADMIN_USER, 
RegistryConstants.ADMIN_PASSWORD);
-            us.addUser(RegistryConstants.SYSTEM_USER, 
RegistryConstants.SYSTEM_PASSWORD);
-            us.addUser(MashupConstants.SAMPLES_USER, 
MashupConstants.SAMPLES_USER_PASSWORD);
-            us.addRole(RegistryConstants.ADMIN_ROLE);
-            us.addRole(RegistryConstants.EVERYONE_ROLE);
+
+            if (!us.isExistingUser(RegistryConstants.ANONYMOUS_USER)) {
+                us.addUser(RegistryConstants.ANONYMOUS_USER, 
RegistryConstants.ANONYMOUS_PASSWORD);
+                us.addUser(RegistryConstants.ADMIN_USER, 
RegistryConstants.ADMIN_PASSWORD);
+                us.addUser(RegistryConstants.SYSTEM_USER, 
RegistryConstants.SYSTEM_PASSWORD);
+                us.addUser(MashupConstants.SAMPLES_USER, 
MashupConstants.SAMPLES_USER_PASSWORD);
+                us.addRole(RegistryConstants.ADMIN_ROLE);
+                us.addRole(RegistryConstants.EVERYONE_ROLE);
+            }
 
             RegistryDataSource datasource = new 
RegistryDataSource(registryUrl, registryDriverClass,
                                                           registryUsername, 
registryPassword);

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to