From e72ec322e146b62ba38453b46f5fd09908571563 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 10 Sep 2005 10:39:36 +0000 Subject: [PATCH] added configuration switch for xmlrpc and soap services (default off) --- admin/templates/default/config.tpl | 20 ++++++++++++++++++++ phpgwapi/inc/class.soap_server.inc.php | 2 +- soap.php | 7 +++++++ xmlrpc.php | 6 ++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index 6e93a2dae1..896dbf1656 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -210,6 +210,26 @@ + + {lang_Enable_the_xmlrpc_service} {lang_(default_No,_leave_it_off_if_you_dont_use_it)}: + + + + + + + {lang_Enable_the_soap_service} {lang_(default_No,_leave_it_off_if_you_dont_use_it)}: + + + + +  {lang_Mail_settings} diff --git a/phpgwapi/inc/class.soap_server.inc.php b/phpgwapi/inc/class.soap_server.inc.php index c557eac990..badabeff8c 100644 --- a/phpgwapi/inc/class.soap_server.inc.php +++ b/phpgwapi/inc/class.soap_server.inc.php @@ -29,7 +29,7 @@ function service($data) { // $response is a soap_msg object - $response = $this->parseRequest($data); + $response = get_class($data) == 'soapmsg' ? $date : $this->parseRequest($data); $this->debug("parsed request and got an object of this class '".get_class($response)."'"); $this->debug("server sending..."); // pass along the debug string diff --git a/soap.php b/soap.php index 34f303fc93..c13c21c1ad 100644 --- a/soap.php +++ b/soap.php @@ -25,6 +25,13 @@ /* _debug_array($GLOBALS['server']);exit; */ /* include(EGW_API_INC . '/soaplib.soapinterop.php'); */ + if (!$GLOBALS['egw_info']['server']['soap_enabled']) + { + $GLOBALS['server']->make_fault(9999,'soap service is not enabled in the eGroupWare system configuration'); + $GLOBALS['server']->service($GLOBALS['server']->fault()); + exit; + } + /* Note: this command only available under Apache */ $headers = getallheaders(); diff --git a/xmlrpc.php b/xmlrpc.php index 527abbc895..ab045f6f80 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -30,6 +30,12 @@ /* uncomment here if you want to show all of the testing functions for compatibility */ //include(EGW_API_INC . '/xmlrpc.interop.php'); + + if (!$GLOBALS['egw_info']['server']['xmlrpc_enabled']) + { + $server->xmlrpc_error(9999,'xmlrpc service is not enabled in the eGroupWare system configuration'); + exit; + } /* Note: this command only available under Apache */ $headers = getallheaders();