Commit 1cbff267 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Intergation day...untested code.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6134 b35dd754-fafc-0310-a699-88a17e54d16e
parent e98e99b5
...@@ -194,6 +194,7 @@ public class AdHocCommandHandler extends IQHandler ...@@ -194,6 +194,7 @@ public class AdHocCommandHandler extends IQHandler
addCommand(new UpdateGroup()); addCommand(new UpdateGroup());
addCommand(new DeleteGroup()); addCommand(new DeleteGroup());
addCommand(new ChangeUserPassword()); addCommand(new ChangeUserPassword());
addCommand(new PacketsNotification());
} }
private void startCommand(AdHocCommand command) { private void startCommand(AdHocCommand command) {
......
...@@ -15,8 +15,10 @@ import org.jivesoftware.wildfire.ClientSession; ...@@ -15,8 +15,10 @@ import org.jivesoftware.wildfire.ClientSession;
import org.jivesoftware.wildfire.SessionManager; import org.jivesoftware.wildfire.SessionManager;
import org.jivesoftware.wildfire.commands.AdHocCommand; import org.jivesoftware.wildfire.commands.AdHocCommand;
import org.jivesoftware.wildfire.commands.SessionData; import org.jivesoftware.wildfire.commands.SessionData;
import org.jivesoftware.wildfire.component.InternalComponentManager;
import org.xmpp.forms.DataForm; import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField; import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
...@@ -113,4 +115,16 @@ public class GetUsersPresence extends AdHocCommand { ...@@ -113,4 +115,16 @@ public class GetUsersPresence extends AdHocCommand {
public int getMaxStages(SessionData data) { public int getMaxStages(SessionData data) {
return 1; return 1;
} }
/**
* Returns if the requester can access this command. Admins and components are allowed to
* execute this command.
*
* @param requester the JID of the entity requesting to execute this command.
* @return true if the requester can access this command.
*/
public boolean hasPermission(JID requester) {
return super.hasPermission(requester) ||
InternalComponentManager.getInstance().getComponent(requester) != null;
}
} }
...@@ -288,6 +288,9 @@ public class InternalComponentManager implements ComponentManager, RoutableChann ...@@ -288,6 +288,9 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
* @return the component with the specified id. * @return the component with the specified id.
*/ */
public Component getComponent(JID componentJID) { public Component getComponent(JID componentJID) {
if (componentJID.getNode() != null) {
return null;
}
Component component = components.get(componentJID.getDomain()); Component component = components.get(componentJID.getDomain());
if (component != null) { if (component != null) {
return component; return component;
......
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