2
0
forked from Wavyzz/dolibarr

A better fix to remove files from document list

This commit is contained in:
Laurent Destailleur
2012-05-30 04:11:00 +02:00
parent 3c98daaf09
commit ebf77e8c92
2 changed files with 10 additions and 4 deletions

View File

@@ -483,7 +483,7 @@ if (preg_match('/\.\./',$original_file) || preg_match('/[<>|]/',$original_file))
exit;
}
/*
// TODO Remove this. Some part of code still use it.
if ($action == 'remove_file') // Remove a file
{
clearstatcache();
@@ -508,7 +508,7 @@ if ($action == 'remove_file') // Remove a file
return;
}
else // Open and return file
{*/
{
clearstatcache();
$filename = basename($original_file);
@@ -540,6 +540,6 @@ else // Open and return file
//flush();
readfile($original_file_osencoded);
//}
}
?>

View File

@@ -53,7 +53,7 @@ $original_file=GETPOST("file");
$modulepart=GETPOST('modulepart','alpha');
$urlsource=GETPOST("urlsource");
$entity=GETPOST('entity','int');
if ($entity == '') $entity=1; // For backward compatibility
// Security check
if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart');
@@ -212,6 +212,12 @@ if ($modulepart)
if ($user->rights->tax->charges->lire) $accessallowed=1;
$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
elseif ($modulepart == 'category')
{