Fix missing test on external user id - reported by Codex
This commit is contained in:
parent
11aec08ff4
commit
0dd9e6acc2
1 changed files with 2 additions and 1 deletions
|
|
@ -3397,7 +3397,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->societe->multidir_output[$entity].'/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid='".$db->escape($refname)."' AND entity IN (".getEntity('societe').")";
|
||||
$sqlprotectagainstexternals = "SELECT rowid as fk_soc FROM ".MAIN_DB_PREFIX."societe WHERE rowid = ".((int) $refname)." AND entity IN (".getEntity('societe').")";
|
||||
} elseif (($modulepart == 'contact' || $modulepart == 'socpeople') && !empty($conf->societe->multidir_output[$entity])) {
|
||||
// Wrapping for contact
|
||||
if (empty($entity) || empty($conf->societe->multidir_output[$entity])) {
|
||||
|
|
@ -3407,6 +3407,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->societe->multidir_output[$entity].'/contact/'.$original_file;
|
||||
$sqlprotectagainstexternals = "SELECT fk_soc FROM ".MAIN_DB_PREFIX."socpepople WHERE rowid = ".((int) $refname)." AND entity IN (".getEntity('contact').")";
|
||||
} elseif (($modulepart == 'facture' || $modulepart == 'invoice') && !empty($conf->invoice->multidir_output[$entity])) {
|
||||
// Wrapping for invoices
|
||||
if ($fuser->hasRight('facture', $lire) || preg_match('/^specimen/i', $original_file)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue