forked from Wavyzz/dolibarr
A better fix to remove files from document list
This commit is contained in:
@@ -483,7 +483,7 @@ if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
// TODO Remove this. Some part of code still use it.
|
||||||
if ($action == 'remove_file') // Remove a file
|
if ($action == 'remove_file') // Remove a file
|
||||||
{
|
{
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
@@ -508,7 +508,7 @@ if ($action == 'remove_file') // Remove a file
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else // Open and return file
|
else // Open and return file
|
||||||
{*/
|
{
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
$filename = basename($original_file);
|
$filename = basename($original_file);
|
||||||
@@ -540,6 +540,6 @@ else // Open and return file
|
|||||||
//flush();
|
//flush();
|
||||||
|
|
||||||
readfile($original_file_osencoded);
|
readfile($original_file_osencoded);
|
||||||
//}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ $original_file=GETPOST("file");
|
|||||||
$modulepart=GETPOST('modulepart','alpha');
|
$modulepart=GETPOST('modulepart','alpha');
|
||||||
$urlsource=GETPOST("urlsource");
|
$urlsource=GETPOST("urlsource");
|
||||||
$entity=GETPOST('entity','int');
|
$entity=GETPOST('entity','int');
|
||||||
|
if ($entity == '') $entity=1; // For backward compatibility
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart');
|
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart');
|
||||||
@@ -212,6 +212,12 @@ if ($modulepart)
|
|||||||
if ($user->rights->tax->charges->lire) $accessallowed=1;
|
if ($user->rights->tax->charges->lire) $accessallowed=1;
|
||||||
$original_file=$conf->tax->dir_output.'/'.$original_file;
|
$original_file=$conf->tax->dir_output.'/'.$original_file;
|
||||||
}
|
}
|
||||||
|
// Wrapping for products or services
|
||||||
|
elseif ($modulepart == 'actions')
|
||||||
|
{
|
||||||
|
if ($user->rights->agenda->myactions->read) $accessallowed=1;
|
||||||
|
$original_file=$conf->agenda->dir_output.'/'.$original_file;
|
||||||
|
}
|
||||||
// Wrapping for categories
|
// Wrapping for categories
|
||||||
elseif ($modulepart == 'category')
|
elseif ($modulepart == 'category')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user