diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 7f2f2ebd43f..8c278768990 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -364,6 +364,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') $objectresp = array(); $errorcode = ''; $errorlabel = ''; $error = 0; + $socid = 0; $fuser = check_authentication($authentication, $error, $errorcode, $errorlabel); @@ -387,7 +388,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '') if ($result > 0) { // Security for external user - if ($socid && (empty($order->socid) || $socid != $order->socid)) + if ($socid && $socid != $order->socid) { $error++; $errorcode = 'PERMISSION_DENIED'; $errorlabel = 'User does not have permission for this request';