diff options
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r-- | phpBB/install/install_install.php | 110 |
1 files changed, 92 insertions, 18 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index a2d44f2b6c..f9d5edc903 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -18,14 +18,9 @@ if (!defined('IN_INSTALL')) if (!empty($setmodules)) { // If phpBB is already installed we do not include this module - if (@file_exists($phpbb_root_path . 'config.' . $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) + if (phpbb_check_installation_exists($phpbb_root_path, $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) { - include_once($phpbb_root_path . 'config.' . $phpEx); - - if (defined('PHPBB_INSTALLED')) - { - return; - } + return; } $module[] = array( @@ -222,7 +217,6 @@ class install_install extends module 'S_LEGEND' => false, )); - // Check for getimagesize if (@function_exists('getimagesize')) { @@ -296,8 +290,8 @@ class install_install extends module $checks = array( array('func_overload', '&', MB_OVERLOAD_MAIL|MB_OVERLOAD_STRING), array('encoding_translation', '!=', 0), - array('http_input', '!=', 'pass'), - array('http_output', '!=', 'pass') + array('http_input', '!=', array('pass', '')), + array('http_output', '!=', array('pass', '')) ); foreach ($checks as $mb_checks) @@ -318,7 +312,8 @@ class install_install extends module break; case '!=': - if ($ini_val != $mb_checks[2]) + if (!is_array($mb_checks[2]) && $ini_val != $mb_checks[2] || + is_array($mb_checks[2]) && !in_array($ini_val, $mb_checks[2])) { $result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; $passed['mbstring'] = false; @@ -540,7 +535,6 @@ class install_install extends module $url = (!in_array(false, $passed)) ? $this->p_master->module_url . "?mode=$mode&sub=database&language=$language" : $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language "; $submit = (!in_array(false, $passed)) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST']; - $template->assign_vars(array( 'L_SUBMIT' => $submit, 'S_HIDDEN' => $s_hidden_fields, @@ -1156,13 +1150,9 @@ class install_install extends module // How should we treat this schema? $delimiter = $available_dbms[$data['dbms']]['DELIM']; - $sql_query = @file_get_contents($dbms_schema); - $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); - $sql_query = phpbb_remove_comments($sql_query); - $sql_query = split_sql_file($sql_query, $delimiter); foreach ($sql_query as $sql) @@ -1176,6 +1166,27 @@ class install_install extends module } unset($sql_query); + // Ok we have the db info go ahead and work on building the table + $db_table_schema = @file_get_contents('schemas/schema.json'); + $db_table_schema = json_decode($db_table_schema, true); + + if (!defined('CONFIG_TABLE')) + { + // CONFIG_TABLE is required by sql_create_index() to check the + // length of index names. However table_prefix is not defined + // here yet, so we need to create the constant ourselves. + define('CONFIG_TABLE', $data['table_prefix'] . 'config'); + } + + $db_tools = new \phpbb\db\tools($db); + foreach ($db_table_schema as $table_name => $table_data) + { + $db_tools->sql_create_table( + $data['table_prefix'] . substr($table_name, 6), + $table_data + ); + } + // Ok tables have been built, let's fill in the basic information $sql_query = file_get_contents('schemas/schema_data.sql'); @@ -1637,6 +1648,45 @@ class install_install extends module $_module->move_module_by($row, 'move_up', 5); } + if ($module_class == 'mcp') + { + // Move pm report details module 3 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'mcp_pm_reports' + AND module_class = 'mcp' + AND module_mode = 'pm_report_details'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 3); + + // Move closed pm reports module 3 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'mcp_pm_reports' + AND module_class = 'mcp' + AND module_mode = 'pm_reports_closed'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 3); + + // Move open pm reports module 3 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'mcp_pm_reports' + AND module_class = 'mcp' + AND module_mode = 'pm_reports'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 3); + } + if ($module_class == 'ucp') { // Move attachment module 4 down... @@ -1650,6 +1700,30 @@ class install_install extends module $db->sql_freeresult($result); $_module->move_module_by($row, 'move_down', 4); + + // Move notification options module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_notifications' + AND module_class = 'ucp' + AND module_mode = 'notification_options'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 4); + + // Move OAuth module 5 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_auth_link' + AND module_class = 'ucp' + AND module_mode = 'auth_link'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'move_down', 5); } // And now for the special ones @@ -2022,8 +2096,8 @@ class install_install extends module 'smtp_delivery' => array('lang' => 'USE_SMTP', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_host' => array('lang' => 'SMTP_SERVER', 'type' => 'text:25:50', 'explain' => false), 'smtp_auth' => array('lang' => 'SMTP_AUTH_METHOD', 'type' => 'select', 'options' => '$this->module->mail_auth_select(\'{VALUE}\')', 'explain' => true), - 'smtp_user' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true), - 'smtp_pass' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true), + 'smtp_user' => array('lang' => 'SMTP_USERNAME', 'type' => 'text:25:255', 'explain' => true, 'options' => array('autocomplete' => 'off')), + 'smtp_pass' => array('lang' => 'SMTP_PASSWORD', 'type' => 'password:25:255', 'explain' => true, 'options' => array('autocomplete' => 'off')), 'legend2' => 'SERVER_URL_SETTINGS', 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'type' => 'radio:enabled_disabled', 'explain' => true), |