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

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

Properties can now be retrieved from the database as long as there is a connection to the database regardless if setup has been completed. Fix is back but with missing IF statement.


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10548 b35dd754-fafc-0310-a699-88a17e54d16e
parent 66adbe39
......@@ -16,11 +16,11 @@ 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;
import java.text.DateFormat;
import java.util.*;
/**
* Controls Jive properties. Jive properties are only meant to be set and retrieved
......@@ -788,7 +788,28 @@ public class JiveGlobals {
* @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
if (DbConnectionManager.getConnectionProvider() == null) {
// DB setup is still not completed so setup is needed
return true;
}
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;
}
/**
......
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