| [ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004 Éric Seigne <eric.seigne@ryxeo.com> 4 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 5 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> 6 * Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org> 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 * 22 * $Id: fileconf.php,v 1.27.2.2 2006/01/30 22:56:59 eldy Exp $ 23 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/install/fileconf.php,v $ 24 */ 25 26 /** 27 \file htdocs/install/fileconf.php 28 \ingroup install 29 \brief Demande les infos qui constituerons le contenu du fichier conf.php. Ce fichier sera remplie à l'étape suivante 30 \version $Revision: 1.27.2.2 $ 31 */ 32 33 include_once ("./inc.php"); 34 35 $err=0; 36 37 $setuplang=isset($_POST["selectlang"])?$_POST["selectlang"]:(isset($_GET["selectlang"])?$_GET["selectlang"]:'auto'); 38 $langs->setDefaultLang($setuplang); 39 40 $langs->load("install"); 41 42 43 pHeader($langs->trans("ConfigurationFile"),"etape1"); 44 45 // Ici, le fichier conf.php existe et est forcément editable car le test a été fait précédemment. 46 include_once($conffile); 47 48 print '<table border="0" cellpadding="1" cellspacing="0">'; 49 50 print '<tr>'; 51 print '<td valign="top" class="label">'; 52 print $langs->trans("WebPagesDirectory"); 53 print "</td>"; 54 55 if(! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0) 56 { 57 //print "x".$_SERVER["SCRIPT_FILENAME"]." y".$_SERVER["DOCUMENT_ROOT"]; 58 59 // Si le php fonctionne en CGI, alors SCRIPT_FILENAME vaut le path du php et 60 // ce n'est pas ce qu'on veut. Dans ce cas, on propose $_SERVER["DOCUMENT_ROOT"] 61 if (eregi('^php$',$_SERVER["SCRIPT_FILENAME"]) || eregi('[\\\/]php$',$_SERVER["SCRIPT_FILENAME"]) || eregi('php\.exe$',$_SERVER["SCRIPT_FILENAME"])) 62 { 63 $dolibarr_main_document_root=$_SERVER["DOCUMENT_ROOT"]; 64 65 if (! eregi('[\/\\]dolibarr[\/\\]htdocs$',$dolibarr_main_document_root)) 66 { 67 $dolibarr_main_document_root.="/dolibarr/htdocs"; 68 } 69 } 70 else 71 { 72 $dolibarr_main_document_root = substr($_SERVER["SCRIPT_FILENAME"],0,strlen($_SERVER["SCRIPT_FILENAME"]) - 21); 73 // Nettoyage du path propose 74 // Gere les chemins windows avec double "\" 75 $dolibarr_main_document_root = str_replace('\\\\','/',$dolibarr_main_document_root); 76 77 // Supprime les slash ou antislash de fins 78 $dolibarr_main_document_root = ereg_replace('[\\\/]+$','',$dolibarr_main_document_root); 79 } 80 } 81 82 ?> 83 <td class="label" valign="top"><input type="text" size="60" value="<?php print $dolibarr_main_document_root; ?>" name="main_dir"> 84 </td><td class="comment"> 85 <?php 86 print $langs->trans("WithNoSlashAtTheEnd")."<br>"; 87 print $langs->trans("Examples").":<br>"; 88 ?> 89 <li>/var/www/dolibarr/htdocs</li> 90 <li>C:/wwwroot/dolibarr/htdocs</li> 91 </td> 92 </tr> 93 94 <tr> 95 <td valign="top" class="label"> 96 <?php print $langs->trans("DocumentsDirectory"); ?> 97 </td> 98 <?php 99 if(! isset($dolibarr_main_data_root) || strlen($dolibarr_main_data_root) == 0) 100 { 101 // Si le répertoire documents non défini, on en propose un par défaut 102 $dolibarr_main_data_root=ereg_replace("/htdocs","",$dolibarr_main_document_root); 103 $dolibarr_main_data_root.="/documents"; 104 } 105 ?> 106 <td class="label" valign="top"><input type="text" size="60" value="<?php print $dolibarr_main_data_root; ?>" name="main_data_dir"> 107 </td><td class="comment"> 108 <?php 109 print $langs->trans("WithNoSlashAtTheEnd")."<br>"; 110 print "Il est recommandé de mettre ce répertoire en dehors du répertoire des pages web.<br>"; 111 print $langs->trans("Examples").":<br>"; 112 ?> 113 <li>/var/www/dolibarr/documents</li> 114 <li>C:/wwwroot/dolibarr/documents</li> 115 </td> 116 </tr> 117 118 <tr> 119 <td valign="top" class="label"> 120 <?php echo $langs->trans("URLRoot"); ?> 121 </td><td valign="top" class="label"><input type="text" size="60" name="main_url" value=" 122 <?php 123 if (isset($main_url) && $main_url) 124 $dolibarr_main_url_root=$main_url; 125 if (! isset($dolibarr_main_url_root) || strlen($dolibarr_main_url_root) == 0) 126 { 127 if (isset($_SERVER["SCRIPT_URI"])) { # Si défini 128 $dolibarr_main_url_root=$_SERVER["SCRIPT_URI"]; 129 } 130 else { # SCRIPT_URI n'est pas toujours défini (Exemple: Apache 2.0.44 pour Windows) 131 $dolibarr_main_url_root="http://".$_SERVER["SERVER_NAME"].$_SERVER["SCRIPT_NAME"]; 132 } 133 $dolibarr_main_url_root = substr($dolibarr_main_url_root,0,strlen($dolibarr_main_url_root)-12); 134 # Nettoyage de l'URL proposée 135 $dolibarr_main_url_root = ereg_replace('\/$','',$dolibarr_main_url_root); # Supprime le / 136 $dolibarr_main_url_root = ereg_replace('\/index\.php$','',$dolibarr_main_url_root); # Supprime le /index.php 137 $dolibarr_main_url_root = ereg_replace('\/install$','',$dolibarr_main_url_root); # Supprime le /install 138 } 139 140 print $dolibarr_main_url_root; 141 ?>"> 142 </td><td class="comment"> 143 <?php 144 print $langs->trans("Examples").":<br>"; 145 ?> 146 <li>http://dolibarr.lafrere.net</li> 147 <li>http://www.lafrere.net/dolibarr</li> 148 </tr> 149 150 <tr> 151 <td colspan="3" align="center"><h2> 152 <?php echo $langs->trans("DolibarrDatabase"); ?> 153 <h2></td> 154 </tr> 155 <?php 156 if (!isset($dolibarr_main_db_host)) 157 { 158 $dolibarr_main_db_host = "localhost"; 159 } 160 ?> 161 <tr> 162 <!-- moi--> 163 <td valign="top" class="label"> 164 <?php echo $langs->trans("DatabaseType"); ?> 165 </td> 166 167 <td class="label"><select name='db_type'> 168 <option value='mysql'<?php echo (! isset($dolibarr_main_db_type) || $dolibarr_main_db_type=='mysql')?" selected":"" ?>>MySql</option> 169 </select> 170 171 </td> 172 173 <td class="comment"> 174 <?php echo $langs->trans("DatabaseType"); ?> 175 </td> 176 177 </tr> 178 179 <tr> 180 <td valign="top" class="label"> 181 <?php echo $langs->trans("Server"); ?> 182 </td> 183 <td valign="top" class="label"><input type="text" name="db_host" value="<?php print isset($dolibarr_main_db_host)?$dolibarr_main_db_host:''; ?>"> 184 <input type="hidden" name="base" value=""> 185 </td> 186 <td class="comment"> 187 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 188 </td> 189 190 </tr> 191 192 <tr> 193 <td class="label" valign="top"> 194 <?php echo $langs->trans("DatabaseName"); ?> 195 </td> 196 197 <td class="label" valign="top"><input type="text" name="db_name" value="<?php echo isset($dolibarr_main_db_name)?$dolibarr_main_db_name:''; ?>"></td> 198 <td class="comment"> 199 <?php echo $langs->trans("DatabaseName"); ?> 200 </td> 201 </tr> 202 203 <tr> 204 <td class="label" valign="top"> 205 <?php echo $langs->trans("CreateDatabase"); ?> 206 </td> 207 208 <td class="label"><input type="checkbox" name="db_create_database"></td> 209 <td class="comment"> 210 <?php echo $langs->trans("CheckToCreateDatabase"); ?> 211 </td> 212 </tr> 213 214 <tr class="bg1"> 215 <td class="label" valign="top"> 216 <?php echo $langs->trans("Login"); ?> 217 </td> 218 <td class="label" valign="top"><input type="text" name="db_user" value="<?php print isset($dolibarr_main_db_user)?$dolibarr_main_db_user:''; ?>"></td> 219 <td class="comment"> 220 <?php echo $langs->trans("AdminLogin"); ?> 221 </td> 222 </tr> 223 224 <tr> 225 <td class="label" valign="top"> 226 <?php echo $langs->trans("Password"); ?> 227 </td> 228 <td class="label" valign="top"><input type="password" name="db_pass" value="<?php print isset($dolibarr_main_db_pass)?$dolibarr_main_db_pass:''; ?>"></td> 229 <td class="comment"> 230 <?php echo $langs->trans("AdminPassword"); ?> 231 </td> 232 </tr> 233 234 <tr> 235 <td class="label" valign="top"> 236 <?php echo $langs->trans("CreateUser"); ?> 237 </td> 238 239 <td class="label"><input type="checkbox" name="db_create_user"></td> 240 <td class="comment"> 241 <?php echo $langs->trans("CheckToCreateUser"); ?> 242 </td> 243 </tr> 244 245 <tr> 246 <td colspan="3" align="center"><h2> 247 <?php echo $langs->trans("DatabaseSuperUserAccess"); ?> 248 </h2></td></tr> 249 250 <tr> 251 <td class="label" valign="top"> 252 <?php echo $langs->trans("Login"); ?> 253 </td> 254 <td class="label" valign="top"><input type="text" name="db_user_root" value="<?php if (isset($db_user_root)) print $db_user_root; ?>"></td> 255 <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> 256 </td> 257 </tr> 258 259 <tr> 260 <td class="label" valign="top"> 261 <?php echo $langs->trans("Password"); ?> 262 </td> 263 <td class="label" valign="top"><input type="text" name="db_pass_root" value="<?php if (isset($db_pass_root)) print $db_pass_root; ?>"></td> 264 <td class="label"><div class="comment"> 265 <?php echo $langs->trans("KeepEmptyIfNoPassword"); ?> 266 </div> 267 </td> 268 </tr> 269 270 </table> 271 272 <?php 273 274 pFooter($err,$setuplang); 275 276 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
|