Fix warning

This commit is contained in:
Laurent Destailleur 2020-12-31 15:49:25 +01:00
parent c5b419ecb5
commit 3743790160

View File

@ -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';