Fix warning

This commit is contained in:
Laurent Destailleur 2020-12-30 12:16:01 +01:00
parent 057ed201a7
commit 87a452c6f4
5 changed files with 12 additions and 12 deletions

View File

@ -1806,7 +1806,7 @@ class User extends CommonObject
$adh->pass = $this->pass;
$adh->societe = (empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe);
//$adh->societe = (empty($adh->societe) && $this->societe_id ? $this->societe_id : $adh->societe);
$adh->address = $this->address;
$adh->town = $this->town;

View File

@ -270,10 +270,10 @@ function getContact($authentication, $id, $ref_ext)
if ($result > 0)
{
// Only internal user who have contact read permission
// Or for external user who have contact read permission, with restrict on societe_id
// Or for external user who have contact read permission, with restrict on socid
if (
$fuser->rights->societe->contact->lire && !$fuser->societe_id
|| ($fuser->rights->societe->contact->lire && ($fuser->societe_id == $contact->socid))
$fuser->rights->societe->contact->lire && !$fuser->socid
|| ($fuser->rights->societe->contact->lire && ($fuser->socid == $contact->socid))
) {
$contact_result_fields = array(
'id' => $contact->id,

View File

@ -367,7 +367,7 @@ function getOrder($authentication, $id = '', $ref = '', $ref_ext = '')
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if ($fuser->societe_id) $socid = $fuser->societe_id;
if ($fuser->socid) $socid = $fuser->socid;
// Check parameters
if (!$error && (($id && $ref) || ($id && $ref_ext) || ($ref && $ref_ext)))
@ -516,7 +516,7 @@ function getOrdersForThirdParty($authentication, $idthirdparty)
$error = 0;
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if ($fuser->societe_id) $socid = $fuser->societe_id;
if ($fuser->socid) $socid = $fuser->socid;
// Check parameters
if (!$error && empty($idthirdparty))

View File

@ -208,7 +208,7 @@ function getDocument($authentication, $modulepart, $file, $refname = '')
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if ($fuser->societe_id) $socid = $fuser->societe_id;
if ($fuser->socid) $socid = $fuser->socid;
// Check parameters
if (!$error && (!$file || !$modulepart))
@ -234,7 +234,7 @@ function getDocument($authentication, $modulepart, $file, $refname = '')
$original_file = $check_access['original_file'];
// Basic protection (against external users only)
if ($fuser->societe_id > 0)
if ($fuser->socid > 0)
{
if ($sqlprotectagainstexternals)
{
@ -246,7 +246,7 @@ function getDocument($authentication, $modulepart, $file, $refname = '')
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if ($fuser->societe_id != $obj->fk_soc)
if ($fuser->socid != $obj->fk_soc)
{
$accessallowed = 0;
break;

View File

@ -485,7 +485,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if ($fuser->societe_id) $socid = $fuser->societe_id;
if ($fuser->socid) $socid = $fuser->socid;
if (!$error && !$thirdpartywithuser)
{
@ -502,7 +502,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
$thirdparty = new Societe($db);
// If a contact / company already exists with the email, return the corresponding socid
$sql = "SELECT s.rowid as societe_id FROM ".MAIN_DB_PREFIX."societe as s";
$sql = "SELECT s.rowid as socid FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid";
$sql .= " WHERE s.entity=".$conf->entity;
$sql .= " AND s.email='".$db->escape($thirdpartywithuser['email'])."'";
@ -690,7 +690,7 @@ function setUserPassword($authentication, $shortuser)
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if ($fuser->societe_id) $socid = $fuser->societe_id;
if ($fuser->socid) $socid = $fuser->socid;
if (!$error && !$shortuser)
{