Skip to content
Snippets Groups Projects
Select Git revision
  • b7cf070d2d6a68b3fd4bc60260af3d87a4edf584
  • 3.9 default
  • develop
  • 6.0
  • 5.0
  • 4.0
  • scrutinizer-patch-4
  • scrutinizer-patch-3
  • scrutinizer-patch-2
  • scrutinizer-patch-1
  • 3.7
  • 3.8
  • 3.6
  • 3.9_backported
  • 3.8_backported
  • 3.7_backported
  • 3.5
  • 3.6_backported
  • 3.5_backported
  • 3.4
  • 3.3_backported
  • 6.0.4
  • 6.0.3
  • 5.0.7
  • 6.0.2
  • 6.0.1
  • 5.0.6
  • 6.0.0
  • 5.0.5
  • 6.0.0-rc
  • 5.0.4
  • 6.0.0-beta
  • 5.0.3
  • 4.0.6
  • 5.0.2
  • 5.0.1
  • 4.0.5
  • 5.0.0
  • 4.0.4
  • 5.0.0-rc2
  • 5.0.0-rc1
41 results

document.php

Blame
  • document.php 6.14 KiB
    <?php
    /* Copyright (C) 2004-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
     * Copyright (C) 2004-2013 Laurent Destailleur  <eldy@users.sourceforge.net>
     * Copyright (C) 2005      Simon Tosser         <simon@kornog-computing.com>
     * Copyright (C) 2005-2012 Regis Houssin        <regis.houssin@capnetworks.com>
     * Copyright (C) 2010	   Pierre Morin         <pierre.morin@auguria.net>
     * Copyright (C) 2010	   Juanjo Menent        <jmenent@2byte.es>
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 3 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License
     * along with this program. If not, see <http://www.gnu.org/licenses/>.
     * or see http://www.gnu.org/
     */
    
    /**
     *	\file       htdocs/document.php
     *  \brief      Wrapper to download data files
     *  \remarks    Call of this wrapper is made with URL:
     * 				document.php?modulepart=repfichierconcerne&file=pathrelatifdufichier
     */
    
    define('NOTOKENRENEWAL',1); // Disables token renewal
    // Pour autre que bittorrent, on charge environnement + info issus de logon (comme le user)
    if (isset($_GET["modulepart"]) && $_GET["modulepart"] == 'bittorrent' && ! defined("NOLOGIN"))
    {
    	define("NOLOGIN",1);
    	define("NOCSRFCHECK",1);	// We accept to go on this page from external web site.
    }
    if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
    if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
    if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
    
    /**
     * Header empty
     *
     * @return	void
     */
    function llxHeader() { }
    /**
     * Footer empty
     *
     * @return	void
     */
    function llxFooter() { }
    
    
    require 'main.inc.php';	// Load $user and permissions
    require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
    
    $encoding = '';
    $action=GETPOST('action','alpha');
    $original_file=GETPOST('file','alpha');	// Do not use urldecode here ($_GET are already decoded by PHP).
    $modulepart=GETPOST('modulepart','alpha');
    $urlsource=GETPOST('urlsource','alpha');
    $entity=GETPOST('entity')?GETPOST('entity','int'):$conf->entity;
    
    // Security check
    if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart');
    
    $socid=0;
    if ($user->societe_id > 0) $socid = $user->societe_id;