Skip to content

Commit

Permalink
Fix: some problems with medias in multicompany (backport 6.0 commit 7…
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis authored and atm-gauthier committed Nov 22, 2017
1 parent c3c1427 commit a9bfe0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions htdocs/core/class/conf.class.php
Expand Up @@ -88,6 +88,7 @@ function __construct()
$this->user = new stdClass();
$this->syslog = new stdClass();
$this->browser = new stdClass();
$this->medias = new stdClass();
$this->multicompany = new stdClass();

//! Charset for HTML output and for storing data in memory
Expand Down Expand Up @@ -328,6 +329,10 @@ function setValues($db)
$this->propal->dir_output=$rootfordata."/propale";
$this->propal->dir_temp=$rootfordata."/propale/temp";

// For medias storage
$this->medias->multidir_output = array($this->entity => $rootfordata."/medias");
$this->medias->multidir_temp = array($this->entity => $rootfordata."/medias/temp");

// Exception: Some dir are not the name of module. So we keep exception here
// for backward compatibility.

Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/lib/files.lib.php
Expand Up @@ -1857,7 +1857,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
elseif ($modulepart == 'medias' && !empty($dolibarr_main_data_root))
{
$accessallowed=1;
$original_file=$dolibarr_main_data_root.'/medias/'.$original_file;
$original_file=$conf->medias->multidir_output[$entity].'/'.$original_file;
}

// Wrapping for backups
Expand Down

0 comments on commit a9bfe0f

Please sign in to comment.