From 29660fe175ef3b49ff649a26bd9bcf4c9eb7c6dd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 8 Oct 2011 02:00:36 +0100 Subject: Remove the inconsistently applied now pointless FailIfRemoteAdminDisabled() check on XMLRPC RemoteAdmin handlers. If admin is disabled then the XMLRPC handlers are never registered, which means that they cannot be called anyway. --- .../RemoteController/RemoteAdminPlugin.cs | 40 +--------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to 'OpenSim/ApplicationPlugins/RemoteController') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index e897f7c..4319fa0 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -192,16 +192,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController } } - private void FailIfRemoteAdminDisabled(string requestName) - { - if (m_config == null) - { - string errorMessage = String.Format("[RADMIN] {0}: Remote admin request denied! Please set [RemoteAdmin] enabled=true in OpenSim.ini in order to enable remote admin functionality", requestName); - m_log.Error(errorMessage); - throw new ApplicationException(errorMessage); - } - } - private void FailIfRemoteAdminNotAllowed(string password, string check_ip_address) { if (m_accessIP.Count > 0 && !m_accessIP.Contains(check_ip_address)) @@ -379,7 +369,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController } public XmlRpcResponse XmlRpcSaveHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient) - { XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -570,8 +559,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: CreateRegion: new request"); - FailIfRemoteAdminDisabled("CreateRegion"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -927,6 +914,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController public XmlRpcResponse XmlRpcCloseRegionMethod(XmlRpcRequest request, IPEndPoint remoteClient) { m_log.Info("[RADMIN]: CloseRegion: new request"); + XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); Scene scene = null; @@ -1130,8 +1118,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: CreateUser: new request"); - FailIfRemoteAdminDisabled("CreateUser"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -1245,8 +1231,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: UserExists: new request"); - FailIfRemoteAdminDisabled("UserExists"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -1348,8 +1332,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_log.Info("[RADMIN]: UpdateUserAccount: new request"); m_log.Warn("[RADMIN]: This method needs update for 0.7"); - FailIfRemoteAdminDisabled("UpdateUserAccount"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2259,8 +2241,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Load OAR Administrator Request"); - FailIfRemoteAdminDisabled("Load OAR"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2370,8 +2350,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Save OAR Administrator Request"); - FailIfRemoteAdminDisabled("Save OAR"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2467,8 +2445,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Load XML Administrator Request"); - FailIfRemoteAdminDisabled("Load XML"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2547,8 +2523,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Save XML Administrator Request"); - FailIfRemoteAdminDisabled("Save XML"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2623,8 +2597,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Query XML Administrator Request"); - FailIfRemoteAdminDisabled("Query XML"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2682,8 +2654,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Command XML Administrator Request"); - FailIfRemoteAdminDisabled("Command XML"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2720,8 +2690,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Access List Clear Request"); - FailIfRemoteAdminDisabled("Access List Clear"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2779,8 +2747,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Access List Add Request"); - FailIfRemoteAdminDisabled("Access List Add"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2866,8 +2832,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Access List Remove Request"); - FailIfRemoteAdminDisabled("Access List Remove"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); @@ -2953,8 +2917,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController { m_log.Info("[RADMIN]: Received Access List List Request"); - FailIfRemoteAdminDisabled("Access List List"); - XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); -- cgit v1.1