1 |
<?php |
<?php |
2 |
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> |
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> |
3 |
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> |
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> |
4 |
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org> |
* Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org> |
5 |
* |
* |
6 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
8 |
* the Free Software Foundation; either version 2 of the License, or |
* the Free Software Foundation; either version 2 of the License, or |
9 |
* (at your option) any later version. |
* (at your option) any later version. |
10 |
* |
* |
11 |
* This program is distributed in the hope that it will be useful, |
* This program is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
* GNU General Public License for more details. |
* GNU General Public License for more details. |
15 |
* |
* |
16 |
* You should have received a copy of the GNU General Public License |
* You should have received a copy of the GNU General Public License |
17 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
18 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
* |
* |
20 |
* $Id$ |
* $Id$ |
21 |
* $Source$ |
* $Source$ |
22 |
* |
* |
23 |
*/ |
*/ |
24 |
|
|
25 |
/** \file htdocs/install/inc.php |
/** \file htdocs/install/inc.php |
26 |
\brief Fichier include du programme d'installation |
\brief Fichier include du programme d'installation |
27 |
\version $Revision$ |
\version $Revision$ |
28 |
*/ |
*/ |
29 |
|
|
30 |
|
|
31 |
$docurl = '<a href="doc/dolibarr-install.html">documentation</a>'; |
$docurl = '<a href="doc/dolibarr-install.html">documentation</a>'; |
32 |
$conffile = "../conf/conf.php"; |
$conffile = "../conf/conf.php"; |
33 |
|
|
34 |
|
|
35 |
// Récupère langues du navigateur et defini langcode |
// Récupère langues du navigateur et defini langcode |
36 |
$langpref=$_SERVER['HTTP_ACCEPT_LANGUAGE']; |
$langpref=$_SERVER['HTTP_ACCEPT_LANGUAGE']; |
37 |
$langpref=eregi_replace(";[^,]*","",$langpref); |
$langpref=eregi_replace(";[^,]*","",$langpref); |
38 |
$langpref=eregi_replace("-","_",$langpref); |
$langpref=eregi_replace("-","_",$langpref); |
39 |
$langlist=split("[;,]",$langpref); |
$langlist=split("[;,]",$langpref); |
40 |
$langpart=split("_",$langlist[0]); |
$langpart=split("_",$langlist[0]); |
41 |
if ($langpart[1]) $langcode=$langpart[0]."_".strtoupper($langpart[1]); |
if ($langpart[1]) $langcode=$langpart[0]."_".strtoupper($langpart[1]); |
42 |
else $langcode=$langpart[0]."_".strtoupper($langpart[0]); |
else $langcode=$langpart[0]."_".strtoupper($langpart[0]); |
43 |
// Defini objet langs |
// Defini objet langs |
44 |
require_once("../translate.class.php"); |
require_once("../translate.class.php"); |
45 |
$langs = new Translate("../langs", $langcode); |
$langs = new Translate("../langs", $langcode); |
46 |
|
|
47 |
|
$tab[0]=' class="bg1"'; |
48 |
|
$tab[1]=' class="bg2"'; |
49 |
function pHeader($soutitre,$next,$action='set') |
|
50 |
{ |
function pHeader($soutitre,$next,$action='set') |
51 |
global $langs; |
{ |
52 |
$langs->load("main"); |
global $langs; |
53 |
$langs->load("admin"); |
$langs->load("main"); |
54 |
|
$langs->load("admin"); |
55 |
print '<html>'; |
|
56 |
print '<head>'; |
print '<html>'; |
57 |
print '<meta http-equiv="content-type" content="text/html; charset='.$langs->trans("charset").'">'; |
print '<head>'; |
58 |
print '<link rel="stylesheet" type="text/css" href="./default.css">'; |
print '<meta http-equiv="content-type" content="text/html; charset='.$langs->trans("charset").'">'; |
59 |
print '<title>'.$langs->trans("DolibarrSetup").'</title>'; |
print '<link rel="stylesheet" type="text/css" href="./default.css">'; |
60 |
print '</head>'; |
print '<title>'.$langs->trans("DolibarrSetup").'</title>'; |
61 |
print '<body>'; |
print '</head>'; |
62 |
|
print '<body>'; |
63 |
print '<span class="titre"><a class="titre" href="index.php">'.$langs->trans("DolibarrSetup").'</a></span>'; |
|
64 |
|
print '<span class="titre"><a class="titre" href="index.php">'.$langs->trans("DolibarrSetup").'</a></span>'; |
65 |
print '<form action="'.$next.'.php" method="POST">'; |
|
66 |
print '<input type="hidden" name="action" value="'.$action.'">'; |
print '<form action="'.$next.'.php" method="POST">'; |
67 |
print '<div class="main">'; |
print '<input type="hidden" name="action" value="'.$action.'">'; |
68 |
if ($soutitre) { |
print '<div class="main">'; |
69 |
print '<div class="soustitre">'.$soutitre.'</div>'; |
if ($soutitre) { |
70 |
} |
print '<div class="soustitre">'.$soutitre.'</div>'; |
71 |
print '<div class="main-inside">'; |
} |
72 |
} |
print '<div class="main-inside">'; |
73 |
|
} |
74 |
|
|
75 |
function pFooter($nonext=0,$addlang=1) |
|
76 |
{ |
function pFooter($nonext=0,$addlang=1) |
77 |
global $langs; |
{ |
78 |
$langs->load("main"); |
global $langs; |
79 |
$langs->load("admin"); |
$langs->load("main"); |
80 |
|
$langs->load("admin"); |
81 |
print '</div></div>'; |
|
82 |
if (! $nonext) |
print '</div></div>'; |
83 |
{ |
if (! $nonext) |
84 |
print '<div class="barrebottom"><input type="submit" value="'.$langs->trans("NextStep").' ->"></div>'; |
{ |
85 |
} |
print '<div class="barrebottom"><input type="submit" value="'.$langs->trans("NextStep").' ->"></div>'; |
86 |
if ($addlang) { |
} |
87 |
print '<input type="hidden" name="selectlang" value="'.$langs->defaultlang.'">'; |
if ($addlang) { |
88 |
} |
print '<input type="hidden" name="selectlang" value="'.$langs->defaultlang.'">'; |
89 |
print '</form>'; |
} |
90 |
print '</body>'; |
print '</form>'; |
91 |
print '</html>'; |
print '</body>'; |
92 |
} |
print '</html>'; |
93 |
|
} |
94 |
|
|
95 |
function dolibarr_syslog($message) |
|
96 |
{ |
function dolibarr_syslog($message) |
97 |
// Les fonctions syslog ne sont pas toujours installés ou autorisées chez les hébergeurs |
{ |
98 |
if (function_exists("define_syslog_variables")) |
// Les fonctions syslog ne sont pas toujours installés ou autorisées chez les hébergeurs |
99 |
{ |
if (function_exists("define_syslog_variables")) |
100 |
// \todo Désactiver sous Windows (gros problème mémoire et faute de protections) |
{ |
101 |
// if (1 == 2) { |
// \todo Désactiver sous Windows (gros problème mémoire et faute de protections) |
102 |
define_syslog_variables(); |
// if (1 == 2) { |
103 |
openlog("dolibarr", LOG_PID | LOG_PERROR, LOG_USER); # LOG_USER au lieu de LOG_LOCAL0 car non accepté par tous les php |
define_syslog_variables(); |
104 |
syslog(LOG_WARNING, $message); |
openlog("dolibarr", LOG_PID | LOG_PERROR, LOG_USER); # LOG_USER au lieu de LOG_LOCAL0 car non accepté par tous les php |
105 |
closelog(); |
syslog(LOG_WARNING, $message); |
106 |
// } |
closelog(); |
107 |
} |
// } |
108 |
} |
} |
109 |
|
} |
110 |
?> |
|
111 |
|
?> |