diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 6627bab527c..b5db639015c 100755 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -212,6 +212,11 @@ function getInvoice($authentication,$id,$ref,$ref_ext) $error++; $errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup'; } + if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity'])) + { + $error++; + $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used)."; + } if (! $error && (($id && $ref) || ($id && $ref_ext) || ($ref && $ref_ext))) { diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index 9c010cc7fd1..1f6b9635e24 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -111,6 +111,11 @@ function getVersions($authentication) $error++; $errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup'; } + if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity'])) + { + $error++; + $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used)."; + } if (! $error) { diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 270956fa19c..65c15d04897 100755 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -153,6 +153,11 @@ function getThirdParty($authentication,$id,$ref,$ref_ext) $error++; $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both."; } + if (! $error && ! empty($authentication['entity']) && ! is_numeric($authentication['entity'])) + { + $error++; + $errorcode='BAD_PARAMETERS'; $errorlabel="Parameter entity must be empty (or a numeric with id of instance if multicompany module is used)."; + } if (! $error) { diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index 6334d8f74b1..90a191f47b4 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -1,5 +1,5 @@ -http://localhost/dolibarrnew/webservices/server_other.php?wsdl +http://localhost/dolibarrnew/webservices/server_other.php?wsdl @@ -307,24 +307,24 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_invoice.phpUTF-8http://localhost/dolibarrnew/webservices/server_invoice.php +]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_invoice.php<xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php - ? + dolibarrkey ? - ? - ? - ? + admin + admin + - ? - ? - ? + + + ppp -]]>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php +]]>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php