|
From: Jon O. <jon...@us...> - 2008-02-10 21:11:35
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4614 Modified Files: Tag: core28x mx_install.php Log Message: Minor updates to installation Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.79.2.3 retrieving revision 1.79.2.4 diff -C2 -d -r1.79.2.3 -r1.79.2.4 *** mx_install.php 7 Feb 2008 03:03:25 -0000 1.79.2.3 --- mx_install.php 10 Feb 2008 21:11:28 -0000 1.79.2.4 *************** *** 2,8 **** /** * ! * @package mxBB Installation * @version $Id$ ! * @copyright (c) 2002-2006 mxBB Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mx-publisher.com --- 2,8 ---- /** * ! * @package MX-Publisher Installation * @version $Id$ ! * @copyright (c) 2002-2008 MX-Publisher Project Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * @link http://www.mx-publisher.com *************** *** 19,23 **** // // FYI: This installation script will try to find your phpBB board and then ! // to get from there all the information required to install mxBB-Portal. // However, the methods we use might not work on some configurations. // If you get into trouble when running this installation script, then --- 19,23 ---- // // FYI: This installation script will try to find your phpBB board and then ! // to get from there all the information required to install MX-Publisher. // However, the methods we use might not work on some configurations. // If you get into trouble when running this installation script, then *************** *** 30,38 **** // ! // Set mxBB-Portal version here ! // ! $mx_portal_name = 'mxBB-Portal'; ! $mx_portal_version = '2.8.1'; ! $mx_portal_copy = '<b>mxBB - Modular Portal & CMS for phpBB!</b> <br /><br/> mxBB is a fully modular portal and CMS for phpBB, featuring dynamic pages, blocks, and themes, by means of a powerful yet flexible AdminCP. It works without touching phpBB by using integrated functions and features. mxBB-Portal is the classical phpBB portal add-on, improved and enhanced for every phpBB version released since 2001. <br /><br />Authors: The mxBB Development Team. <br />Please visit <a href="http://www.mx-system.com/">www.mx-system.com</a> for further information.'; // --- 30,38 ---- // ! // Set MX-Publisher version here ! // ! $mx_portal_name = 'MX-Publisher Modular System'; ! $mx_portal_version = '2.8.2'; ! $mx_portal_copy = '<b>MX-Publisher Modular System!</b> <br /><br/> MX-Publisher is a fully modular system, portal and CMS, featuring dynamic pages, blocks, and themes, by means of a powerful yet flexible AdminCP. It is the classical phpBB portal add-on, improved and enhanced for every phpBB version released since 2001 (originally named MX-Publisher). <br /><br />Authors: The MX-Publisher Development Team. <br />Please visit <a href="http://www.mx-publisher.com/">www.mx-publisher.com</a> for further information.'; // *************** *** 40,54 **** // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '2.2.0'); ! define('INSTALLER_NAME', 'mxBB-IWizard'); // // These URLs are used in the footer installation panels. // ! define('U_RELEASE_NOTES', 'http://www.mx-system.com/forum/viewtopic.php?t=1224'); ! define('U_WELCOME_PACK', 'http://www.mx-system.com/index.php?page=136'); ! define('U_ONLINE_FAQ', 'http://www.mx-system.com/index.php?page=117'); ! define('U_ONLINE_SUPPORT', 'http://www.mx-system.com/index.php?page=2'); ! define('U_TERMS_OF_USE', 'http://www.mx-system.com/index.php?page=126&dynamic_block=133'); // --- 40,54 ---- // This is shown in the top right corner of the installation panels. // ! define('INSTALLER_VERSION', '2.2.1'); ! define('INSTALLER_NAME', 'MX-Publisher-IWizard'); // // These URLs are used in the footer installation panels. // ! define('U_RELEASE_NOTES', 'http://www.mx-publisher.com/forum/viewtopic.php?t=1224'); ! define('U_WELCOME_PACK', 'http://www.mx-publisher.com/index.php?page=136'); ! define('U_ONLINE_FAQ', 'http://www.mx-publisher.com/index.php?page=117'); ! define('U_ONLINE_SUPPORT', 'http://www.mx-publisher.com/index.php?page=2'); ! define('U_TERMS_OF_USE', 'http://www.mx-publisher.com/index.php?page=126&dynamic_block=133'); // *************** *** 124,128 **** if (isset($not_unset[$varname])) { ! // Hacking attempt. No point in continuing unless it's a COOKIE //removed for mx_install: $varname !== 'GLOBALS' || if (isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS'])) { --- 124,128 ---- if (isset($not_unset[$varname])) { ! // Hacking attempt. No point in continuing unless it's a COOKIE //removed for mx_install: $varname !== 'GLOBALS' || if (isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS'])) { *************** *** 150,154 **** unset($input); ! } // If we are on PHP >= 6.0.0 we do not need some code if (phpversion() >= '6.0.0-dev') --- 150,154 ---- unset($input); ! } // If we are on PHP >= 6.0.0 we do not need some code if (phpversion() >= '6.0.0-dev') *************** *** 180,185 **** if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) { ! $HTTP_POST_VARS = $_POST; ! $HTTP_GET_VARS = $_GET; $HTTP_SERVER_VARS = $_SERVER; $HTTP_COOKIE_VARS = $_COOKIE; --- 180,185 ---- if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) { ! $_POST = $_POST; ! $_GET = $_GET; $HTTP_SERVER_VARS = $_SERVER; $HTTP_COOKIE_VARS = $_COOKIE; *************** *** 196,200 **** // Protect against GLOBALS tricks ! if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS'])) { die("Hacking attempt"); --- 196,200 ---- // Protect against GLOBALS tricks ! if (isset($_POST['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($_GET['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS'])) { die("Hacking attempt"); *************** *** 207,210 **** --- 207,244 ---- } + if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') + { + // PHP4+ path + $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx'); + + // Not only will array_merge give a warning if a parameter + // is not an array, it will actually fail. So we check if + // HTTP_SESSION_VARS has been initialised. + if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS)) + { + $HTTP_SESSION_VARS = array(); + } + + // Merge all into one extremely huge array; unset + // this later + // + // Note! Since array_merge() destroys numerical keys - if the array is numerically indexed, the keys get reindexed in a continuous way - we use the + operator instead + // + $input = array_merge($_GET, $_POST, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES); + //$input = $_GET + $_POST + $HTTP_COOKIE_VARS + $HTTP_SERVER_VARS + $HTTP_SESSION_VARS + $HTTP_ENV_VARS + $HTTP_POST_FILES; + + unset($input['input']); + unset($input['not_unset']); + + while (list($var,) = @each($input)) + { + if (in_array($var, $not_unset)) + { + die('Hacking attempt!'); + } + unset($$var); + } + unset($input); + } // *************** *** 215,256 **** if( !get_magic_quotes_gpc() ) { ! if( is_array($HTTP_GET_VARS) ) { ! while( list($k, $v) = each($HTTP_GET_VARS) ) { ! if( is_array($HTTP_GET_VARS[$k]) ) { ! while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) { ! $HTTP_GET_VARS[$k][$k2] = addslashes($v2); } ! @reset($HTTP_GET_VARS[$k]); } else { ! $HTTP_GET_VARS[$k] = addslashes($v); } } ! @reset($HTTP_GET_VARS); } ! if( is_array($HTTP_POST_VARS) ) { ! while( list($k, $v) = each($HTTP_POST_VARS) ) { ! if( is_array($HTTP_POST_VARS[$k]) ) { ! while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) { ! $HTTP_POST_VARS[$k][$k2] = addslashes($v2); } ! @reset($HTTP_POST_VARS[$k]); } else { ! $HTTP_POST_VARS[$k] = addslashes($v); } } ! @reset($HTTP_POST_VARS); } --- 249,290 ---- if( !get_magic_quotes_gpc() ) { ! 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); } ! if( is_array($_POST) ) { ! while( list($k, $v) = each($_POST) ) { ! if( is_array($_POST[$k]) ) { ! while( list($k2, $v2) = each($_POST[$k]) ) { ! $_POST[$k][$k2] = addslashes($v2); } ! @reset($_POST[$k]); } else { ! $_POST[$k] = addslashes($v); } } ! @reset($_POST); } *************** *** 310,320 **** 'COMMENTS' => 'mx_remove_remarks' ), ! // 'postgres' => array( ! // 'LABEL' => 'PostgreSQL 7.x', ! // 'SCHEMA' => 'postgres', ! // 'DELIM' => ';', ! // 'DELIM_BASIC' => ';', ! // 'COMMENTS' => 'mx_remove_comments' ! // ), // 'mssql' => array( // 'LABEL' => 'MS SQL Server 7/2000', --- 344,354 ---- 'COMMENTS' => 'mx_remove_remarks' ), ! 'postgres' => array( ! 'LABEL' => 'PostgreSQL 7.x', ! 'SCHEMA' => 'postgres', ! 'DELIM' => ';', ! 'DELIM_BASIC' => ';', ! 'COMMENTS' => 'mx_remove_comments' ! ), // 'mssql' => array( // 'LABEL' => 'MS SQL Server 7/2000', *************** *** 364,368 **** // Send file -------------------------------------------------- // ! if ( isset($HTTP_POST_VARS['send_file']) && $HTTP_POST_VARS['send_file'] == 1 ) { header( "Content-Type: text/x-delimtext; name=\"config.$phpEx\"" ); --- 398,402 ---- // Send file -------------------------------------------------- // ! if ( isset($_POST['send_file']) && $_POST['send_file'] == 1 ) { header( "Content-Type: text/x-delimtext; name=\"config.$phpEx\"" ); *************** *** 373,378 **** // if it is on. ! $HTTP_POST_VARS['config_data'] = stripslashes( $HTTP_POST_VARS['config_data'] ); ! echo $HTTP_POST_VARS['config_data']; exit; } --- 407,412 ---- // if it is on. ! $_POST['config_data'] = stripslashes( $_POST['config_data'] ); ! echo $_POST['config_data']; exit; } *************** *** 381,385 **** // phpInfo -------------------------------------------------- // ! if ( isset($HTTP_GET_VARS['phpinfo']) ) { show_phpinfo(); --- 415,419 ---- // phpInfo -------------------------------------------------- // ! if ( isset($_GET['phpinfo']) ) { show_phpinfo(); *************** *** 390,394 **** // Load the installation language // ! $language = ( isset($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : ( isset($HTTP_GET_VARS['language']) ? $HTTP_GET_VARS['language'] : '' ) ); $language = ( preg_match('#^[a-z_]+$#', $language) ? strip_tags($language) : '' ); --- 424,428 ---- // Load the installation language // ! $language = ( isset($_POST['language']) ? $_POST['language'] : ( isset($_GET['language']) ? $_GET['language'] : '' ) ); $language = ( preg_match('#^[a-z_]+$#', $language) ? strip_tags($language) : '' ); *************** *** 404,409 **** if( install_language_select($lang_options, $language, 'language') > 1 ) { ! include($mx_root_path . "language/lang_$language/lang_main.$phpEx"); ! include($mx_root_path . "language/lang_$language/lang_admin.$phpEx"); $s_hidden_fields = ''; --- 438,449 ---- if( install_language_select($lang_options, $language, 'language') > 1 ) { ! if( @file_exists($mx_root_path . "install/language/lang_$language/lang_admin.$phpEx") ) ! { ! include($mx_root_path . "install/language/lang_$language/lang_admin.$phpEx"); ! } ! else ! { ! include($mx_root_path . "install/language/lang_english/lang_admin.$phpEx"); ! } $s_hidden_fields = ''; *************** *** 425,444 **** } ! if( !@file_exists($mx_root_path . "language/lang_$language/lang_main.$phpEx") || ! !@file_exists($mx_root_path . "language/lang_$language/lang_admin.$phpEx") ) { $language = guess_lang(); } ! if( !@file_exists($mx_root_path . "language/lang_$language/lang_main.$phpEx") || ! !@file_exists($mx_root_path . "language/lang_$language/lang_admin.$phpEx") ) { ! include($mx_root_path . "language/lang_english/lang_main.$phpEx"); ! include($mx_root_path . "language/lang_engslih/lang_admin.$phpEx"); } else { ! include($mx_root_path . "language/lang_$language/lang_main.$phpEx"); ! include($mx_root_path . "language/lang_$language/lang_admin.$phpEx"); } --- 465,481 ---- } ! if( !@file_exists($mx_root_path . "install/language/lang_$language/lang_admin.$phpEx") ) { $language = guess_lang(); } ! if( !@file_exists($mx_root_path . "install/language/lang_$language/lang_admin.$phpEx") ) { ! include($mx_root_path . "install/language/lang_english/lang_admin.$phpEx"); ! $language = 'english'; } else { ! include($mx_root_path . "install/language/lang_$language/lang_admin.$phpEx"); } *************** *** 446,454 **** // Do install -------------------------------------------------- // ! $confirm = ( isset($HTTP_POST_VARS['confirm']) || isset($HTTP_GET_VARS['confirm']) ); if( $confirm ) { ! $install_mode = ( isset($HTTP_POST_VARS['install_mode']) ? $HTTP_POST_VARS['install_mode'] : ( isset($HTTP_GET_VARS['install_mode']) ? $HTTP_GET_VARS['install_mode'] : '' ) ); $install_mode = ( preg_match('#^[a-z_]+$#', $install_mode) ? strip_tags($install_mode) : '' ); --- 483,491 ---- // Do install -------------------------------------------------- // ! $confirm = ( isset($_POST['confirm']) || isset($_GET['confirm']) ); if( $confirm ) { ! $install_mode = ( isset($_POST['install_mode']) ? $_POST['install_mode'] : ( isset($_GET['install_mode']) ? $_GET['install_mode'] : '' ) ); $install_mode = ( preg_match('#^[a-z_]+$#', $install_mode) ? strip_tags($install_mode) : '' ); *************** *** 458,472 **** { case 'install': ! $phpbb_path = ( !empty($HTTP_POST_VARS['phpbb_path']) ? $HTTP_POST_VARS['phpbb_path'] : '' ); ! $phpbb_url = ( !empty($HTTP_POST_VARS['phpbb_url']) ? $HTTP_POST_VARS['phpbb_url'] : '' ); ! $portal_url = ( !empty($HTTP_POST_VARS['portal_url']) ? $HTTP_POST_VARS['portal_url'] : '' ); ! $dbms = ( isset($HTTP_POST_VARS['dbms']) ? $HTTP_POST_VARS['dbms'] : '' ); ! $dbhost = ( !empty($HTTP_POST_VARS['dbhost']) ? $HTTP_POST_VARS['dbhost'] : '' ); ! $dbname = ( !empty($HTTP_POST_VARS['dbname']) ? $HTTP_POST_VARS['dbname'] : '' ); ! $dbuser = ( !empty($HTTP_POST_VARS['dbuser']) ? $HTTP_POST_VARS['dbuser'] : '' ); ! $dbpasswd = ( !empty($HTTP_POST_VARS['dbpasswd']) ? $HTTP_POST_VARS['dbpasswd'] : '' ); ! $table_prefix = ( !empty($HTTP_POST_VARS['prefix']) ? $HTTP_POST_VARS['prefix'] : '' ); ! $mx_table_prefix = ( !empty($HTTP_POST_VARS['mx_prefix']) ? $HTTP_POST_VARS['mx_prefix'] : '' ); ! $acm_type = ( isset($HTTP_POST_VARS['acm_type']) ? $HTTP_POST_VARS['acm_type'] : '' ); if( empty($phpbb_path) || empty($phpbb_url) || empty($portal_url) || --- 495,509 ---- { case 'install': ! $phpbb_path = ( !empty($_POST['phpbb_path']) ? $_POST['phpbb_path'] : '' ); ! $phpbb_url = ( !empty($_POST['phpbb_url']) ? $_POST['phpbb_url'] : '' ); ! $portal_url = ( !empty($_POST['portal_url']) ? $_POST['portal_url'] : '' ); ! $dbms = ( isset($_POST['dbms']) ? $_POST['dbms'] : '' ); ! $dbhost = ( !empty($_POST['dbhost']) ? $_POST['dbhost'] : '' ); ! $dbname = ( !empty($_POST['dbname']) ? $_POST['dbname'] : '' ); ! $dbuser = ( !empty($_POST['dbuser']) ? $_POST['dbuser'] : '' ); ! $dbpasswd = ( !empty($_POST['dbpasswd']) ? $_POST['dbpasswd'] : '' ); ! $table_prefix = ( !empty($_POST['prefix']) ? $_POST['prefix'] : '' ); ! $mx_table_prefix = ( !empty($_POST['mx_prefix']) ? $_POST['mx_prefix'] : '' ); ! $acm_type = ( isset($_POST['acm_type']) ? $_POST['acm_type'] : '' ); if( empty($phpbb_path) || empty($phpbb_url) || empty($portal_url) || *************** *** 585,589 **** // ! // Ok, let's load the mxBB-Portal config.php // if( @file_exists($mx_root_path . "config.$phpEx") ) --- 622,626 ---- // ! // Ok, let's load the mx-Publisher config.php // if( @file_exists($mx_root_path . "config.$phpEx") ) *************** *** 602,636 **** // include($phpbb_root_path . "includes/constants.$phpEx"); ! ! switch($dbms) ! { ! case 'mysql': ! include($mx_root_path . 'install/db/mysql.'.$phpEx); ! break; ! case 'mysql4': ! include($mx_root_path . 'install/db/mysql4.'.$phpEx); ! break; ! case 'mysqli': ! include($mx_root_path . 'install/db/mysqli.'.$phpEx); ! break; ! case 'postgres': ! include($mx_root_path . 'install/db/postgres7.'.$phpEx); ! break; ! case 'mssql': ! include($mx_root_path . 'install/db/mssql.'.$phpEx); ! break; ! case 'oracle': ! include($mx_root_path . 'install/db/oracle.'.$phpEx); ! break; ! case 'msaccess': ! include($mx_root_path . 'install/db/msaccess.'.$phpEx); ! break; ! case 'mssql-odbc': ! include($mx_root_path . 'install/db/mssql-odbc.'.$phpEx); ! break; ! } ! ! ! $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); if ( !$db->db_connect_id ) --- 639,643 ---- // include($phpbb_root_path . "includes/constants.$phpEx"); ! include($mx_root_path . 'includes/db/' . $dbms . '.' . $phpEx); // Load dbal and initiate class if ( !$db->db_connect_id ) *************** *** 743,747 **** $template = new Template($mx_root_path . 'install/templates'); - // // Check if the Portal is already installed --- 750,753 ---- *************** *** 802,806 **** // ! // Get the absolute path to this mxBB-Portal installation. // $mx_absolute_path = str_replace('\\', '/', substr(__FILE__, 0, -strlen('install/'.basename(__FILE__)))); --- 808,812 ---- // ! // Get the absolute path to this mx-Publisher installation. // $mx_absolute_path = str_replace('\\', '/', substr(__FILE__, 0, -strlen('install/'.basename(__FILE__)))); *************** *** 862,866 **** // ! // Get the mxBB base dir (computed from the phpbb search path), for example /mx/, /portal/ or / // $mx_base_path = substr($mx_absolute_path, strlen($phpbb_search_path)); --- 868,872 ---- // ! // Get the mx-Publisher base dir (computed from the phpbb search path), for example /mx/, /portal/ or / // $mx_base_path = substr($mx_absolute_path, strlen($phpbb_search_path)); *************** *** 872,881 **** // ! // Get the mxBB Path in the URL (this might not be the same as the base path when using aliases). // $mx_self_path = substr($HTTP_SERVER_VARS['PHP_SELF'], 0, -strlen('install/'.basename(__FILE__))); // ! // Get the mxBB Portal URL. // $portal_url = $server_url . $mx_self_path; --- 878,887 ---- // ! // Get the mx-Publisher Path in the URL (this might not be the same as the base path when using aliases). // $mx_self_path = substr($HTTP_SERVER_VARS['PHP_SELF'], 0, -strlen('install/'.basename(__FILE__))); // ! // Get the mx-Publisher URL. // $portal_url = $server_url . $mx_self_path; *************** *** 916,925 **** // ! // Get the relative path from mxBB to this phpBB installation // $phpbb_relative = get_relative_path($mx_base_path, $phpbb_base_path); // ! // Get the relative path from the mxBB Install script to this phpBB installation // $phpbb_root_path = $mx_root_path . $phpbb_relative; --- 922,931 ---- // ! // Get the relative path from mx-Publisher to this phpBB installation // $phpbb_relative = get_relative_path($mx_base_path, $phpbb_base_path); // ! // Get the relative path from the mx-Publisher Install script to this phpBB installation // $phpbb_root_path = $mx_root_path . $phpbb_relative; *************** *** 975,978 **** --- 981,985 ---- $template->assign_block_vars('datarow', array( + 'INFO' => $lang['Install_Instruction_phpBB'], 'PHPBB_PATH' => $phpbb_relative, 'PORTAL_URL' => $portal_url, |