Commit 61f078ae authored by Dave Cridland's avatar Dave Cridland Committed by GitHub

Merge pull request #598 from guusdk/OF-1147_Plugin-Management-refactoring

OF-1147 plugin management refactoring
parents 5daa7f52 8faa4ab2
......@@ -79,6 +79,9 @@
<logger name="org.jivesoftware.openfire.container.PluginManager">
<appender-ref ref="console"/>
</logger>
<logger name="org.jivesoftware.openfire.container.PluginMonitor">
<appender-ref ref="console"/>
</logger>
<!-- OF-506: Jetty INFO messages are generally not useful. Ignore them by default. -->
<logger name="org.eclipse.jetty">
......
......@@ -87,7 +87,7 @@ public class AdminConsole {
* @param element the Element
* @throws Exception if an error occurs.
*/
public static void addModel(String name, Element element) throws Exception {
public static synchronized void addModel(String name, Element element) throws Exception {
overrideModels.put(name, element);
rebuildModel();
}
......@@ -97,7 +97,7 @@ public class AdminConsole {
*
* @param name the name.
*/
public static void removeModel(String name) {
public static synchronized void removeModel(String name) {
overrideModels.remove(name);
rebuildModel();
}
......
/*
* Copyright 2016 IgniteRealtime.org
*
* Licensed 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.jivesoftware.openfire.container;
/**
* An enumeration for license agreement types.
*/
public enum License
{
/**
* Distributed using a commercial license.
*/
commercial,
/**
* Distributed using the GNU Public License (GPL).
*/
gpl,
/**
* Distributed using the Apache license.
*/
apache,
/**
* For internal use at an organization only and is not re-distributed.
*/
internal,
/**
* Distributed under another license agreement not covered by one of the other choices. The license agreement
* should be detailed in a Readme or License file that accompanies the code.
*/
other
}
......@@ -85,14 +85,7 @@
}
if (csrf_check && deletePlugin != null) {
File pluginDir = pluginManager.getPluginDirectory(pluginManager.getPlugin(deletePlugin));
File pluginJar = new File(pluginDir.getParent(), pluginDir.getName() + ".jar");
// Also try the .war extension.
if (!pluginJar.exists()) {
pluginJar = new File(pluginDir.getParent(), pluginDir.getName() + ".war");
}
pluginJar.delete();
pluginManager.unloadPlugin(pluginDir.getName());
pluginManager.deletePlugin( deletePlugin );
// Log the event
webManager.logEvent("deleted plugin "+deletePlugin, null);
response.sendRedirect("plugin-admin.jsp?deletesuccess=true");
......
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