- Timestamp:
- Dec 4, 2009, 7:59:05 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/template/goto/install.tpl
r4410 r4423 163 163 {else} 164 164 <p> 165 <br /> 166 <input type="button" name="home" value="{'home'|@translate}" onClick="window.open('index.php');"/> 167 <input type="button" name="admin" value="{'admin'|@translate}" onClick="window.open('admin.php');"/> 165 <input type="button" name="home" value="{'home'|@translate}" onClick="window.open('index.php');"> 166 <input type="button" name="admin" value="{'admin'|@translate}" onClick="window.open('admin.php');"> 168 167 </p> 169 168 169 {if !isset($migration)} 170 170 <div class="infos"> 171 171 <ul> … … 175 175 176 176 <p> 177 <br /> 178 <input type="button" name="subscribe" value="{'Subscribe %s'|@translate|@sprintf:$F_ADMIN_EMAIL}" onClick="window.open('{$SUBSCRIBE_BASE_URL}{$F_ADMIN_EMAIL}');"/> 177 <input type="button" name="subscribe" value="{'Subscribe %s'|@translate|@sprintf:$F_ADMIN_EMAIL}" onClick="window.open('{$SUBSCRIBE_BASE_URL}{$F_ADMIN_EMAIL}');"> 179 178 </p> 179 {/if} 180 180 {/if} 181 181 </div> {* content *} -
trunk/install.php
r4410 r4423 123 123 $errors = array(); 124 124 125 // database config file migration : mysql.inc.php et config_database.inc.php 126 $old_config_file = PHPWG_ROOT_PATH . 'include/mysql.inc.php'; 127 $config_file = PHPWG_ROOT_PATH . 'include/config_database.inc.php'; 128 if (!file_exists($config_file) && file_exists($old_config_file)) 129 { 130 $step = 3; 131 include $old_config_file; 132 $file_content = '<?php 133 $conf[\'dblayer\'] = \'mysql\'; 134 $conf[\'db_base\'] = \''.$cfgBase.'\'; 135 $conf[\'db_user\'] = \''.$cfgUser.'\'; 136 $conf[\'db_password\'] = \''.$cfgPassword.'\'; 137 $conf[\'db_host\'] = \''.$cfgHote.'\'; 138 139 $prefixeTable = \''.$prefixeTable.'\'; 140 141 define(\'PHPWG_INSTALLED\', true); 142 define(\'PWG_CHARSET\', \''.PWG_CHARSET.'\'); 143 define(\'DB_CHARSET\', \''.DB_CHARSET.'\'); 144 define(\'DB_COLLATE\', \''.DB_COLLATE.'\'); 145 146 ?'.'>'; 147 } 125 148 // Open config.php ... if it exists 126 $config_file = PHPWG_ROOT_PATH.'include/config_database.inc.php'; 127 if (@file_exists($config_file)) 149 elseif (@file_exists($config_file)) 128 150 { 129 151 include($config_file); … … 176 198 define('PHPWG_URL', 'http://'.PHPWG_DOMAIN); 177 199 178 load_language( 'common.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); 179 load_language( 'admin.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); 180 load_language( 'install.lang', '', array('language'=>$language, 'target_charset'=>'utf-8') ); 200 if ($step != 3) 201 { 202 load_language('common.lang', '', array('language' => $language, 'target_charset'=>'utf-8')); 203 load_language('admin.lang', '', array('language' => $language, 'target_charset'=>'utf-8')); 204 load_language('install.lang', '', array('language' => $language, 'target_charset'=>'utf-8')); 205 } 181 206 182 207 //------------------------------------------------- check php version … … 189 214 include( PHPWG_ROOT_PATH .'include/template.class.php'); 190 215 $template = new Template(PHPWG_ROOT_PATH.'admin/template/goto', 'roma'); 191 $template->set_filenames( array('install'=>'install.tpl') ); 192 $step = 1; 216 $template->set_filenames( array('install' => 'install.tpl') ); 217 if (!isset($step)) 218 { 219 $step = 1; 220 } 193 221 //---------------------------------------------------------------- form analyze 194 222 if ( isset( $_POST['install'] )) … … 353 381 354 382 //------------------------------------------------------ start template output 355 $dbengines = available_engines(); 356 357 foreach (get_languages('utf-8') as $language_code => $language_name) 358 { 359 if ($language == $language_code) 360 { 361 $template->assign('language_selection', $language_code); 362 } 363 $languages_options[$language_code] = $language_name; 364 } 365 $template->assign('language_options', $languages_options); 366 367 $template->assign( 368 array( 369 'T_CONTENT_ENCODING' => 'utf-8', 370 'RELEASE' => PHPWG_VERSION, 371 'F_ACTION' => 'install.php?language=' . $language, 372 'F_DB_ENGINES' => $dbengines, 373 'F_DB_LAYER' => $dblayer, 374 'F_DB_HOST' => $dbhost, 375 'F_DB_USER' => $dbuser, 376 'F_DB_NAME' => $dbname, 377 'F_DB_PREFIX' => $table_prefix, 378 'F_ADMIN' => $admin_name, 379 'F_ADMIN_EMAIL' => $admin_mail, 380 'L_INSTALL_HELP' => sprintf(l10n('install_help'), PHPWG_URL.'/forum'), 381 )); 383 if ($step == 3) 384 { 385 @umask(0111); 386 // writing the new configuration file 387 if ( !($fp = @fopen( $config_file, 'w' ))) 388 { 389 $html_content = htmlentities( $file_content, ENT_QUOTES ); 390 $html_content = nl2br( $html_content ); 391 $error_copy = l10n('Copy the text in pink between hyphens and paste it into the file "include/config_database.inc.php"(Warning : config_database.inc.php must only contain what is in pink, no line return or space character)'); 392 $error_copy .= '<br>--------------------------------------------------------------------<br>'; 393 $error_copy .= '<span class="sql_content">' . $html_content . '</span>'; 394 $error_copy .= '<br>--------------------------------------------------------------------<br>'; 395 } 396 else 397 { 398 @fputs($fp, $file_content, strlen($file_content)); 399 @fclose($fp); 400 401 @unlink($old_config_file); 402 header("Location: index.php"); 403 exit(); 404 } 405 406 $template->assign( 407 array( 408 'T_CONTENT_ENCODING' => 'utf-8', 409 'migration' => true 410 )); 411 } 412 else 413 { 414 $dbengines = available_engines(); 415 416 foreach (get_languages('utf-8') as $language_code => $language_name) 417 { 418 if ($language == $language_code) 419 { 420 $template->assign('language_selection', $language_code); 421 } 422 $languages_options[$language_code] = $language_name; 423 } 424 $template->assign('language_options', $languages_options); 425 426 $template->assign( 427 array( 428 'T_CONTENT_ENCODING' => 'utf-8', 429 'RELEASE' => PHPWG_VERSION, 430 'F_ACTION' => 'install.php?language=' . $language, 431 'F_DB_ENGINES' => $dbengines, 432 'F_DB_LAYER' => $dblayer, 433 'F_DB_HOST' => $dbhost, 434 'F_DB_USER' => $dbuser, 435 'F_DB_NAME' => $dbname, 436 'F_DB_PREFIX' => $table_prefix, 437 'F_ADMIN' => $admin_name, 438 'F_ADMIN_EMAIL' => $admin_mail, 439 'L_INSTALL_HELP' => sprintf(l10n('install_help'), PHPWG_URL.'/forum'), 440 )); 441 } 382 442 383 443 //------------------------------------------------------ errors & infos display … … 385 445 { 386 446 $template->assign('install', true); 447 } 448 elseif ($step == 3) 449 { 450 if (isset($error_copy)) 451 { 452 array_push($errors, $error_copy); 453 } 387 454 } 388 455 else
Note: See TracChangeset
for help on using the changeset viewer.