Commit 4b0009a9 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added fall back logic to search admins using the old "adminConsole" prefix.

git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@3023 b35dd754-fafc-0310-a699-88a17e54d16e
parent a82796db
...@@ -16,6 +16,7 @@ import org.dom4j.io.SAXReader; ...@@ -16,6 +16,7 @@ import org.dom4j.io.SAXReader;
import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.database.DbConnectionManager;
import org.jivesoftware.messenger.audit.AuditManager; import org.jivesoftware.messenger.audit.AuditManager;
import org.jivesoftware.messenger.audit.spi.AuditManagerImpl; import org.jivesoftware.messenger.audit.spi.AuditManagerImpl;
import org.jivesoftware.messenger.commands.AdHocCommandHandler;
import org.jivesoftware.messenger.component.InternalComponentManager; import org.jivesoftware.messenger.component.InternalComponentManager;
import org.jivesoftware.messenger.container.AdminConsolePlugin; import org.jivesoftware.messenger.container.AdminConsolePlugin;
import org.jivesoftware.messenger.container.Module; import org.jivesoftware.messenger.container.Module;
...@@ -213,6 +214,10 @@ public class XMPPServer { ...@@ -213,6 +214,10 @@ public class XMPPServer {
Collection<JID> admins = new ArrayList<JID>(); Collection<JID> admins = new ArrayList<JID>();
// Add the JIDs of the local users that are admins // Add the JIDs of the local users that are admins
String usernames = JiveGlobals.getXMLProperty("admin.authorizedUsernames"); String usernames = JiveGlobals.getXMLProperty("admin.authorizedUsernames");
if (usernames == null) {
// Fall back to old method for defining admins (i.e. using adminConsole prefix
usernames = JiveGlobals.getXMLProperty("adminConsole.authorizedUsernames");
}
usernames = (usernames == null || usernames.trim().length() == 0) ? "admin" : usernames; usernames = (usernames == null || usernames.trim().length() == 0) ? "admin" : usernames;
StringTokenizer tokenizer = new StringTokenizer(usernames, ","); StringTokenizer tokenizer = new StringTokenizer(usernames, ",");
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
...@@ -389,6 +394,7 @@ public class XMPPServer { ...@@ -389,6 +394,7 @@ public class XMPPServer {
loadModule(MultiUserChatServerImpl.class.getName()); loadModule(MultiUserChatServerImpl.class.getName());
loadModule(MulticastDNSService.class.getName()); loadModule(MulticastDNSService.class.getName());
loadModule(IQSharedGroupHandler.class.getName()); loadModule(IQSharedGroupHandler.class.getName());
loadModule(AdHocCommandHandler.class.getName());
// Load this module always last since we don't want to start listening for clients // Load this module always last since we don't want to start listening for clients
// before the rest of the modules have been started // before the rest of the modules have been started
loadModule(ConnectionManagerImpl.class.getName()); loadModule(ConnectionManagerImpl.class.getName());
...@@ -1051,4 +1057,15 @@ public class XMPPServer { ...@@ -1051,4 +1057,15 @@ public class XMPPServer {
public MultiUserChatServer getMultiUserChatServer() { public MultiUserChatServer getMultiUserChatServer() {
return (MultiUserChatServer) modules.get(MultiUserChatServerImpl.class); return (MultiUserChatServer) modules.get(MultiUserChatServerImpl.class);
} }
/**
* Returns the <code>AdHocCommandHandler</code> registered with this server. The
* <code>AdHocCommandHandler</code> was registered with the server as a module while starting up
* the server.
*
* @return the <code>AdHocCommandHandler</code> registered with this server.
*/
public AdHocCommandHandler getAdHocCommandHandler() {
return (AdHocCommandHandler) modules.get(AdHocCommandHandler.class);
}
} }
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