Commit 14d7bc70 authored by Bill Lynch's avatar Bill Lynch Committed by bill

Fix to disallow access to setup tool once setup has been run.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@382 b35dd754-fafc-0310-a699-88a17e54d16e
parent abdddc35
......@@ -12,37 +12,15 @@
java.sql.Statement,
java.sql.SQLException,
java.util.Map,
org.jivesoftware.util.ClassUtils" %>
<% // Figure out if we've already run setup:
boolean doSetup = false;
//
try {
// ServiceLookup lookup = ServiceLookupFactory.getServiceLookup();
Class serviceLookupFactoryClass = loadClass("org.jivesoftware.messenger.container.ServiceLookupFactory");
Method getLookupMethod = serviceLookupFactoryClass.getMethod("getServiceLookup", (Class[])null);
Object serviceLookupObj = getLookupMethod.invoke(serviceLookupFactoryClass, (Object)null);
// Container container = (Container)lookup.lookup(Container.class);
Method lookupMethod = serviceLookupObj.getClass().getMethod("lookup", (Class[])new Class[]{java.lang.Class.class});
Object containerObj = lookupMethod.invoke(serviceLookupObj, (Object[])new Class[]{org.jivesoftware.messenger.container.Container.class});
// boolean isSetup = container.isSetupMode()
Method isSetupModeMethod = containerObj.getClass().getMethod("isSetupMode", (Class[])null);
Object isSetupObj = isSetupModeMethod.invoke(containerObj, (Object)null);
boolean setupMode = ((Boolean)isSetupObj).booleanValue();
org.jivesoftware.util.ClassUtils,
org.jivesoftware.messenger.container.ServiceLookupFactory"
%>
if (setupMode) {
doSetup = true;
}
}
catch (Throwable t) {
//t.printStackTrace();
doSetup = true;
}
<jsp:useBean id="admin" class="org.jivesoftware.util.WebManager" />
<% admin.init(request, response, session, application, out ); %>
if (!doSetup) {
<% // Figure out if we've already run setup:
if (!admin.isSetupMode()) {
response.sendRedirect("setup-completed.jsp");
return;
}
......
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