Fix: Must not use DOL_DATA_ROOT directly
This commit is contained in:
parent
d0426108f4
commit
04915533f2
@ -293,6 +293,10 @@ class Conf
|
|||||||
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
|
$this->boutique->album->enabled=defined("BOUTIQUE_ALBUM")?BOUTIQUE_ALBUM:0;
|
||||||
// Module Barcode
|
// Module Barcode
|
||||||
$this->barcode->dir_temp=$rootfordata."/barcode/temp";
|
$this->barcode->dir_temp=$rootfordata."/barcode/temp";
|
||||||
|
// Module stock
|
||||||
|
$this->stock->dir_temp=$rootfordata."/stock/temp";
|
||||||
|
// Module prelevement
|
||||||
|
$this->prelevement->dir_output=$rootfordata."/prelevement";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Modification de quelques variable de conf en fonction des Constantes
|
* Modification de quelques variable de conf en fonction des Constantes
|
||||||
|
|||||||
@ -36,7 +36,7 @@ define('EURO',chr(128));
|
|||||||
// Definition des constantes syslog
|
// Definition des constantes syslog
|
||||||
if (function_exists("define_syslog_variables"))
|
if (function_exists("define_syslog_variables"))
|
||||||
{
|
{
|
||||||
define_syslog_variables();
|
define_syslog_variables();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -68,7 +68,7 @@ if (empty($dolibarr_main_db_host))
|
|||||||
{
|
{
|
||||||
print 'Error: Dolibarr setup was run but was not completed.<br>'."\n";
|
print 'Error: Dolibarr setup was run but was not completed.<br>'."\n";
|
||||||
print 'Please, run <a href="install/index.php">Dolibarr install process</a> until the end...'."\n";
|
print 'Please, run <a href="install/index.php">Dolibarr install process</a> until the end...'."\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
|
||||||
if (empty($dolibarr_main_data_root))
|
if (empty($dolibarr_main_data_root))
|
||||||
@ -91,7 +91,7 @@ define('DOL_URL_ROOT', $pos); // URL racine relative
|
|||||||
*/
|
*/
|
||||||
if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"))
|
if (! file_exists(DOL_DOCUMENT_ROOT ."/lib/functions.lib.php"))
|
||||||
{
|
{
|
||||||
print "Error: Dolibarr config file content seems to be not correctly defined.<br>\n";
|
print "Error: Dolibarr config file content seems to be not correctly defined.<br>\n";
|
||||||
print "Please run dolibarr setup by calling page <b>/install</b>.<br>\n";
|
print "Please run dolibarr setup by calling page <b>/install</b>.<br>\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -159,8 +159,8 @@ define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix);
|
|||||||
// Detection browser
|
// Detection browser
|
||||||
if (isset($_SERVER["HTTP_USER_AGENT"]))
|
if (isset($_SERVER["HTTP_USER_AGENT"]))
|
||||||
{
|
{
|
||||||
if (eregi('firefox',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
|
if (eregi('firefox',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
|
||||||
if (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
|
if (eregi('iceweasel',$_SERVER["HTTP_USER_AGENT"])) $conf->browser->firefox=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chargement des includes principaux de librairies communes
|
// Chargement des includes principaux de librairies communes
|
||||||
@ -262,17 +262,17 @@ if (! defined('NOREQUIRESOC'))
|
|||||||
if (is_numeric($conf->global->MAIN_INFO_SOCIETE_PAYS))
|
if (is_numeric($conf->global->MAIN_INFO_SOCIETE_PAYS))
|
||||||
{
|
{
|
||||||
$mysoc->pays_id=$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
$mysoc->pays_id=$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
||||||
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
|
$sql = "SELECT code from ".MAIN_DB_PREFIX."c_pays";
|
||||||
$sql .= " WHERE rowid = ".$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
$sql .= " WHERE rowid = ".$conf->global->MAIN_INFO_SOCIETE_PAYS;
|
||||||
$result=$db->query($sql);
|
$result=$db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object();
|
$obj = $db->fetch_object();
|
||||||
$mysoc->pays_code=$obj->code;
|
$mysoc->pays_code=$obj->code;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Si dans MAIN_INFO_SOCIETE_PAYS on a deja un code, tout est fait
|
// Si dans MAIN_INFO_SOCIETE_PAYS on a deja un code, tout est fait
|
||||||
else
|
else
|
||||||
|
|||||||
@ -271,7 +271,7 @@ if ($modulepart)
|
|||||||
elseif ($modulepart == 'graph_stock')
|
elseif ($modulepart == 'graph_stock')
|
||||||
{
|
{
|
||||||
$accessallowed=1;
|
$accessallowed=1;
|
||||||
$original_file=DOL_DATA_ROOT.'/entrepot/temp/'.$original_file;
|
$original_file=$conf->stock->dir_temp.'/'.$original_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wrapping pour les graph fournisseurs
|
// Wrapping pour les graph fournisseurs
|
||||||
@ -318,7 +318,7 @@ if (! $accessallowed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Security:
|
// Security:
|
||||||
// On interdit les remont<EFBFBD>es de repertoire ainsi que les pipe dans
|
// On interdit les remontees de repertoire ainsi que les pipe dans
|
||||||
// les noms de fichiers.
|
// les noms de fichiers.
|
||||||
if (eregi('\.\.',$original_file) || eregi('[<>|]',$original_file))
|
if (eregi('\.\.',$original_file) || eregi('[<>|]',$original_file))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,7 +97,7 @@ class pdf_courrier_editeur
|
|||||||
|
|
||||||
$fichref = $year;
|
$fichref = $year;
|
||||||
|
|
||||||
$dir = DOL_DATA_ROOT."/societe/courrier/" . get_exdir($id);
|
$dir = $conf->societe->dir_output."/courrier/" . get_exdir($id);
|
||||||
$file = $dir . $fichref . ".pdf";
|
$file = $dir . $fichref . ".pdf";
|
||||||
|
|
||||||
if (! file_exists($dir))
|
if (! file_exists($dir))
|
||||||
|
|||||||
@ -71,7 +71,7 @@ $year = strftime('%Y',$now);
|
|||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$dir = DOL_DATA_ROOT."/product/temp";
|
$dir = $conf->produit->dir_output."/temp";
|
||||||
if (!is_dir($dir) )
|
if (!is_dir($dir) )
|
||||||
{
|
{
|
||||||
if (! create_exdir($dir,0755))
|
if (! create_exdir($dir,0755))
|
||||||
|
|||||||
@ -70,7 +70,7 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$dir = DOL_DATA_ROOT."/entrepot/temp";
|
$dir = $conf->stock->dir_temp;
|
||||||
$result=create_exdir($dir);
|
$result=create_exdir($dir);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -200,12 +200,12 @@ if (sizeof($factures_prev) > 0)
|
|||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row();
|
$row = $db->fetch_row();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog("Erreur recherche reference");
|
dol_syslog("Erreur recherche reference");
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = $ref . substr("00".($row[0]+1), -2);
|
$ref = $ref . substr("00".($row[0]+1), -2);
|
||||||
@ -222,15 +222,15 @@ if (sizeof($factures_prev) > 0)
|
|||||||
|
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
$prev_id = $db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
|
$prev_id = $db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
|
||||||
|
|
||||||
$bonprev = new BonPrelevement($db, DOL_DATA_ROOT."/prelevement/bon/".$filebonprev);
|
$bonprev = new BonPrelevement($db, $this->prelevement."/bon/".$filebonprev);
|
||||||
$bonprev->id = $prev_id;
|
$bonprev->id = $prev_id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
dol_syslog("Erreur création du bon de prelevement");
|
dol_syslog("Erreur création du bon de prelevement");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user