Commit c079fbf8 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

1) Properties can now be retrieved from the database as long as there is a...

1) Properties can now be retrieved from the database as long as there is a connection to the database regardless if setup has been completed
2) Clearspace can now appear as the default value when running the setup and CS was the previous choice from a previous setup

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10531 b35dd754-fafc-0310-a699-88a17e54d16e
parent d18874ee
......@@ -12,10 +12,15 @@
package org.jivesoftware.util;
import org.jivesoftware.database.DbConnectionManager;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.util.*;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* Controls Jive properties. Jive properties are only meant to be set and retrieved
......@@ -774,12 +779,33 @@ public class JiveGlobals {
}
/**
* Returns true if in setup mode.
* Returns true if in setup mode. A false value means that setup has been completed
* or that a connection to the database was possible to properies stored in the
* datbase can be retrieved now. The latter means that once the database settings
* during the setup was done a connection to the datbase should be available thus
* properties stored from a previous setup will be available.
*
* @return true if in setup mode.
*/
private static boolean isSetupMode() {
return !Boolean.valueOf(JiveGlobals.getXMLProperty("setup"));
if (Boolean.valueOf(JiveGlobals.getXMLProperty("setup"))) {
return false;
}
// Check if the DB configuration is done
Connection con = null;
PreparedStatement pstmt = null;
try {
con = DbConnectionManager.getConnection();
// Properties can now be loaded from DB so consider setup done
}
catch (SQLException e) {
// Properties cannot be loaded from DB so do not consider setup done
return true;
}
finally {
DbConnectionManager.closeConnection(pstmt, con);
}
return false;
}
/**
......
......@@ -84,7 +84,7 @@
<table cellpadding="3" cellspacing="2" border="0">
<tr>
<td align="center" valign="top">
<input type="radio" name="mode" value="default" id="rb01" <% if (!isLDAP) { %>checked<% } %>>
<input type="radio" name="mode" value="default" id="rb01" <% if (!isLDAP && !isCLEARSPACE) { %>checked<% } %>>
</td>
<td>
<label for="rb01"><b><fmt:message key="setup.profile.default" /></b></label><br>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment