|
From: Jon O. <jon...@us...> - 2007-09-09 16:48:23
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8466/install Modified Files: mx_install.php Log Message: Ok, massive update for 2.9.x. Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** mx_install.php 6 Aug 2007 19:33:27 -0000 1.79 --- mx_install.php 9 Sep 2007 16:48:17 -0000 1.80 *************** *** 32,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.'; // --- 32,38 ---- // Set mxBB-Portal version here ! // ! $mx_portal_name = 'mxBB Modular System'; ! $mx_portal_version = '2.9.1'; ! $mx_portal_copy = '<b>mxBB Modular System!</b> <br /><br/> mxBB is a fully modular system, portal and CMS, featuring dynamic pages, blocks, and themes, by means of a powerful yet flexible AdminCP. 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.'; // *************** *** 243,260 **** 'COMMENTS' => 'mx_remove_remarks' ), ! 'mysqli' => array( ! 'LABEL' => 'MySQL with MySQLi Extension', ! 'SCHEMA' => 'mysql', ! 'DELIM' => ';', ! 'DELIM_BASIC' => ';', ! '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', --- 243,260 ---- 'COMMENTS' => 'mx_remove_remarks' ), ! // 'mysqli' => array( ! // 'LABEL' => 'MySQL with MySQLi Extension', ! // 'SCHEMA' => 'mysql', // 'DELIM' => ';', // 'DELIM_BASIC' => ';', ! // '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,349 **** 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 = ''; --- 344,348 ---- if( install_language_select($lang_options, $language, 'language') > 1 ) { ! include($mx_root_path . "install/language/lang_$language/lang_admin.$phpEx"); $s_hidden_fields = ''; *************** *** 365,384 **** } ! 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"); } --- 364,420 ---- } ! 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"); ! } ! ! $board_email = (!empty($HTTP_POST_VARS['board_email'])) ? $HTTP_POST_VARS['board_email'] : ''; ! $script_path = (!empty($HTTP_POST_VARS['script_path'])) ? $HTTP_POST_VARS['script_path'] : str_replace('install', '', dirname($HTTP_SERVER_VARS['PHP_SELF'])); ! ! if (!empty($HTTP_POST_VARS['server_name'])) ! { ! $server_name = $HTTP_POST_VARS['server_name']; ! } ! else ! { ! // Guess at some basic info used for install.. ! if (!empty($HTTP_SERVER_VARS['SERVER_NAME']) || !empty($HTTP_ENV_VARS['SERVER_NAME'])) ! { ! $server_name = (!empty($HTTP_SERVER_VARS['SERVER_NAME'])) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME']; ! } ! else if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) || !empty($HTTP_ENV_VARS['HTTP_HOST'])) ! { ! $server_name = (!empty($HTTP_SERVER_VARS['HTTP_HOST'])) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST']; ! } ! else ! { ! $server_name = ''; ! } ! } ! ! if (!empty($HTTP_POST_VARS['server_port'])) ! { ! $server_port = $HTTP_POST_VARS['server_port']; ! } ! else ! { ! if (!empty($HTTP_SERVER_VARS['SERVER_PORT']) || !empty($HTTP_ENV_VARS['SERVER_PORT'])) ! { ! $server_port = (!empty($HTTP_SERVER_VARS['SERVER_PORT'])) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $HTTP_ENV_VARS['SERVER_PORT']; ! } ! else ! { ! $server_port = '80'; ! } } *************** *** 386,390 **** // Do install -------------------------------------------------- // ! $confirm = ( isset($HTTP_POST_VARS['confirm']) || isset($HTTP_GET_VARS['confirm']) ); if( $confirm ) --- 422,426 ---- // Do install -------------------------------------------------- // ! $confirm = ( isset($HTTP_POST_VARS['confirm']) || isset($HTTP_GET_VARS['confirm']) ) && !isset($HTTP_POST_VARS['debug']); if( $confirm ) *************** *** 398,417 **** { 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) || ! empty($dbms) || empty($dbhost) || empty($dbname) || empty($dbuser) || ! empty($mx_table_prefix) ) { break; } --- 434,475 ---- { case 'install': ! if ($HTTP_POST_VARS['mxbb']) { + $portal_url = ( !empty($HTTP_POST_VARS['portal_url']) ? $HTTP_POST_VARS['portal_url'] : '' ); + $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'] : '' ); + $dbms = ( isset($HTTP_POST_VARS['dbms_mxbb']) ? $HTTP_POST_VARS['dbms_mxbb'] : '' ); + $dbhost = ( !empty($HTTP_POST_VARS['dbhost_mxbb']) ? $HTTP_POST_VARS['dbhost_mxbb'] : '' ); + $dbname = ( !empty($HTTP_POST_VARS['dbname_mxbb']) ? $HTTP_POST_VARS['dbname_mxbb'] : '' ); + $dbuser = ( !empty($HTTP_POST_VARS['dbuser_mxbb']) ? $HTTP_POST_VARS['dbuser_mxbb'] : '' ); + $dbpasswd = ( !empty($HTTP_POST_VARS['dbpasswd_mxbb']) ? $HTTP_POST_VARS['dbpasswd_mxbb'] : '' ); + //$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'] : '' ); + + $portal_backend = 'internal'; + } + else + { + $portal_url = ( !empty($HTTP_POST_VARS['portal_url']) ? $HTTP_POST_VARS['portal_url'] : '' ); + $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'] : '' ); + $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'] : '' ); + + $portal_backend = file_exists($mx_root_path . $phpbb_path . "modcp.$phpEx") ? 'phpbb2' : 'phpbb3'; + } + + + if( empty($portal_url) || empty($dbms) || empty($dbhost) || empty($dbname) || empty($dbuser) || empty($mx_table_prefix) ) + { + install_die(sprintf($lang['MissingVariables'], '<a href="javascript:history.go(-1);">', '</a>')); break; } *************** *** 420,441 **** // If they entered the information manually, we need to verify they did it correctly ;-) // ! $phpbb_info = get_phpbb_info($mx_root_path . $phpbb_path . "config.$phpEx"); ! ! if( !empty($phpbb_info['acm_type']) ) ! { ! @define('IN_PHPBB3', true); ! $tplEx = 'html'; // Not used atm ! } ! else { ! $tplEx = 'tpl'; ! } ! if( !isset($phpbb_info['dbms']) || $phpbb_info['dbms'] != $dbms || $phpbb_info['dbhost'] != $dbhost || ! $phpbb_info['dbname'] != $dbname || $phpbb_info['dbuser'] != $dbuser || ! $phpbb_info['dbpasswd'] != $dbpasswd || $phpbb_info['table_prefix'] != $table_prefix ) ! { ! install_die(sprintf($lang['phpBB_nfnd_retry'], '<a href="javascript:history.go(-1);">', '</a>')); } // // Trailing slashes are very important for the URLs we need to store in the mx_portal table. --- 478,503 ---- // If they entered the information manually, we need to verify they did it correctly ;-) // ! if ($HTTP_POST_VARS['phpbb']) { ! $phpbb_info = get_phpbb_info($mx_root_path . $phpbb_path . "config.$phpEx"); ! if( !empty($phpbb_info['acm_type']) ) ! { ! @define('IN_PHPBB3', true); ! $tplEx = 'html'; // Not used atm ! } ! else ! { ! $tplEx = 'tpl'; ! } ! ! if( !isset($phpbb_info['dbms']) || $phpbb_info['dbms'] != $dbms || $phpbb_info['dbhost'] != $dbhost || ! $phpbb_info['dbname'] != $dbname || $phpbb_info['dbuser'] != $dbuser || ! $phpbb_info['dbpasswd'] != $dbpasswd || $phpbb_info['table_prefix'] != $table_prefix ) ! { ! install_die(sprintf($lang['phpBB_nfnd_retry'], '<a href="javascript:history.go(-1);">', '</a>')); ! } } + // // Trailing slashes are very important for the URLs we need to store in the mx_portal table. *************** *** 456,460 **** if( !defined('MX_INSTALLED') ) { ! $mx_acm_type = ( !empty($acm_type) ? $acm_type : 'file' ); $process_msgs[] = $lang['Writing_config'] . ' ...<br />'; --- 518,522 ---- if( !defined('MX_INSTALLED') ) { ! //$mx_acm_type = ( !empty($acm_type) ? $acm_type : 'file' ); $process_msgs[] = $lang['Writing_config'] . ' ...<br />'; *************** *** 469,477 **** $config_data .= '$'."dbpasswd = '$dbpasswd';\n\n"; $config_data .= '$'."mx_table_prefix = '$mx_table_prefix';\n\n"; ! $config_data .= '$'."table_prefix = '$table_prefix';\n\n"; ! $config_data .= '$'."acm_type = '$mx_acm_type';\n\n"; ! $config_data .= '$phpbb_root_path = $mx_root_path . ' . "'$phpbb_path';\n\n"; $config_data .= "define('MX_INSTALLED', true);\n\n"; ! $config_data .= "define('PHPBB_INSTALLED', true);\n\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! --- 531,539 ---- $config_data .= '$'."dbpasswd = '$dbpasswd';\n\n"; $config_data .= '$'."mx_table_prefix = '$mx_table_prefix';\n\n"; ! //$config_data .= '$'."table_prefix = '$table_prefix';\n\n"; ! //$config_data .= '$'."acm_type = '$mx_acm_type';\n\n"; ! //$config_data .= '$phpbb_root_path = $mx_root_path . ' . "'$phpbb_path';\n\n"; $config_data .= "define('MX_INSTALLED', true);\n\n"; ! //$config_data .= "define('PHPBB_INSTALLED', true);\n\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! *************** *** 541,545 **** // Connect to the database // ! include($phpbb_root_path . "includes/constants.$phpEx"); switch($dbms) --- 603,607 ---- // Connect to the database // ! include($mx_root_path . "includes/sessions/internal/constants.$phpEx"); switch($dbms) *************** *** 571,575 **** } - $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); --- 633,636 ---- *************** *** 609,613 **** $process_msgs[] = '<hr />'; $process_msgs[] = $install_title . '...<br />'; ! exec_post_process($install_mode); // --- 670,737 ---- $process_msgs[] = '<hr />'; $process_msgs[] = $install_title . '...<br />'; ! ! //exec_post_process($install_mode); ! ! if( $install_mode == 'install' ) ! { ! $portal_table = array( ! 'portal_id' => 1, ! 'portal_version' => "'$mx_portal_version'", ! 'portal_startdate' => "'".time()."'", ! 'default_lang' => "'$language'", ! 'board_email' => "'$board_email'", ! 'script_path' => "'$script_path'", ! 'server_port' => "'$server_port'", ! 'server_name' => "'$server_name'", ! 'portal_backend' => "'$portal_backend'", ! 'portal_backend_path' => "'$phpbb_path'", ! ); ! ! if ($HTTP_POST_VARS['mxbb']) // Internal install ! { ! $portal_table['default_style'] = "'1'"; ! } ! ! $sql = "INSERT INTO ".PORTAL_TABLE." (". ! implode(', ', array_keys($portal_table)). ! ") VALUES (". ! implode(', ', array_values($portal_table)). ! ")"; ! ! parse_cmd_sql($sql); ! ! /* ! $admin_pass_md5 = ($confirm && $userdata['user_level'] == ADMIN) ? $admin_pass1 : md5($admin_pass1); ! ! $sql = "UPDATE " . USERS_TABLE . " ! SET username = '" . str_replace("\'", "''", $admin_name) . "', user_password='" . str_replace("\'", "''", $admin_pass_md5) . "', user_lang = '" . str_replace("\'", "''", $language) . "', user_email='" . str_replace("\'", "''", $board_email) . "' ! WHERE username = 'Admin'"; ! ! if (!$db->sql_query($sql)) ! { ! $process_errors++; ! $process_msgs[] = "Could not update admin info :: " . $sql . " :: " . __LINE__ . " :: " . __FILE__ . "<br /><br />"; ! } ! */ ! ! $sql = "UPDATE " . USERS_TABLE . " ! SET user_regdate = " . time(); ! ! if (!$db->sql_query($sql)) ! { ! $process_errors++; ! $process_msgs[] = "Could not update user_regdate :: " . $sql . " :: " . __LINE__ . " :: " . __FILE__ . "<br /><br />"; ! } ! } ! else ! { ! $sql = "UPDATE ".PORTAL_TABLE." ! SET portal_name='$mx_portal_name', ! portal_version='$mx_portal_version' ! WHERE portal_id = 1"; ! ! parse_cmd_sql($sql); ! } ! // *************** *** 749,753 **** // FYI: // If document root IS part of our absolute path, chances are we can find phpBB from there. ! // This is the most tipical scenario. Under a shared host, the document root tipically points // to a path owned by the same user running the current domain. // That's why we first try to guess the $phpbb_search_path value from $document_root. --- 873,877 ---- // FYI: // If document root IS part of our absolute path, chances are we can find phpBB from there. ! // This is the most typical scenario. Under a shared host, the document root typically points // to a path owned by the same user running the current domain. // That's why we first try to guess the $phpbb_search_path value from $document_root. *************** *** 848,851 **** --- 972,1000 ---- // $select_phpbb_path = '<select name="select_phpbb_path" onchange="check_phpbb_path();">'; + + // + // First, provide the option of standalone install + // + + $template->assign_block_vars('datarow', array( + 'INFO' => $lang['Install_Instruction_mxBB'], + 'PHPBB_PATH' => '', + 'PORTAL_URL' => $portal_url, + 'PHPBB_URL' => '', + 'DBMS' => '', + 'DB_HOST' => '', + 'DB_NAME' => '', + 'DB_USER' => '', + 'DB_PASSWD' => '', + 'DB_PREFIX' => '', + //'ACM_TYPE' => ( !empty($phpbb_info['acm_type']) ? $phpbb_info['acm_type'] : 'file' ), + 'PHPBB_ROOT' => '', + )); + + $select_phpbb_path .= '<option value="-1">'.'Internal'.'</option>'; + + // + // Now, list all phpBB backend options available + // for( $i = 0; $i < $files_cnt; $i++ ) { *************** *** 915,918 **** --- 1064,1068 ---- $template->assign_block_vars('datarow', array( + 'INFO' => $lang['Install_Instruction_phpBB'], 'PHPBB_PATH' => $phpbb_relative, 'PORTAL_URL' => $portal_url, *************** *** 935,941 **** // DEBUG ONLY ;-) // ! //$phpbb_found = false; ! //$phpbb_failed = true; ! //$files_cnt = 0; // -------------------- --- 1085,1094 ---- // DEBUG ONLY ;-) // ! if (isset($HTTP_POST_VARS['debug'])) ! { ! $phpbb_found = false; ! $phpbb_failed = true; ! $files_cnt = 0; ! } // -------------------- *************** *** 961,967 **** 'L_NOSCRIPT_WARNING' => $lang['Install_noscript_warning'], 'L_INITIAL_CONFIGURATION' => $lang['Install_settings'], ! 'L_PORTAL_CONFIGURATION' => $lang['Portal_General_Config'], 'L_DATABASE_CONFIGURATION' => $lang['Database_settings'], 'L_PHPBB_PATH' => $lang['Phpbb_path'], 'L_PORTAL_URL' => $lang['Portal_url'], 'L_PHPBB_URL' => $lang['Phpbb_url'], --- 1114,1125 ---- 'L_NOSCRIPT_WARNING' => $lang['Install_noscript_warning'], 'L_INITIAL_CONFIGURATION' => $lang['Install_settings'], ! 'L_PORTAL_CONFIGURATION' => $lang['Portal_paths'], 'L_DATABASE_CONFIGURATION' => $lang['Database_settings'], + 'READ_ONLY' => $lang['ReadOnly'], + 'L_PHPBB_ONLY' => $lang['Phpbb_only'], + 'L_MXBB_ONLY' => $lang['Mxbb_only'], 'L_PHPBB_PATH' => $lang['Phpbb_path'], + 'L_Backend' => $lang['Session_backend'], + 'L_Backend_explain' => $phpbb_found ? $lang['Session_backend_explain'] : '', 'L_PORTAL_URL' => $lang['Portal_url'], 'L_PHPBB_URL' => $lang['Phpbb_url'], *************** *** 990,993 **** --- 1148,1153 ---- 'ACM_TYPE' => ( !empty($phpbb_info['acm_type']) ? $phpbb_info['acm_type'] : 'file' ), + 'DBMS_SELECT' => dbms_select('mysql'), + 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_FORM_ACTION' => "mx_install.$phpEx", |