54 |
|
|
55 |
if(! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0) |
if(! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0) |
56 |
{ |
{ |
57 |
// Si le php fonctionne en CGI, alors SCRIPT_FILENAME vaut le path du php et |
// Si le php fonctionne en CGI, alors SCRIPT_FILENAME vaut le path du php et |
58 |
// ce n'est pas ce qu'on veut. Dans ce cas, on propose $_SERVER["DOCUMENT_ROOT"] |
// ce n'est pas ce qu'on veut. Dans ce cas, on propose $_SERVER["DOCUMENT_ROOT"] |
59 |
if (eregi('php$',$_SERVER["SCRIPT_FILENAME"]) || eregi('php\.exe$',$_SERVER["SCRIPT_FILENAME"])) { |
if (eregi('php$',$_SERVER["SCRIPT_FILENAME"]) || eregi('php\.exe$',$_SERVER["SCRIPT_FILENAME"])) |
|
$dolibarr_main_document_root=$_SERVER["DOCUMENT_ROOT"]; |
|
|
|
|
|
if (! eregi('\/dolibarr/htdocs$',$dolibarr_main_document_root)) |
|
|
{ |
|
|
$dolibarr_main_document_root.="/dolibarr/htdocs"; |
|
|
} |
|
|
} |
|
|
else |
|
60 |
{ |
{ |
61 |
$dolibarr_main_document_root = substr($_SERVER["SCRIPT_FILENAME"],0,strlen($_SERVER["SCRIPT_FILENAME"])- 21 ); |
$dolibarr_main_document_root=$_SERVER["DOCUMENT_ROOT"]; |
62 |
// Nettoyage du path proposé |
|
63 |
// Gere les chemins windows avec double "\" |
if (! eregi('[\/\\]dolibarr[\/\\]htdocs$',$dolibarr_main_document_root)) |
64 |
$dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root); |
{ |
65 |
|
$dolibarr_main_document_root.="/dolibarr/htdocs"; |
66 |
// Supprime le slash ou antislash final |
} |
67 |
$dolibarr_main_document_root = ereg_replace('[\\\\\/]$','',$dolibarr_main_document_root); |
} |
68 |
} |
else |
69 |
|
{ |
70 |
|
$dolibarr_main_document_root = substr($_SERVER["SCRIPT_FILENAME"],0,strlen($_SERVER["SCRIPT_FILENAME"]) - 21); |
71 |
|
// Nettoyage du path propose |
72 |
|
// Gere les chemins windows avec double "\" |
73 |
|
$dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root); |
74 |
|
|
75 |
|
// Supprime les slash ou antislash de fins |
76 |
|
$dolibarr_main_document_root = ereg_replace('[\\\/]+$','',$dolibarr_main_document_root); |
77 |
|
} |
78 |
} |
} |
79 |
|
|
80 |
?> |
?> |
163 |
</td> |
</td> |
164 |
|
|
165 |
<td class="label"><select name='db_type'> |
<td class="label"><select name='db_type'> |
166 |
<option value='mysql'<?php echo (!$dolibarr_main_db_type||$dolibarr_main_db_type=='mysql')?" selected":"" ?>>MySql</option> |
<option value='mysql'<?php echo (! isset($dolibarr_main_db_type) || $dolibarr_main_db_type=='mysql')?" selected":"" ?>>MySql</option> |
167 |
<option value='pgsql'<?php echo ($dolibarr_main_db_type=='pgsql')?" selected":"" ?>>PostgreSQL <?php echo $langs->trans("Experimental"); ?></option> |
<option value='pgsql'<?php echo (isset($dolibarr_main_db_type) && $dolibarr_main_db_type=='pgsql')?" selected":"" ?>>PostgreSQL <?php echo $langs->trans("Experimental"); ?></option> |
168 |
</select> |
</select> |
169 |
|
|
170 |
</td> |
</td> |
179 |
<td valign="top" class="label"> |
<td valign="top" class="label"> |
180 |
<?php echo $langs->trans("Server"); ?> |
<?php echo $langs->trans("Server"); ?> |
181 |
</td> |
</td> |
182 |
<td valign="top" class="label"><input type="text" name="db_host" value="<?php print $dolibarr_main_db_host ?>"> |
<td valign="top" class="label"><input type="text" name="db_host" value="<?php print isset($dolibarr_main_db_host)?$dolibarr_main_db_host:''; ?>"> |
183 |
<input type="hidden" name="base" value="<?php print $test_base?>"> |
<input type="hidden" name="base" value=""> |
184 |
</td> |
</td> |
185 |
<td class="comment"> |
<td class="comment"> |
186 |
Nom ou adresse ip du serveur de base de données, généralement 'localhost' quand le serveur est installé sur la même machine que le serveur web |
Nom ou adresse ip du serveur de base de données, généralement 'localhost' quand le serveur est installé sur la même machine que le serveur web |
193 |
<?php echo $langs->trans("DatabaseName"); ?> |
<?php echo $langs->trans("DatabaseName"); ?> |
194 |
</td> |
</td> |
195 |
|
|
196 |
<td class="label" valign="top"><input type="text" name="db_name" value="<?php echo $dolibarr_main_db_name ?>"></td> |
<td class="label" valign="top"><input type="text" name="db_name" value="<?php echo isset($dolibarr_main_db_name)?$dolibarr_main_db_name:''; ?>"></td> |
197 |
<td class="comment"> |
<td class="comment"> |
198 |
<?php echo $langs->trans("DatabaseName"); ?> |
<?php echo $langs->trans("DatabaseName"); ?> |
199 |
</td> |
</td> |
214 |
<td class="label" valign="top"> |
<td class="label" valign="top"> |
215 |
<?php echo $langs->trans("Login"); ?> |
<?php echo $langs->trans("Login"); ?> |
216 |
</td> |
</td> |
217 |
<td class="label" valign="top"><input type="text" name="db_user" value="<?php print isset($dolibarr_main_db_user)?$dolibarr_main_db_user:'' ?>"></td> |
<td class="label" valign="top"><input type="text" name="db_user" value="<?php print isset($dolibarr_main_db_user)?$dolibarr_main_db_user:''; ?>"></td> |
218 |
<td class="comment"> |
<td class="comment"> |
219 |
<?php echo $langs->trans("AdminLogin"); ?> |
<?php echo $langs->trans("AdminLogin"); ?> |
220 |
</td> |
</td> |
224 |
<td class="label" valign="top"> |
<td class="label" valign="top"> |
225 |
<?php echo $langs->trans("Password"); ?> |
<?php echo $langs->trans("Password"); ?> |
226 |
</td> |
</td> |
227 |
<td class="label" valign="top"><input type="text" name="db_pass" value="<?php print isset($dolibarr_main_db_pass)?$dolibarr_main_db_pass:'' ?>"></td> |
<td class="label" valign="top"><input type="text" name="db_pass" value="<?php print isset($dolibarr_main_db_pass)?$dolibarr_main_db_pass:''; ?>"></td> |
228 |
<td class="comment"> |
<td class="comment"> |
229 |
<?php echo $langs->trans("AdminPassword"); ?> |
<?php echo $langs->trans("AdminPassword"); ?> |
230 |
</td> |
</td> |
250 |
<td class="label" valign="top"> |
<td class="label" valign="top"> |
251 |
<?php echo $langs->trans("Login"); ?> |
<?php echo $langs->trans("Login"); ?> |
252 |
</td> |
</td> |
253 |
<td class="label" valign="top"><input type="text" name="db_user_root" value="<?php if(isset($db_user_root)) print $db_user_root; ?>"></td> |
<td class="label" valign="top"><input type="text" name="db_user_root" value="<?php if (isset($db_user_root)) print $db_user_root; ?>"></td> |
254 |
<td class="label"><div class="comment">Login de l'utilisateur ayant les droits de création de la base de données, inutile si votre base est déjà créée (comme lorsque vous êtes chez un hébergeur). Laisser vide si vous vous connectez en anonymous</div> |
<td class="label"><div class="comment">Login de l'utilisateur ayant les droits de création de la base de données, inutile si votre base est déjà créée (comme lorsque vous êtes chez un hébergeur). Laisser vide si vous vous connectez en anonymous</div> |
255 |
</td> |
</td> |
256 |
</tr> |
</tr> |
259 |
<td class="label" valign="top"> |
<td class="label" valign="top"> |
260 |
<?php echo $langs->trans("Password"); ?> |
<?php echo $langs->trans("Password"); ?> |
261 |
</td> |
</td> |
262 |
<td class="label" valign="top"><input type="text" name="db_pass_root" value="<?php if(isset($db_pass_root)) print $db_pass_root; ?>"></td> |
<td class="label" valign="top"><input type="text" name="db_pass_root" value="<?php if (isset($db_pass_root)) print $db_pass_root; ?>"></td> |
263 |
<td class="label"><div class="comment"> |
<td class="label"><div class="comment"> |
264 |
<?php echo $langs->trans("KeepEmptyIfNoPassword"); ?> |
<?php echo $langs->trans("KeepEmptyIfNoPassword"); ?> |
265 |
</div> |
</div> |