Skip to content

Commit

Permalink
A better fix to remove files from document list
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed May 30, 2012
1 parent 3c98daa commit ebf77e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions htdocs/document.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ function llxHeader() { }
exit;
}

/*
// TODO Remove this. Some part of code still use it.
if ($action == 'remove_file') // Remove a file
{
clearstatcache();
Expand All @@ -508,7 +508,7 @@ function llxHeader() { }
return;
}
else // Open and return file
{*/
{
clearstatcache();

$filename = basename($original_file);
Expand Down Expand Up @@ -540,6 +540,6 @@ function llxHeader() { }
//flush();

readfile($original_file_osencoded);
//}
}

?>
8 changes: 7 additions & 1 deletion htdocs/viewimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function llxHeader() { }
$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');
Expand Down Expand Up @@ -212,6 +212,12 @@ function llxHeader() { }
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')
{
Expand Down

0 comments on commit ebf77e8

Please sign in to comment.