mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
BugFix: modif url fichier pour les prelevements
This commit is contained in:
parent
3651046095
commit
a385c25770
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -22,20 +22,18 @@
|
|||
*
|
||||
*/
|
||||
|
||||
/** \file htdocs/document.php
|
||||
\brief Wrapper permettant le téléchargement de fichier de données Dolibarr
|
||||
\remarks L'appel est document.php?file=pathrelatifdufichier&modulepart=repfichierconcerne
|
||||
\version $Revision$
|
||||
/**
|
||||
\file htdocs/document.php
|
||||
\brief Wrapper permettant le téléchargement de fichier de données Dolibarr
|
||||
\remarks L'appel est document.php?file=pathrelatifdufichier&modulepart=repfichierconcerne
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
|
||||
require_once("main.inc.php");
|
||||
|
||||
|
||||
// C'est un wrapper, donc header vierge
|
||||
function llxHeader() { }
|
||||
|
||||
|
||||
$original_file = urldecode($_GET["file"]);
|
||||
$modulepart = urldecode($_GET["modulepart"]);
|
||||
$type = urldecode($_GET["type"]);
|
||||
|
|
@ -43,104 +41,112 @@ $type = urldecode($_GET["type"]);
|
|||
$accessallowed=0;
|
||||
if ($modulepart)
|
||||
{
|
||||
// On fait une vérification des droits et on définit le répertoire concerné
|
||||
|
||||
// Wrapping pour les factures
|
||||
if ($modulepart == 'facture')
|
||||
// On fait une vérification des droits et on définit le répertoire concerné
|
||||
|
||||
// Wrapping pour les factures
|
||||
if ($modulepart == 'facture')
|
||||
{
|
||||
$user->getrights('facture');
|
||||
if ($user->rights->facture->lire)
|
||||
$user->getrights('facture');
|
||||
if ($user->rights->facture->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->facture->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les fiches intervention
|
||||
if ($modulepart == 'ficheinter')
|
||||
|
||||
// Wrapping pour les fiches intervention
|
||||
if ($modulepart == 'ficheinter')
|
||||
{
|
||||
$user->getrights('ficheinter');
|
||||
if ($user->rights->ficheinter->lire)
|
||||
$user->getrights('ficheinter');
|
||||
if ($user->rights->ficheinter->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->ficheinter->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les prelevements
|
||||
if ($modulepart == 'prelevement')
|
||||
|
||||
// Wrapping pour les prelevements
|
||||
if ($modulepart == 'prelevement')
|
||||
{
|
||||
$user->getrights('prelevement');
|
||||
if ($user->rights->prelevement->lire)
|
||||
$user->getrights('prelevement');
|
||||
if ($user->rights->prelevement->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->prelevement->dir_output.'/'.$original_file;
|
||||
//$original_file=$conf->prelevement->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les propales
|
||||
if ($modulepart == 'propal')
|
||||
|
||||
// Wrapping pour les propales
|
||||
if ($modulepart == 'propal')
|
||||
{
|
||||
$user->getrights('propale');
|
||||
if ($user->rights->propale->lire)
|
||||
$user->getrights('propale');
|
||||
if ($user->rights->propale->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->propal->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->propal->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les rapport de paiements
|
||||
if ($modulepart == 'facture_paiement')
|
||||
|
||||
// Wrapping pour les rapport de paiements
|
||||
if ($modulepart == 'facture_paiement')
|
||||
{
|
||||
$user->getrights('facture');
|
||||
if ($user->rights->facture->lire)
|
||||
$user->getrights('facture');
|
||||
if ($user->rights->facture->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->compta->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->compta->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour les societe
|
||||
if ($modulepart == 'societe')
|
||||
|
||||
// Wrapping pour les societe
|
||||
if ($modulepart == 'societe')
|
||||
{
|
||||
$user->getrights('societe');
|
||||
if ($user->rights->societe->lire)
|
||||
$user->getrights('societe');
|
||||
if ($user->rights->societe->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->societe->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->societe->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
// Wrapping pour la telephonie
|
||||
if ($modulepart == 'telephonie')
|
||||
|
||||
// Wrapping pour la telephonie
|
||||
if ($modulepart == 'telephonie')
|
||||
{
|
||||
$user->getrights('telephonie');
|
||||
if ($user->rights->telephonie->lire)
|
||||
$user->getrights('telephonie');
|
||||
if ($user->rights->telephonie->lire)
|
||||
{
|
||||
$accessallowed=1;
|
||||
$accessallowed=1;
|
||||
}
|
||||
$original_file=$conf->telephonie->dir_output.'/'.$original_file;
|
||||
$original_file=$conf->telephonie->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
|
||||
// Wrapping pour la telephonie
|
||||
if ($modulepart == 'actionscomm')
|
||||
|
||||
|
||||
// Wrapping pour la telephonie
|
||||
if ($modulepart == 'actionscomm')
|
||||
{
|
||||
$user->getrights('commercial');
|
||||
//if ($user->rights->commercial->lire) // Ce droit n'existe pas encore
|
||||
//{
|
||||
$accessallowed=1;
|
||||
//}
|
||||
$original_file=$conf->commercial->dir_output.'/'.$original_file;
|
||||
$user->getrights('commercial');
|
||||
//if ($user->rights->commercial->lire) // Ce droit n'existe pas encore
|
||||
//{
|
||||
$accessallowed=1;
|
||||
//}
|
||||
$original_file=$conf->commercial->dir_output.'/'.$original_file;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Limite accès si droits non corrects
|
||||
if (! $accessallowed) { accessforbidden(); }
|
||||
if (! $accessallowed)
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$filename = basename($original_file);
|
||||
if (! file_exists($original_file)) { dolibarr_print_error(0,$langs->trans("FileDoesNotExist",$original_file)); exit; }
|
||||
|
||||
if (! file_exists($original_file))
|
||||
{
|
||||
dolibarr_print_error(0,$langs->trans("FileDoesNotExist",$original_file));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Les drois sont ok et fichier trouvé
|
||||
if ($type)
|
||||
|
|
@ -155,5 +161,4 @@ header('Content-Disposition: attachment; filename="'.$filename.'"');
|
|||
|
||||
readfile($original_file);
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user