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 2013/09/12 10:31:59 UTC

svn commit: r1522480 - in /openmeetings/branches/2.x/src/org/apache/openmeetings: cli/ installation/ persistence/beans/basic/ servlet/outputhandler/ test/ utils/

Author: solomax
Date: Thu Sep 12 08:31:58 2013
New Revision: 1522480

URL: http://svn.apache.org/r1522480
Log:
[OPENMEETINGS-763] --drop cli option is fixed

Added:
    openmeetings/branches/2.x/src/org/apache/openmeetings/utils/UserHelper.java
Modified:
    openmeetings/branches/2.x/src/org/apache/openmeetings/cli/Admin.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionProperties.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionPropertiesPatcher.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/installation/ImportInitvalues.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/installation/InstallationConfig.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/servlet/outputhandler/Install.java
    openmeetings/branches/2.x/src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/cli/Admin.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/cli/Admin.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/cli/Admin.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/cli/Admin.java Thu Sep 12 08:31:58 2013
@@ -18,6 +18,9 @@
  */
 package org.apache.openmeetings.cli;
 
+import static org.apache.openmeetings.utils.UserHelper.getMinPasswdLength;
+import static org.apache.openmeetings.utils.UserHelper.invalidPassword;
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
@@ -36,7 +39,12 @@ import org.apache.commons.cli.ParseExcep
 import org.apache.commons.cli.Parser;
 import org.apache.commons.cli.PosixParser;
 import org.apache.commons.transaction.util.FileHelper;
-import org.apache.openjpa.jdbc.meta.MappingTool;
+import org.apache.openjpa.jdbc.conf.JDBCConfiguration;
+import org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl;
+import org.apache.openjpa.jdbc.schema.SchemaTool;
+import org.apache.openjpa.lib.log.Log;
+import org.apache.openjpa.lib.log.LogFactoryImpl.LogImpl;
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
 import org.apache.openmeetings.data.file.dao.FileExplorerItemDao;
 import org.apache.openmeetings.data.flvrecord.FlvRecordingDao;
 import org.apache.openmeetings.data.user.dao.UsersDao;
