2003-11-02 11:22:45 +01:00
|
|
|
<?php
|
2004-02-07 20:36:44 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
2004-11-06 22:12:59 +01:00
|
|
|
// | PhpWebGallery - a PHP based picture gallery |
|
|
|
|
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
|
2007-01-16 23:23:05 +01:00
|
|
|
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
|
2004-02-07 20:36:44 +01:00
|
|
|
// +-----------------------------------------------------------------------+
|
2007-02-25 12:42:25 +01:00
|
|
|
// | file : $Id$
|
2004-02-07 20:36:44 +01:00
|
|
|
// | last update : $Date$
|
|
|
|
// | last modifier : $Author$
|
|
|
|
// | revision : $Revision$
|
|
|
|
// +-----------------------------------------------------------------------+
|
|
|
|
// | This program is free software; you can redistribute it and/or modify |
|
|
|
|
// | it under the terms of the GNU General Public License as published by |
|
|
|
|
// | the Free Software Foundation |
|
|
|
|
// | |
|
|
|
|
// | This program is distributed in the hope that it will be useful, but |
|
|
|
|
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
|
|
|
// | General Public License for more details. |
|
|
|
|
// | |
|
|
|
|
// | You should have received a copy of the GNU General Public License |
|
|
|
|
// | along with this program; if not, write to the Free Software |
|
|
|
|
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
|
|
|
|
// | USA. |
|
|
|
|
// +-----------------------------------------------------------------------+
|
2003-11-02 11:22:45 +01:00
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
//----------------------------------------------------------- include
|
|
|
|
define('PHPWG_ROOT_PATH','./');
|
2004-02-02 01:55:18 +01:00
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
// Guess an initial language ...
|
|
|
|
function guess_lang()
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-07-28 19:21:58 +02:00
|
|
|
return 'en_UK.iso-8859-1';
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
|
2007-02-25 12:42:25 +01:00
|
|
|
//
|
|
|
|
// Pick a language, any language ...
|
|
|
|
//
|
|
|
|
function language_select($default, $select_name = "language")
|
|
|
|
{
|
|
|
|
$available_lang = get_languages();
|
|
|
|
|
|
|
|
$lang_select = '<select name="' . $select_name . '" onchange="document.location = \''.PHPWG_ROOT_PATH.'install.php?language=\'+this.options[this.selectedIndex].value;">';
|
|
|
|
foreach ($available_lang as $code => $displayname)
|
|
|
|
{
|
|
|
|
$selected = ( strtolower($default) == strtolower($code) ) ? ' selected="selected"' : '';
|
|
|
|
$lang_select .= '<option value="'.$code.'" ' . $selected . '>' . ucwords($displayname) . '</option>';
|
|
|
|
}
|
|
|
|
$lang_select .= '</select>';
|
|
|
|
|
|
|
|
return $lang_select;
|
|
|
|
}
|
|
|
|
|
2004-09-20 22:54:22 +02:00
|
|
|
/**
|
|
|
|
* loads an sql file and executes all queries
|
|
|
|
*
|
|
|
|
* Before executing a query, $replaced is... replaced by $replacing. This is
|
|
|
|
* useful when the SQL file contains generic words. Drop table queries are
|
|
|
|
* not executed.
|
|
|
|
*
|
|
|
|
* @param string filepath
|
|
|
|
* @param string replaced
|
|
|
|
* @param string replacing
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
function execute_sqlfile($filepath, $replaced, $replacing)
|
2004-03-05 00:55:40 +01:00
|
|
|
{
|
2004-09-20 22:54:22 +02:00
|
|
|
$sql_lines = file($filepath);
|
2004-03-05 00:55:40 +01:00
|
|
|
$query = '';
|
2004-09-20 22:54:22 +02:00
|
|
|
foreach ($sql_lines as $sql_line)
|
|
|
|
{
|
|
|
|
$sql_line = trim($sql_line);
|
|
|
|
if (preg_match('/(^--|^$)/', $sql_line))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2004-03-05 00:55:40 +01:00
|
|
|
$query.= ' '.$sql_line;
|
|
|
|
// if we reached the end of query, we execute it and reinitialize the
|
|
|
|
// variable "query"
|
2004-09-20 22:54:22 +02:00
|
|
|
if (preg_match('/;$/', $sql_line))
|
2004-03-05 00:55:40 +01:00
|
|
|
{
|
2004-09-20 22:54:22 +02:00
|
|
|
$query = trim($query);
|
|
|
|
$query = str_replace($replaced, $replacing, $query);
|
2004-03-05 00:55:40 +01:00
|
|
|
// we don't execute "DROP TABLE" queries
|
2004-09-20 22:54:22 +02:00
|
|
|
if (!preg_match('/^DROP TABLE/i', $query))
|
|
|
|
{
|
|
|
|
mysql_query($query);
|
|
|
|
}
|
2004-03-05 00:55:40 +01:00
|
|
|
$query = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
set_magic_quotes_runtime(0); // Disable magic_quotes_runtime
|
|
|
|
//
|
|
|
|
// addslashes to vars if magic_quotes_gpc is off this is a security
|
|
|
|
// precaution to prevent someone trying to break out of a SQL statement.
|
|
|
|
//
|
|
|
|
if( !get_magic_quotes_gpc() )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
if( is_array($_POST) )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
while( list($k, $v) = each($_POST) )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
if( is_array($_POST[$k]) )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
while( list($k2, $v2) = each($_POST[$k]) )
|
|
|
|
{
|
|
|
|
$_POST[$k][$k2] = addslashes($v2);
|
|
|
|
}
|
|
|
|
@reset($_POST[$k]);
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
$_POST[$k] = addslashes($v);
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
@reset($_POST);
|
|
|
|
}
|
|
|
|
|
2007-02-25 12:42:25 +01:00
|
|
|
if( is_array($_GET) )
|
|
|
|
{
|
|
|
|
while( list($k, $v) = each($_GET) )
|
|
|
|
{
|
|
|
|
if( is_array($_GET[$k]) )
|
|
|
|
{
|
|
|
|
while( list($k2, $v2) = each($_GET[$k]) )
|
|
|
|
{
|
|
|
|
$_GET[$k][$k2] = addslashes($v2);
|
|
|
|
}
|
|
|
|
@reset($_GET[$k]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$_GET[$k] = addslashes($v);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@reset($_GET);
|
|
|
|
}
|
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
if( is_array($_COOKIE) )
|
|
|
|
{
|
|
|
|
while( list($k, $v) = each($_COOKIE) )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
if( is_array($_COOKIE[$k]) )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
while( list($k2, $v2) = each($_COOKIE[$k]) )
|
|
|
|
{
|
|
|
|
$_COOKIE[$k][$k2] = addslashes($v2);
|
|
|
|
}
|
|
|
|
@reset($_COOKIE[$k]);
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
$_COOKIE[$k] = addslashes($v);
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
@reset($_COOKIE);
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
}
|
2003-11-02 11:22:45 +01:00
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
//----------------------------------------------------- variable initialization
|
2006-04-11 21:50:15 +02:00
|
|
|
|
|
|
|
define('DEFAULT_PREFIX_TABLE', 'phpwebgallery_');
|
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
// Obtain various vars
|
|
|
|
$dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : 'localhost';
|
|
|
|
$dbuser = (!empty($_POST['dbuser'])) ? $_POST['dbuser'] : '';
|
|
|
|
$dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : '';
|
|
|
|
$dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : '';
|
|
|
|
|
2006-04-11 21:50:15 +02:00
|
|
|
if (isset($_POST['install']))
|
|
|
|
{
|
|
|
|
$table_prefix = $_POST['prefix'];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$table_prefix = DEFAULT_PREFIX_TABLE;
|
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
|
|
|
|
$admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : '';
|
|
|
|
$admin_pass1 = (!empty($_POST['admin_pass1'])) ? $_POST['admin_pass1'] : '';
|
|
|
|
$admin_pass2 = (!empty($_POST['admin_pass2'])) ? $_POST['admin_pass2'] : '';
|
|
|
|
$admin_mail = (!empty($_POST['admin_mail'])) ? $_POST['admin_mail'] : '';
|
|
|
|
|
|
|
|
$infos = array();
|
|
|
|
$errors = array();
|
|
|
|
|
|
|
|
// Open config.php ... if it exists
|
|
|
|
$config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';
|
|
|
|
if (@file_exists($config_file))
|
|
|
|
{
|
2004-09-20 22:54:22 +02:00
|
|
|
include($config_file);
|
|
|
|
// Is PhpWebGallery already installed ?
|
|
|
|
if (defined("PHPWG_INSTALLED"))
|
|
|
|
{
|
|
|
|
die('PhpWebGallery is already installed');
|
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
}
|
|
|
|
|
2005-01-09 00:56:59 +01:00
|
|
|
$prefixeTable = $table_prefix;
|
2005-08-17 23:03:46 +02:00
|
|
|
include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
|
2006-03-14 22:31:31 +01:00
|
|
|
@include(PHPWG_ROOT_PATH. 'include/config_local.inc.php');
|
2004-02-20 20:07:43 +01:00
|
|
|
include(PHPWG_ROOT_PATH . 'include/constants.php');
|
|
|
|
include(PHPWG_ROOT_PATH . 'include/functions.inc.php');
|
2006-04-20 21:31:12 +02:00
|
|
|
include(PHPWG_ROOT_PATH . 'admin/include/functions.php');
|
2004-02-20 20:07:43 +01:00
|
|
|
include(PHPWG_ROOT_PATH . 'include/template.php');
|
2004-09-20 22:54:22 +02:00
|
|
|
|
|
|
|
if ( isset( $_POST['language'] ))
|
|
|
|
{
|
|
|
|
$language = strip_tags($_POST['language']);
|
|
|
|
}
|
2007-02-25 12:42:25 +01:00
|
|
|
elseif ( isset( $_GET['language'] ))
|
|
|
|
{
|
|
|
|
$language = strip_tags($_GET['language']);
|
|
|
|
}
|
2004-09-20 22:54:22 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
$language = guess_lang();
|
|
|
|
}
|
|
|
|
|
2005-03-12 11:51:08 +01:00
|
|
|
if (!file_exists(PHPWG_ROOT_PATH.'language/'.$language.'/install.lang.php'))
|
2004-09-20 22:54:22 +02:00
|
|
|
{
|
|
|
|
$language = 'en_UK.iso-8859-1';
|
|
|
|
}
|
|
|
|
|
|
|
|
include( './language/'.$language.'/common.lang.php' );
|
2006-12-25 08:17:29 +01:00
|
|
|
// Never: @include( './language/'.$language.'/local.lang.php' );
|
2004-09-20 22:54:22 +02:00
|
|
|
include( './language/'.$language.'/admin.lang.php' );
|
|
|
|
include( './language/'.$language.'/install.lang.php' );
|
2004-02-20 20:07:43 +01:00
|
|
|
//----------------------------------------------------- template initialization
|
2005-09-03 22:56:35 +02:00
|
|
|
$template=setup_style('yoga');
|
2004-02-20 20:07:43 +01:00
|
|
|
$template->set_filenames( array('install'=>'install.tpl') );
|
|
|
|
$step = 1;
|
2004-09-20 22:54:22 +02:00
|
|
|
//---------------------------------------------------------------- form analyze
|
2004-02-20 20:07:43 +01:00
|
|
|
if ( isset( $_POST['install'] ))
|
|
|
|
{
|
2004-03-05 00:55:40 +01:00
|
|
|
if ( @mysql_connect( $_POST['dbhost'],
|
|
|
|
$_POST['dbuser'],
|
|
|
|
$_POST['dbpasswd'] ) )
|
|
|
|
{
|
|
|
|
if ( @mysql_select_db($_POST['dbname'] ) )
|
2004-02-20 20:07:43 +01:00
|
|
|
{
|
2004-03-05 00:55:40 +01:00
|
|
|
array_push( $infos, $lang['step1_confirmation'] );
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
else
|
|
|
|
{
|
2004-03-05 00:55:40 +01:00
|
|
|
array_push( $errors, $lang['step1_err_db'] );
|
2004-02-20 20:07:43 +01:00
|
|
|
}
|
2004-03-05 00:55:40 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
array_push( $errors, $lang['step1_err_server'] );
|
|
|
|
}
|
|
|
|
|
|
|
|
$webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name ));
|
|
|
|
if ( empty($webmaster))
|
|
|
|
array_push( $errors, $lang['step2_err_login1'] );
|
|
|
|
else if ( preg_match( '/[\'"]/', $webmaster ) )
|
|
|
|
array_push( $errors, $lang['step2_err_login3'] );
|
|
|
|
if ( $admin_pass1 != $admin_pass2 || empty($admin_pass1) )
|
|
|
|
array_push( $errors, $lang['step2_err_pass'] );
|
|
|
|
if ( empty($admin_mail))
|
|
|
|
array_push( $errors, $lang['reg_err_mail_address'] );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$error_mail_address = validate_mail_address($admin_mail);
|
|
|
|
if (!empty($error_mail_address))
|
|
|
|
array_push( $errors, $error_mail_address );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( count( $errors ) == 0 )
|
|
|
|
{
|
|
|
|
$step = 2;
|
2006-04-11 21:50:15 +02:00
|
|
|
$file_content = '<?php
|
|
|
|
$cfgBase = \''.$dbname.'\';
|
|
|
|
$cfgUser = \''.$dbuser.'\';
|
|
|
|
$cfgPassword = \''.$dbpasswd.'\';
|
|
|
|
$cfgHote = \''.$dbhost.'\';
|
|
|
|
|
|
|
|
$prefixeTable = \''.$table_prefix.'\';
|
|
|
|
|
|
|
|
define(\'PHPWG_INSTALLED\', true);
|
|
|
|
?'.'>';
|
2004-03-05 00:55:40 +01:00
|
|
|
|
|
|
|
@umask(0111);
|
|
|
|
// writing the configuration file
|
|
|
|
if ( !($fp = @fopen( $config_file, 'w' )))
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-03-05 00:55:40 +01:00
|
|
|
$html_content = htmlentities( $file_content, ENT_QUOTES );
|
|
|
|
$html_content = nl2br( $html_content );
|
2006-04-27 23:08:50 +02:00
|
|
|
$template->assign_block_vars(
|
|
|
|
'error_copy',
|
|
|
|
array(
|
|
|
|
'FILE_CONTENT' => $html_content,
|
|
|
|
)
|
|
|
|
);
|
2004-03-05 00:55:40 +01:00
|
|
|
}
|
|
|
|
@fputs($fp, $file_content, strlen($file_content));
|
|
|
|
@fclose($fp);
|
|
|
|
|
|
|
|
// tables creation, based on phpwebgallery_structure.sql
|
2006-04-11 21:50:15 +02:00
|
|
|
execute_sqlfile(
|
|
|
|
PHPWG_ROOT_PATH.'install/phpwebgallery_structure.sql',
|
|
|
|
DEFAULT_PREFIX_TABLE,
|
|
|
|
$table_prefix
|
|
|
|
);
|
2004-03-05 00:55:40 +01:00
|
|
|
// We fill the tables with basic informations
|
2006-04-11 21:50:15 +02:00
|
|
|
execute_sqlfile(
|
|
|
|
PHPWG_ROOT_PATH.'install/config.sql',
|
|
|
|
DEFAULT_PREFIX_TABLE,
|
|
|
|
$table_prefix
|
|
|
|
);
|
2003-11-02 11:22:45 +01:00
|
|
|
|
2006-04-27 23:08:50 +02:00
|
|
|
// fill $conf global array
|
|
|
|
load_conf_from_db();
|
|
|
|
|
|
|
|
$insert = array(
|
|
|
|
'id' => 1,
|
|
|
|
'galleries_url' => PHPWG_ROOT_PATH.'galleries/',
|
|
|
|
);
|
|
|
|
mass_inserts(SITES_TABLE, array_keys($insert), array($insert));
|
2004-03-05 00:55:40 +01:00
|
|
|
|
|
|
|
// webmaster admin user
|
2006-04-27 23:08:50 +02:00
|
|
|
$inserts = array(
|
|
|
|
array(
|
|
|
|
'id' => 1,
|
|
|
|
'username' => $admin_name,
|
|
|
|
'password' => md5($admin_pass1),
|
|
|
|
'mail_address' => $admin_mail,
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'id' => 2,
|
|
|
|
'username' => 'guest',
|
|
|
|
),
|
|
|
|
);
|
|
|
|
mass_inserts(USERS_TABLE, array_keys($inserts[0]), $inserts);
|
2005-07-16 16:29:35 +02:00
|
|
|
|
2007-03-29 00:30:04 +02:00
|
|
|
create_user_infos(array(1,2), array('language' => $language));
|
2006-02-06 22:52:16 +01:00
|
|
|
|
|
|
|
// Available upgrades must be ignored after a fresh installation. To
|
|
|
|
// make PWG avoid upgrading, we must tell it upgrades have already been
|
|
|
|
// made.
|
2006-04-20 21:31:12 +02:00
|
|
|
list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
|
|
|
|
define('CURRENT_DATE', $dbnow);
|
|
|
|
$datas = array();
|
2006-02-06 22:52:16 +01:00
|
|
|
foreach (get_available_upgrade_ids() as $upgrade_id)
|
|
|
|
{
|
2006-04-20 21:31:12 +02:00
|
|
|
array_push(
|
|
|
|
$datas,
|
|
|
|
array(
|
|
|
|
'id' => $upgrade_id,
|
|
|
|
'applied' => CURRENT_DATE,
|
|
|
|
'description' => 'upgrade included in installation',
|
|
|
|
)
|
|
|
|
);
|
2006-02-06 22:52:16 +01:00
|
|
|
}
|
2006-04-20 21:31:12 +02:00
|
|
|
mass_inserts(
|
|
|
|
UPGRADE_TABLE,
|
|
|
|
array_keys($datas[0]),
|
|
|
|
$datas
|
|
|
|
);
|
2004-03-05 00:55:40 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
}
|
2003-11-02 11:22:45 +01:00
|
|
|
|
2004-09-20 22:54:22 +02:00
|
|
|
$template->assign_vars(
|
|
|
|
array(
|
|
|
|
'RELEASE'=>PHPWG_VERSION,
|
2004-02-20 20:07:43 +01:00
|
|
|
|
2004-09-20 22:54:22 +02:00
|
|
|
'L_BASE_TITLE'=>$lang['Initial_config'],
|
|
|
|
'L_LANG_TITLE'=>$lang['Default_lang'],
|
|
|
|
'L_DB_TITLE'=>$lang['step1_title'],
|
|
|
|
'L_DB_HOST'=>$lang['step1_host'],
|
|
|
|
'L_DB_HOST_INFO'=>$lang['step1_host_info'],
|
|
|
|
'L_DB_USER'=>$lang['step1_user'],
|
|
|
|
'L_DB_USER_INFO'=>$lang['step1_user_info'],
|
|
|
|
'L_DB_PASS'=>$lang['step1_pass'],
|
|
|
|
'L_DB_PASS_INFO'=>$lang['step1_pass_info'],
|
|
|
|
'L_DB_NAME'=>$lang['step1_database'],
|
|
|
|
'L_DB_NAME_INFO'=>$lang['step1_database_info'],
|
|
|
|
'L_DB_PREFIX'=>$lang['step1_prefix'],
|
|
|
|
'L_DB_PREFIX_INFO'=>$lang['step1_prefix_info'],
|
|
|
|
'L_ADMIN_TITLE'=>$lang['step2_title'],
|
|
|
|
'L_ADMIN'=>$lang['install_webmaster'],
|
|
|
|
'L_ADMIN_INFO'=>$lang['install_webmaster_info'],
|
|
|
|
'L_ADMIN_PASSWORD'=>$lang['step2_pwd'],
|
|
|
|
'L_ADMIN_PASSWORD_INFO'=>$lang['step2_pwd_info'],
|
|
|
|
'L_ADMIN_CONFIRM_PASSWORD'=>$lang['step2_pwd_conf'],
|
|
|
|
'L_ADMIN_CONFIRM_PASSWORD_INFO'=>$lang['step2_pwd_conf_info'],
|
|
|
|
'L_ADMIN_EMAIL'=>$lang['conf_mail_webmaster'],
|
|
|
|
'L_ADMIN_EMAIL_INFO'=>$lang['conf_mail_webmaster_info'],
|
|
|
|
'L_SUBMIT'=>$lang['Start_Install'],
|
2007-01-16 23:23:05 +01:00
|
|
|
'L_INSTALL_HELP'=>sprintf($lang['install_help'], 'http://forum.'.PHPWG_DOMAIN.'/'),
|
2004-09-20 22:54:22 +02:00
|
|
|
'L_ERR_COPY'=>$lang['step1_err_copy'],
|
|
|
|
'L_END_TITLE'=>$lang['install_end_title'],
|
|
|
|
'L_END_MESSAGE'=>$lang['install_end_message'],
|
|
|
|
|
2005-07-16 16:29:35 +02:00
|
|
|
'F_ACTION'=>'install.php',
|
2004-09-20 22:54:22 +02:00
|
|
|
'F_DB_HOST'=>$dbhost,
|
|
|
|
'F_DB_USER'=>$dbuser,
|
|
|
|
'F_DB_NAME'=>$dbname,
|
2006-04-11 21:50:15 +02:00
|
|
|
'F_DB_PREFIX' => (
|
|
|
|
$table_prefix != DEFAULT_PREFIX_TABLE
|
|
|
|
? $table_prefix
|
|
|
|
: DEFAULT_PREFIX_TABLE
|
|
|
|
),
|
2004-09-20 22:54:22 +02:00
|
|
|
'F_ADMIN'=>$admin_name,
|
|
|
|
'F_ADMIN_EMAIL'=>$admin_mail,
|
|
|
|
'F_LANG_SELECT'=>language_select($language),
|
|
|
|
|
|
|
|
'T_CONTENT_ENCODING' => $lang_info['charset']
|
|
|
|
));
|
|
|
|
|
|
|
|
//------------------------------------------------------ errors & infos display
|
2004-02-20 20:07:43 +01:00
|
|
|
if ( sizeof( $errors ) != 0 )
|
|
|
|
{
|
|
|
|
$template->assign_block_vars('errors',array());
|
|
|
|
for ( $i = 0; $i < sizeof( $errors ); $i++ )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
$template->assign_block_vars('errors.error',array('ERROR'=>$errors[$i]));
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
}
|
2003-11-02 11:22:45 +01:00
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
if ( sizeof( $infos ) != 0 )
|
|
|
|
{
|
|
|
|
$template->assign_block_vars('infos',array());
|
|
|
|
for ( $i = 0; $i < sizeof( $infos ); $i++ )
|
2003-11-02 11:22:45 +01:00
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
$template->assign_block_vars('infos.info',array('INFO'=>$infos[$i]));
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
}
|
2003-11-02 11:22:45 +01:00
|
|
|
|
2004-02-20 20:07:43 +01:00
|
|
|
if ($step ==1)
|
|
|
|
{
|
|
|
|
$template->assign_block_vars('install',array());
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2004-02-20 20:07:43 +01:00
|
|
|
$template->assign_block_vars('install_end',array());
|
2003-11-02 11:22:45 +01:00
|
|
|
}
|
2004-02-20 20:07:43 +01:00
|
|
|
|
2003-11-02 11:22:45 +01:00
|
|
|
//----------------------------------------------------------- html code display
|
2004-02-20 20:07:43 +01:00
|
|
|
$template->pparse('install');
|
2004-02-12 00:20:38 +01:00
|
|
|
?>
|