You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2014/06/12 10:08:30 UTC

svn commit: r1602088 - in /openmeetings: branches/3.0.x/src/install/java/org/apache/openmeetings/cli/ branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ branches/3.0.x/src/web/java/org/apache/openmeetings/web/app/ trunk/singlewebapp/...

Author: solomax
Date: Thu Jun 12 08:08:30 2014
New Revision: 1602088

URL: http://svn.apache.org/r1602088
Log:
[OPENMEETINGS-1017] ACLs work as expected in clean install

Modified:
    openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/cli/Admin.java
    openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java
    openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/app/WebSession.java
    openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
    openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java

Modified: openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/cli/Admin.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/cli/Admin.java?rev=1602088&r1=1602087&r2=1602088&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/cli/Admin.java (original)
+++ openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/cli/Admin.java Thu Jun 12 08:08:30 2014
@@ -564,7 +564,7 @@ public class Admin {
 		}
 	}
 	
-	public static void dropDB() throws Exception {
+	public void dropDB() throws Exception {
 		File conf = new File(OmFileHelper.getWebinfDir(), PERSISTENCE_NAME);
 		ConnectionProperties connectionProperties = ConnectionPropertiesPatcher.getConnectionProperties(conf);
 		immediateDropDB(connectionProperties);
@@ -580,7 +580,21 @@ public class Admin {
 		return (LogImpl)conf.getLog(JDBCConfiguration.LOG_SCHEMA);
 	}
 
-	private static void immediateDropDB(ConnectionProperties props) throws Exception {
+	private static void runSchemaTool(JDBCConfigurationImpl conf, String action) throws Exception {
+		SchemaTool st = new SchemaTool(conf, action);
+		st.setIgnoreErrors(true);
+		st.setOpenJPATables(true);
+		st.setIndexes(false);
+		st.setPrimaryKeys(false);
+		if (!SchemaTool.ACTION_DROPDB.equals(action)) {
+			st.setSchemaGroup(st.getDBSchemaGroup());
+		}
+		st.run();
+	}
+	
+	private void immediateDropDB(ConnectionProperties props) throws Exception {
+		ctx.destroy();
+		ctx = null;
     	JDBCConfigurationImpl conf = new JDBCConfigurationImpl();
         try {
         	conf.setPropertiesFile(new File(OmFileHelper.getWebinfDir(), PERSISTENCE_NAME));
@@ -590,12 +604,8 @@ public class Admin {
         	conf.setConnectionPassword(props.getPassword());
     		//HACK to suppress all warnings
     		getLogImpl(conf).setLevel(Log.INFO);
-    		SchemaTool st = new SchemaTool(conf, SchemaTool.ACTION_DROPDB);
-    		st.setIgnoreErrors(true);
-    		st.setOpenJPATables(true);
-    		st.setIndexes(false);
-    		st.setPrimaryKeys(false);
-    		st.run();
+    		runSchemaTool(conf, SchemaTool.ACTION_DROPDB);
+    		runSchemaTool(conf, SchemaTool.ACTION_CREATEDB);
         } finally {
             conf.close();
         }

Modified: openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1602088&r1=1602087&r2=1602088&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ openmeetings/branches/3.0.x/src/install/java/org/apache/openmeetings/installation/ImportInitvalues.java Thu Jun 12 08:08:30 2014
@@ -645,7 +645,7 @@ public class ImportInitvalues {
 		Set<Right> rights = UserDao.getDefaultRights();
 		rights.add(Right.Admin);
 		rights.add(Right.Soap);
-		Long user_id = userManager.registerUserInit(UserDao.getDefaultRights(), cfg.username, cfg.password, "lastname"
+		Long user_id = userManager.registerUserInit(rights, cfg.username, cfg.password, "lastname"
 				, "firstname", cfg.email, new Date() /* age/birthday */, "street", "no", "fax", "zip", 1
 				, "town", default_lang_id, false /* sendWelcomeMessage */
 				, Arrays.asList(org.getOrganisation_id()), "phone", false, false, timezoneUtil.getTimeZone(cfg.ical_timeZone),

Modified: openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/app/WebSession.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/app/WebSession.java?rev=1602088&r1=1602087&r2=1602088&view=diff
==============================================================================
--- openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/app/WebSession.java (original)
+++ openmeetings/branches/3.0.x/src/web/java/org/apache/openmeetings/web/app/WebSession.java Thu Jun 12 08:08:30 2014
@@ -116,7 +116,7 @@ public class WebSession extends Abstract
 	public void invalidate() {
 		super.invalidate();
 		userId = -1;
-		rights.clear();
+		rights = new HashSet<User.Right>();
 		SID = null;
 		sdf = null;
 		recordingId = null;

Modified: openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1602088&r1=1602087&r2=1602088&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ openmeetings/trunk/singlewebapp/openmeetings-install/src/main/java/org/apache/openmeetings/installation/ImportInitvalues.java Thu Jun 12 08:08:30 2014
@@ -645,7 +645,7 @@ public class ImportInitvalues {
 		Set<Right> rights = UserDao.getDefaultRights();
 		rights.add(Right.Admin);
 		rights.add(Right.Soap);
-		Long user_id = userManager.registerUserInit(UserDao.getDefaultRights(), cfg.username, cfg.password, "lastname"
+		Long user_id = userManager.registerUserInit(rights, cfg.username, cfg.password, "lastname"
 				, "firstname", cfg.email, new Date() /* age/birthday */, "street", "no", "fax", "zip", 1
 				, "town", default_lang_id, false /* sendWelcomeMessage */
 				, Arrays.asList(org.getOrganisation_id()), "phone", false, false, timezoneUtil.getTimeZone(cfg.ical_timeZone),

Modified: openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java
URL: http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java?rev=1602088&r1=1602087&r2=1602088&view=diff
==============================================================================
--- openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java (original)
+++ openmeetings/trunk/singlewebapp/openmeetings-web/src/main/java/org/apache/openmeetings/web/app/WebSession.java Thu Jun 12 08:08:30 2014
@@ -117,7 +117,7 @@ public class WebSession extends Abstract
 	public void invalidate() {
 		super.invalidate();
 		userId = -1;
-		rights.clear();
+		rights = new HashSet<User.Right>();
 		SID = null;
 		sdf = null;
 		recordingId = null;