@@ -94,7 +102,7 @@ public class Admin {
 		options.addOption(new OmOption("i", "email", null, true, "Email of the default user (mutually exclusive with 'file')"));
 		options.addOption(new OmOption("i", "group", null, true, "The name of the default user group (mutually exclusive with 'file')"));
 		options.addOption(new OmOption("i", "tz", null, true, "Default server time zone, and time zone for the selected user (mutually exclusive with 'file')"));
-		options.addOption(new OmOption("i", null, "password", true, "Password of the default user, minimum " + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH + " characters (will be prompted if not set)", true));
+		options.addOption(new OmOption("i", null, "password", true, "Password of the default user, minimum " + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH + " characters (will be prompted if not set)", true));
 		options.addOption(new OmOption("i", null, "system-email-address", true, "System e-mail address [default: " + cfg.mailReferer + "]", true));
 		options.addOption(new OmOption("i", null, "smtp-server", true, "SMTP server for outgoing e-mails [default: " + cfg.smtpServer + "]", true));
 		options.addOption(new OmOption("i", null, "smtp-port", true, "SMTP server for outgoing e-mails [default: " + cfg.smtpPort + "]", true));
@@ -239,7 +247,7 @@ public class Admin {
 					if (!conf.exists() || cmdl.hasOption("db-type") || cmdl.hasOption("db-host") || cmdl.hasOption("db-port") || cmdl.hasOption("db-name") || cmdl.hasOption("db-user") || cmdl.hasOption("db-pass")) {
 						String dbType = cmdl.getOptionValue("db-type", "derby");
 						File srcConf = new File(OmFileHelper.getWebinfDir(), "classes/META-INF/" + dbType + "_persistence.xml");
-						ConnectionPropertiesPatcher.getPatcher(dbType).patch(
+						ConnectionPropertiesPatcher.getPatcher(dbType, connectionProperties).patch(
 								srcConf
 								, conf
 								, cmdl.getOptionValue("db-host", "localhost")
@@ -247,7 +255,6 @@ public class Admin {
 								, cmdl.getOptionValue("db-name", null)
 								, cmdl.getOptionValue("db-user", null)
 								, cmdl.getOptionValue("db-pass", null)
-								, connectionProperties
 								);
 					} else {
 						//get properties from existent persistence.xml
@@ -261,11 +268,11 @@ public class Admin {
 						importInit.loadSystem(cfg, force); 
 						restoreOm(ctxName, backup);
 					} else {
-						AdminUserDetails admin = checkAdminDetails(ctxName);
+						checkAdminDetails(ctxName);
 						dropDB(connectionProperties);
 						
 						ImportInitvalues importInit = getApplicationContext(ctxName).getBean(ImportInitvalues.class);
-						importInit.loadAll(cfg, admin.login, admin.pass, admin.email, admin.group, admin.tz, force);
+						importInit.loadAll(cfg, force);
 					}					
 					
 					InstallationDocumentHandler.createDocument(3);
@@ -513,54 +520,46 @@ public class Admin {
 		return result;
 	}
 	
-	private class AdminUserDetails {
-		String login = null;
-		String email = null;
-		String group = null;
-		String pass = null;
-		String tz = null;
-	}
-	
-	private AdminUserDetails checkAdminDetails(String ctxName) throws Exception {
-		AdminUserDetails admin = new AdminUserDetails();
-		admin.login = cmdl.getOptionValue("user");
-		admin.email = cmdl.getOptionValue("email");
-		admin.group = cmdl.getOptionValue("group");
-		if (admin.login == null || admin.login.length() < InstallationConfig.USER_LOGIN_MINIMUM_LENGTH) {
+	private void checkAdminDetails(String ctxName) throws Exception {
+		cfg.username = cmdl.getOptionValue("user");
+		cfg.email = cmdl.getOptionValue("email");
+		cfg.group = cmdl.getOptionValue("group");
+		if (cfg.username == null || cfg.username.length() < InstallationConfig.USER_LOGIN_MINIMUM_LENGTH) {
 			System.out.println("User login was not provided, or too short, should be at least " + InstallationConfig.USER_LOGIN_MINIMUM_LENGTH + " character long.");
 			System.exit(1);
 		}
 		
 		try {
-			if (!MailUtil.matches(admin.email)) {
+			if (!MailUtil.matches(cfg.email)) {
 			    throw new AddressException("Invalid address");
 			}
-			new InternetAddress(admin.email, true);
+			new InternetAddress(cfg.email, true);
 		} catch (AddressException ae) {
-			System.out.println("Please provide non-empty valid email: '" + admin.email + "' is not valid.");
+			System.out.println("Please provide non-empty valid email: '" + cfg.email + "' is not valid.");
 			System.exit(1);
 		}
-		if (admin.group == null || admin.group.length() < 1) {
-			System.out.println("User group was not provided, or too short, should be at least 1 character long: " + admin.group);
+		if (cfg.group == null || cfg.group.length() < 1) {
+			System.out.println("User group was not provided, or too short, should be at least 1 character long: " + cfg.group);
 			System.exit(1);
 		}
-		admin.pass = cmdl.getOptionValue("password");
-		if (checkPassword(admin.pass)) {
-			System.out.print("Please enter password for the user '" + admin.login + "':");
-			admin.pass = new BufferedReader(new InputStreamReader(System.in)).readLine();
-			if (checkPassword(admin.pass)) {
-				System.out.println("Password was not provided, or too short, should be at least " + InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH + " character long.");
+		cfg.password = cmdl.getOptionValue("password");
+		ConfigurationDao cfgDao = getApplicationContext(ctxName).getBean(ConfigurationDao.class);
+		if (invalidPassword(cfg.password, cfgDao)) {
+			System.out.print("Please enter password for the user '" + cfg.username + "':");
+			cfg.password = new BufferedReader(new InputStreamReader(System.in)).readLine();
+			if (invalidPassword(cfg.password, cfgDao)) {
+				System.out.println("Password was not provided, or too short, should be at least " + getMinPasswdLength(cfgDao) + " character long.");
 				System.exit(1);
 			}
 		}
 		ImportInitvalues importInit = getApplicationContext(ctxName).getBean(ImportInitvalues.class);
 		Map<String, String> tzMap = ImportHelper.getAllTimeZones(importInit.getTimeZones());
-		admin.tz = null;
+		cfg.ical_timeZone = null;
 		if (cmdl.hasOption("tz")) {
-			admin.tz = cmdl.getOptionValue("tz");
-			admin.tz = tzMap.containsKey(admin.tz) ? admin.tz : null;
+			cfg.ical_timeZone = cmdl.getOptionValue("tz");
+			cfg.ical_timeZone = tzMap.containsKey(cfg.ical_timeZone) ? cfg.ical_timeZone : null;
 		}
-		if (admin.tz == null) {
+		if (cfg.ical_timeZone == null) {
 			System.out.println("Please enter timezone, Possible timezones are:");
 			
 			for (String tzIcal : tzMap.keySet()) {
@@ -568,11 +567,6 @@ public class Admin {
 			}
 			System.exit(1);
 		}
-		return admin;
-	}
-	
-	private boolean checkPassword(String pass) {
-		return (pass == null || pass.length() < InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH);
 	}
 	
 	public static void dropDB() throws Exception {
@@ -587,16 +581,29 @@ public class Admin {
 		}
 	}
 	
+	private static LogImpl getLogImpl(JDBCConfiguration conf) {
+		return (LogImpl)conf.getLog(JDBCConfiguration.LOG_SCHEMA);
+	}
+	
 	private static void immediateDropDB(ConnectionProperties props) throws Exception {
-		String[] args = {
-				"-schemaAction", "retain,drop"
-				, "-properties", new File(OmFileHelper.getWebinfDir(), PERSISTENCE_NAME).getCanonicalPath()
-				, "-connectionDriverName", props.getDriver()
-				, "-connectionURL", props.getURL()
-				, "-connectionUserName", props.getLogin()
-				, "-connectionPassword", props.getPassword()
-				, "-ignoreErrors", "true"};
-		MappingTool.main(args);
+    	JDBCConfigurationImpl conf = new JDBCConfigurationImpl();
+        try {
+        	conf.setPropertiesFile(new File(OmFileHelper.getWebinfDir(), PERSISTENCE_NAME));
+        	conf.setConnectionDriverName(props.getDriver());
+        	conf.setConnectionURL(props.getURL());
+        	conf.setConnectionUserName(props.getLogin());
+        	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();
+        } finally {
+            conf.close();
+        }
 	}
 	
 	private File checkRestoreFile(String file) {

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionProperties.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionProperties.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionProperties.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionProperties.java Thu Sep 12 08:31:58 2013
@@ -19,11 +19,19 @@
 package org.apache.openmeetings.cli;
 
 public class ConnectionProperties {
+	public enum DbType {
+		db2
+		, derby
+		, mysql
+		, oracle
+		, postgresql
+	}
 
 	private String driver = "org.apache.derby.jdbc.ClientDriver";
 	private String url = "jdbc:derby:openmeetings";
 	private String login = "user";
 	private String password = "secret";
+	private DbType dbType = DbType.derby;
 
 	public String getDriver() {
 		return driver;
@@ -57,9 +65,16 @@ public class ConnectionProperties {
 		this.password = connectionPass;
 	}
 
+	public DbType getDbType() {
+		return dbType;
+	}
+
+	public void setDbType(DbType dbType) {
+		this.dbType = dbType;
+	}
 	@Override
 	public String toString() {
-		return "ConnectionProperties [driver=" + driver + ", url=" + url
+		return "ConnectionProperties [type=" + dbType + ", driver=" + driver + ", url=" + url
 				+ ", login=" + login + ", password=" + password + "]";
 	}
 }

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionPropertiesPatcher.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionPropertiesPatcher.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionPropertiesPatcher.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/cli/ConnectionPropertiesPatcher.java Thu Sep 12 08:31:58 2013
@@ -33,6 +33,7 @@ import javax.xml.xpath.XPathFactory;
 
 import org.apache.commons.lang3.StringEscapeUtils;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.openmeetings.cli.ConnectionProperties.DbType;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -41,16 +42,8 @@ public abstract class ConnectionProperti
 	protected static final String URL_PREFIX = "Url=";
 	protected ConnectionProperties connectionProperties;
 	
-	public enum PatcherType {
-		db2
-		, derby
-		, mysql
-		, oracle
-		, postgres
-	}
-	
-	static ConnectionPropertiesPatcher getPatcher(String _dbType) {
-		PatcherType dbType = PatcherType.valueOf(_dbType);
+	static ConnectionPropertiesPatcher getPatcher(String _dbType, ConnectionProperties connectionProperties) {
+		DbType dbType = DbType.valueOf(_dbType);
 		ConnectionPropertiesPatcher patcher = null;
 		switch (dbType) {
 			case db2:
@@ -62,7 +55,7 @@ public abstract class ConnectionProperti
 			case oracle:
 				patcher = new OraclePatcher();
 				break;
-			case postgres:
+			case postgresql:
 				patcher = new PostgresPatcher();
 				break;
 			case derby:
@@ -70,6 +63,7 @@ public abstract class ConnectionProperti
 				patcher = new DerbyPatcher();
 				break;
 		}
+		patcher.connectionProperties = connectionProperties;
 		return patcher;
 	}
 	
@@ -98,8 +92,7 @@ public abstract class ConnectionProperti
 		return element.getAttributeNode("value");
 	}
 	
-	public void patch(File srcXml, File destXml, String host, String port, String db, String user, String pass, ConnectionProperties connectionProperties) throws Exception {
-		this.connectionProperties = connectionProperties;
+	public void patch(File srcXml, File destXml, String host, String port, String db, String user, String pass) throws Exception {
 		Document doc = getDocument(srcXml);
 		
 		Attr val = getConnectionProperties(doc);
@@ -157,6 +150,13 @@ public abstract class ConnectionProperti
 			}
 			prop = getPropFromPersistence(tokens, i, "Url");
 			if (prop != null) {
+				try {
+					//will try to "guess" dbType
+					String[] parts = prop.split(":");
+					connectionProperties.setDbType(DbType.valueOf(parts[1]));
+				} catch (Exception e) {
+					//ignore
+				}
 				connectionProperties.setURL(prop);
 			}
 		}

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/installation/ImportInitvalues.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/installation/ImportInitvalues.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/installation/ImportInitvalues.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/installation/ImportInitvalues.java Thu Sep 12 08:31:58 2013
@@ -672,27 +672,24 @@ public class ImportInitvalues {
 		}
 	}
 
-	public void loadInitUserAndOrganisation(String username, String userpass,
-			String email, String defaultOrganisationName, String ical_timeZone,
-			String configdefaultLang) {
+	public void loadInitUserAndOrganisation(InstallationConfig cfg) {
 		// Add user
 		try {
 
-			Long default_lang_id = Long.parseLong(configdefaultLang);
+			Long default_lang_id = Long.parseLong(cfg.defaultLangId);
 			if (default_lang_id == null)
 				default_lang_id = 1L;
 
 			// Add default group
-			Long organisation_id = organisationManager.addOrganisation(
-					defaultOrganisationName, 1);
+			Long organisation_id = organisationManager.addOrganisation(cfg.group, 1);
 
 			// BaseUrl as param is empty as we do not send an EMAIL here
 			Long user_id = userManager.registerUserInit(new Long(3), 3, 1,
-					1, username, userpass, "lastname", "firstname", email,
+					1, cfg.username, cfg.password, "lastname", "firstname", cfg.email,
 					new java.util.Date(), "street", "no", "fax", "zip", 1,
 					"town", default_lang_id, false,
 					Arrays.asList(organisation_id), "phone", false, "", false,
-					omTimeZoneDaoImpl.getOmTimeZoneByIcal(ical_timeZone),
+					omTimeZoneDaoImpl.getOmTimeZoneByIcal(cfg.ical_timeZone),
 					false, "", "", false, true);
 
 			log.debug("Installation - User Added user-Id " + user_id);
@@ -1020,17 +1017,14 @@ public class ImportInitvalues {
 		loadConfiguration(cfg);
 	}
 
-	public void loadAll(InstallationConfig cfg, String username,
-			String userpass, String useremail, String groupame,
-			String timeZone, boolean force) throws Exception {
+	public void loadAll(InstallationConfig cfg, boolean force) throws Exception {
 		// FIXME dummy check if installation was performed before
 		if (!force && usersDao.getAllUsers().size() > 0) {
 			log.debug("System contains users, no need to install data one more time.");
 			return;
 		}
 		loadSystem(cfg, force);
-		loadInitUserAndOrganisation(username, userpass, useremail, groupame,
-				timeZone, cfg.defaultLangId);
+		loadInitUserAndOrganisation(cfg);
 
 		loadDefaultRooms("1".equals(cfg.createDefaultRooms));
 	}

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/installation/InstallationConfig.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/installation/InstallationConfig.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/installation/InstallationConfig.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/installation/InstallationConfig.java Thu Sep 12 08:31:58 2013
@@ -18,11 +18,18 @@
  */
 package org.apache.openmeetings.installation;
 
+import java.io.Serializable;
 import org.apache.openmeetings.utils.crypt.MD5Implementation;
 
-public class InstallationConfig {
+public class InstallationConfig implements Serializable {
+	private static final long serialVersionUID = 8833208340193880562L;
 	public static final int USER_LOGIN_MINIMUM_LENGTH = 4;
 	public static final int USER_PASSWORD_MINIMUM_LENGTH = 4;
+	public String appName = "Openmeetings";
+	public String username;
+	public String password;
+	public String email;
+	public String group;
 	public String allowFrontendRegister = "1";
 	public String createDefaultRooms = "1";
 	public String ical_timeZone = "Europe/Berlin";
@@ -42,7 +49,7 @@ public class InstallationConfig {
 	public String imageMagicPath = "";
 	public String ffmpegPath = "";
 	public String soxPath = "";
-	public String jodPath = "./jod/lib";
+	public String jodPath = "/opt/jod/lib";
 	public String officePath = "";
 	
 	public String defaultLangId = "1";
@@ -51,7 +58,7 @@ public class InstallationConfig {
 	public String urlFeed2 = "http://mail-archives.apache.org/mod_mbox/openmeetings-dev/?format=atom";
 	public String sendEmailWithVerficationCode = "0";
 	public String defaultExportFont = "TimesNewRoman";
-    public String red5SipEnable = "yes";
+    public String red5SipEnable = "no";
     public String red5SipRoomPrefix = "400";
     public String red5SipExtenContext = "rooms";
     public String replyToOrganizer = "1";

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/persistence/beans/basic/Configuration.java Thu Sep 12 08:31:58 2013
@@ -57,6 +57,8 @@ import org.simpleframework.xml.Root;
 public class Configuration implements Serializable, IDataProviderEntity {
 	private static final long serialVersionUID = -6129473946508963339L;
 	public static final String DEFAUT_LANG_KEY = "default_lang_id";
+	public static final String PASS_MIN_LENGTH_KEY = "user.pass.minimum.length";
+	public static final String LOGIN_MIN_LENGTH_KEY = "user.login.minimum.length";
 	@Id
 	@GeneratedValue(strategy = GenerationType.IDENTITY)
 	@Column(name = "id")

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/servlet/outputhandler/Install.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/servlet/outputhandler/Install.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/servlet/outputhandler/Install.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/servlet/outputhandler/Install.java Thu Sep 12 08:31:58 2013
@@ -173,11 +173,11 @@ public class Install extends BaseVelocit
 
 					log.debug("do init installation");
 
-					String username = request.getParameter("username");
-					String userpass = request.getParameter("userpass");
-					String useremail = request.getParameter("useremail");
-					String orgname = request.getParameter("orgname");
 					InstallationConfig cfg = new InstallationConfig();
+					cfg.username = request.getParameter("username");
+					cfg.password = request.getParameter("userpass");
+					cfg.group = request.getParameter("orgname");
+					cfg.email = request.getParameter("useremail");
 					cfg.allowFrontendRegister = request.getParameter("configdefault");
 
 					cfg.mailReferer = request.getParameter("configreferer");
@@ -210,22 +210,18 @@ public class Install extends BaseVelocit
                     cfg.red5SipRoomPrefix = request.getParameter("red5sip_room_prefix");
                     cfg.red5SipExtenContext = request.getParameter("red5sip_exten_context");
 
-					String timeZone = request.getParameter("timeZone");
-					cfg.ical_timeZone = timeZone;
+					cfg.ical_timeZone = request.getParameter("timeZone");
 					
 					cfg.jodPath = request.getParameter("jod_path");
 
-					log.debug("step 0+ start init with values. " + username
-							+ " ***** " + useremail + " " + orgname + " "
+					log.debug("step 0+ start init with values. " + cfg.username
+							+ " ***** " + cfg.email + " " + cfg.group + " "
 							+ cfg);
 
-					cfg.urlFeed = getServletContext().getInitParameter(
-							"url_feed");
-					cfg.urlFeed2 = getServletContext().getInitParameter(
-							"url_feed2");
+					cfg.urlFeed = getServletContext().getInitParameter("url_feed");
+					cfg.urlFeed2 = getServletContext().getInitParameter("url_feed2");
 					
-					getBean(ImportInitvalues.class).loadAll(cfg, username,
-							userpass, useremail, orgname, timeZone, false);
+					getBean(ImportInitvalues.class).loadAll(cfg, false);
 
 					// update to next step
 					log.debug("add level to install file");

Modified: openmeetings/branches/2.x/src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java?rev=1522480&r1=1522479&r2=1522480&view=diff
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java (original)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/test/AbstractOpenmeetingsSpringTest.java Thu Sep 12 08:31:58 2013
@@ -135,7 +135,6 @@ public abstract class AbstractOpenmeetin
 	}
 	
 	private void makeDefaultScheme() throws Exception {
-		importInitvalues.loadAll(new InstallationConfig(), username, userpass,
-				useremail, orgname, timeZone, false);
+		importInitvalues.loadAll(new InstallationConfig(), false);
 	}
 }

Added: openmeetings/branches/2.x/src/org/apache/openmeetings/utils/UserHelper.java
URL: http://svn.apache.org/viewvc/openmeetings/branches/2.x/src/org/apache/openmeetings/utils/UserHelper.java?rev=1522480&view=auto
==============================================================================
--- openmeetings/branches/2.x/src/org/apache/openmeetings/utils/UserHelper.java (added)
+++ openmeetings/branches/2.x/src/org/apache/openmeetings/utils/UserHelper.java Thu Sep 12 08:31:58 2013
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.utils;
+
+import static org.apache.openmeetings.installation.InstallationConfig.USER_LOGIN_MINIMUM_LENGTH;
+import static org.apache.openmeetings.installation.InstallationConfig.USER_PASSWORD_MINIMUM_LENGTH;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.LOGIN_MIN_LENGTH_KEY;
+import static org.apache.openmeetings.persistence.beans.basic.Configuration.PASS_MIN_LENGTH_KEY;
+
+import org.apache.openmeetings.data.basic.dao.ConfigurationDao;
+
+public class UserHelper {
+	public static int getMinLoginLength(ConfigurationDao cfgDao) {
+		return cfgDao.getConfValue(LOGIN_MIN_LENGTH_KEY, Integer.class, "" + USER_LOGIN_MINIMUM_LENGTH);
+	}
+	
+	public static int getMinPasswdLength(ConfigurationDao cfgDao) {
+		return cfgDao.getConfValue(PASS_MIN_LENGTH_KEY, Integer.class, "" + USER_PASSWORD_MINIMUM_LENGTH);
+	}
+	
+	public static boolean invalidPassword(String pass, ConfigurationDao cfgDao) {
+		return (pass == null || pass.length() < getMinPasswdLength(cfgDao));
+	}
+}