|
From: FlorinCB <ory...@us...> - 2008-08-19 02:46:29
|
Update of /cvsroot/mxbb/core/install In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9848/install Modified Files: mx_install.php Log Message: some bugs fixed and mysql_41 schema upgraded Index: mx_install.php =================================================================== RCS file: /cvsroot/mxbb/core/install/mx_install.php,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** mx_install.php 30 Jul 2008 09:22:19 -0000 1.98 --- mx_install.php 19 Aug 2008 02:46:24 -0000 1.99 *************** *** 341,345 **** 'mysqli' => array( 'LABEL' => 'MySQL with MySQLi Extension', ! 'SCHEMA' => 'mysql', 'DELIM' => ';', 'DELIM_BASIC' => ';', --- 341,345 ---- 'mysqli' => array( 'LABEL' => 'MySQL with MySQLi Extension', ! 'SCHEMA' => 'mysql_41', 'DELIM' => ';', 'DELIM_BASIC' => ';', *************** *** 545,550 **** $portal_url = $mx_request_vars->post('portal_url', MX_TYPE_NO_TAGS, ''); $phpbb_path = $mx_request_vars->post('phpbb_path', MX_TYPE_NO_TAGS); //$phpbb_url = $mx_request_vars->post('phpbb_url', MX_TYPE_NO_TAGS); ! $dbms = $mx_request_vars->post('dbms_mxbb', MX_TYPE_NO_TAGS); $dbhost = $mx_request_vars->post('dbhost_mxbb', MX_TYPE_NO_TAGS); $dbname = $mx_request_vars->post('dbname_mxbb',MX_TYPE_NO_TAGS); --- 545,556 ---- $portal_url = $mx_request_vars->post('portal_url', MX_TYPE_NO_TAGS, ''); $phpbb_path = $mx_request_vars->post('phpbb_path', MX_TYPE_NO_TAGS); + $portal_backend = $mx_request_vars->post('portal_backend', MX_TYPE_NO_TAGS, 'internal'); + + //UTF-8 require to have same database in phpBB3 and mxp and mysqli is preferable + $default_dbms = ($portal_backend === 'internal') ? 'dbms_mxbb' : 'dbms'; + //$phpbb_url = $mx_request_vars->post('phpbb_url', MX_TYPE_NO_TAGS); ! $dbms = $mx_request_vars->post($default_dbms, MX_TYPE_NO_TAGS); ! $dbhost = $mx_request_vars->post('dbhost_mxbb', MX_TYPE_NO_TAGS); $dbname = $mx_request_vars->post('dbname_mxbb',MX_TYPE_NO_TAGS); *************** *** 552,561 **** $dbpasswd = $mx_request_vars->post('dbpasswd_mxbb', MX_TYPE_NO_TAGS); $mx_table_prefix = $mx_request_vars->post('mx_prefix', MX_TYPE_NO_TAGS); ! $admin_name = !$mx_request_vars->is_empty_post('admin_name_mxbb') ? $mx_request_vars->post('admin_name_mxbb', MX_TYPE_NO_TAGS, 'admin') : 'admin'; $admin_pass1 = !$mx_request_vars->is_empty_post('admin_pass1_mxbb') ? $mx_request_vars->post('admin_pass1_mxbb', MX_TYPE_NO_TAGS, 'admin') : 'admin'; $admin_pass2 = !$mx_request_vars->is_empty_post('admin_pass2_mxbb') ? $mx_request_vars->post('admin_pass2_mxbb', MX_TYPE_NO_TAGS, 'admin') : 'admin'; - $portal_backend = 'internal'; } else --- 558,566 ---- $dbpasswd = $mx_request_vars->post('dbpasswd_mxbb', MX_TYPE_NO_TAGS); $mx_table_prefix = $mx_request_vars->post('mx_prefix', MX_TYPE_NO_TAGS); ! $admin_name = !$mx_request_vars->is_empty_post('admin_name_mxbb') ? $mx_request_vars->post('admin_name_mxbb', MX_TYPE_NO_TAGS, 'admin') : 'admin'; $admin_pass1 = !$mx_request_vars->is_empty_post('admin_pass1_mxbb') ? $mx_request_vars->post('admin_pass1_mxbb', MX_TYPE_NO_TAGS, 'admin') : 'admin'; $admin_pass2 = !$mx_request_vars->is_empty_post('admin_pass2_mxbb') ? $mx_request_vars->post('admin_pass2_mxbb', MX_TYPE_NO_TAGS, 'admin') : 'admin'; } else *************** *** 570,582 **** $table_prefix = $mx_request_vars->post('prefix', MX_TYPE_NO_TAGS); $mx_table_prefix = $mx_request_vars->post('mx_prefix', MX_TYPE_NO_TAGS); ! $admin_name = !$mx_request_vars->is_empty_post('admin_name') ? $mx_request_vars->post('admin_name', MX_TYPE_NO_TAGS) : 'admin'; $admin_pass1 = !$mx_request_vars->is_empty_post('admin_pass1') ? $mx_request_vars->post('admin_pass1', MX_TYPE_NO_TAGS, 'admin') : 'admin'; $admin_pass2 = !$mx_request_vars->is_empty_post('admin_pass2') ? $mx_request_vars->post('admin_pass2', MX_TYPE_NO_TAGS, 'admin') : 'admin'; - - $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) ) { --- 575,597 ---- $table_prefix = $mx_request_vars->post('prefix', MX_TYPE_NO_TAGS); $mx_table_prefix = $mx_request_vars->post('mx_prefix', MX_TYPE_NO_TAGS); ! $portal_backend = $mx_request_vars->post('portal_backend', MX_TYPE_NO_TAGS, 'internal'); $admin_name = !$mx_request_vars->is_empty_post('admin_name') ? $mx_request_vars->post('admin_name', MX_TYPE_NO_TAGS) : 'admin'; $admin_pass1 = !$mx_request_vars->is_empty_post('admin_pass1') ? $mx_request_vars->post('admin_pass1', MX_TYPE_NO_TAGS, 'admin') : 'admin'; $admin_pass2 = !$mx_request_vars->is_empty_post('admin_pass2') ? $mx_request_vars->post('admin_pass2', MX_TYPE_NO_TAGS, 'admin') : 'admin'; } + + if ($mx_request_vars->is_post('phpbb')) + { + $phpbb_info = get_phpbb_info($mx_root_path . $phpbb_path . "config.$phpEx"); ! //$portal_backend = file_exists($mx_root_path . $phpbb_path . "modcp.$phpEx") ? 'phpbb2' : 'phpbb3'; ! 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>')); ! } ! } ! if( empty($portal_url) || empty($dbms) || empty($dbhost) || empty($dbname) || empty($dbuser) || empty($mx_table_prefix) ) { *************** *** 592,620 **** // - // If they entered the information manually, we need to verify they did it correctly ;-) - // - if ($mx_request_vars->is_post('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. // --- 607,610 ---- *************** *** 649,652 **** --- 639,643 ---- $config_data .= '$'."dbpasswd = '$dbpasswd';\n\n"; $config_data .= '$'."mx_table_prefix = '$mx_table_prefix';\n\n"; + $config_data .= "define('UTF_STATUS', '$portal_backend');\n\n"; $config_data .= "define('MX_INSTALLED', true);\n\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! *************** *** 710,713 **** --- 701,705 ---- $config_data .= '$'."dbpasswd = '$dbpasswd';\n\n"; $config_data .= '$'."mx_table_prefix = '$mx_table_prefix';\n\n"; + $config_data .= "define('UTF_STATUS', '$portal_backend');\n\n"; $config_data .= "define('MX_INSTALLED', true);\n\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! *************** *** 1051,1060 **** // 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' => 'localhost', --- 1043,1052 ---- // First, provide the option of standalone install // $template->assign_block_vars('datarow', array( 'INFO' => $lang['Install_Instruction_mxBB'], 'PHPBB_PATH' => '', 'PORTAL_URL' => $portal_url, ! 'PORTAL_BACKEND' => 'internal', ! 'PHPBB_URL' => '', 'DBMS' => '', 'DB_HOST' => 'localhost', *************** *** 1063,1071 **** '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>'; // --- 1055,1063 ---- '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>'; // *************** *** 1092,1096 **** // Get the DB related information for this phpBB // ! $phpbb_info = get_phpbb_info($phpbb_root_path . "config.$phpEx"); // --- 1084,1105 ---- // Get the DB related information for this phpBB // ! if (file_exists($phpbb_root_path . "config.$phpEx")) ! { ! $phpbb_info = get_phpbb_info($phpbb_root_path . "config.$phpEx"); ! ! if(!empty($phpbb_info['acm_type'])) ! { ! $portal_backend = 'phpbb3'; ! } ! else ! { ! $portal_backend = 'phpbb2'; ! } ! } ! else ! { ! print_r("File: " . $phpbb_root_path . "config.$phpEx" . " not found."); ! $portal_backend = 'internal'; ! } // *************** *** 1105,1113 **** // - - // Check if we support the DB used for this phpBB // ! if( !isset($phpbb_info['dbms']) || !array_key_exists($phpbb_info['dbms'], $available_dbms) ) { continue; } --- 1114,1121 ---- // // Check if we support the DB used for this phpBB // ! if( !isset($phpbb_info['dbms']) || !array_key_exists($phpbb_info['dbms'], $available_dbms) ) ! { continue; } *************** *** 1121,1124 **** --- 1129,1133 ---- continue; } + // // Get the phpBB URL *************** *** 1137,1145 **** continue; } // // Note: to get the phpBB URL we have read the config table, // so it seems safe to assume this board is installed. :-) // - $template->assign_block_vars('datarow', array( 'INFO' => $lang['Install_Instruction_phpBB'], --- 1146,1154 ---- continue; } + // // Note: to get the phpBB URL we have read the config table, // so it seems safe to assume this board is installed. :-) // $template->assign_block_vars('datarow', array( 'INFO' => $lang['Install_Instruction_phpBB'], *************** *** 1147,1150 **** --- 1156,1160 ---- 'PORTAL_URL' => $portal_url, 'PHPBB_URL' => $phpbb_url, + 'PORTAL_BACKEND' => $portal_backend, 'DBMS' => $phpbb_info['dbms'], 'DB_HOST' => !empty($phpbb_info['dbhost']) ? $phpbb_info['dbhost'] : 'localhost', *************** *** 1197,1200 **** --- 1207,1211 ---- 'L_PHPBB_PATH' => $lang['Phpbb_path'], 'L_Backend' => $lang['Session_backend'], + 'L_PORTAL_BACKEND' => $lang['Portal_backend'], 'L_Backend_explain' => $phpbb_found ? $lang['Session_backend_explain'] : '', 'L_PORTAL_URL' => $lang['Portal_url'], *************** *** 1220,1232 **** 'PORTAL_URL' => $portal_url, 'PHPBB_URL' => $phpbb_url, - 'DBMS' => $phpbb_info['dbms'], - 'DB_HOST' => $phpbb_info['dbhost'], - 'DB_NAME' => $phpbb_info['dbname'], - 'DB_USER' => $phpbb_info['dbuser'], - 'DB_PASSWD' => $phpbb_info['dbpasswd'], - 'DB_PREFIX' => $phpbb_info['table_prefix'], 'ACM_TYPE' => ( !empty($phpbb_info['acm_type']) ? $phpbb_info['acm_type'] : 'file' ), ! ! 'DBMS_SELECT' => dbms_select('mysql'), 'S_HIDDEN_FIELDS' => $s_hidden_fields, --- 1231,1237 ---- 'PORTAL_URL' => $portal_url, 'PHPBB_URL' => $phpbb_url, 'ACM_TYPE' => ( !empty($phpbb_info['acm_type']) ? $phpbb_info['acm_type'] : 'file' ), ! ! 'DBMS_SELECT' => dbms_select('mysql4'), 'S_HIDDEN_FIELDS' => $s_hidden_fields, |