diff options
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r-- | phpBB/install/install_install.php | 83 |
1 files changed, 62 insertions, 21 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 7558fde944..40dee7b3d7 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -52,11 +52,13 @@ class install_install extends module function main($mode, $sub) { - global $lang, $template, $language, $phpbb_root_path; + global $lang, $template, $language, $phpbb_root_path, $cache; switch ($sub) { case 'intro': + $cache->purge(); + $this->page_title = $lang['SUB_INTRO']; $template->assign_vars(array( @@ -104,6 +106,7 @@ class install_install extends module $this->add_language($mode, $sub); $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); + $this->disable_avatars_if_unwritable(); // Remove the lock file @unlink($phpbb_root_path . 'cache/install_lock'); @@ -128,7 +131,7 @@ class install_install extends module 'BODY' => $lang['REQUIREMENTS_EXPLAIN'], )); - $passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false,); + $passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false, 'json' => false,); // Test for basic PHP settings $template->assign_block_vars('checks', array( @@ -165,25 +168,28 @@ class install_install extends module 'S_LEGEND' => false, )); - // Check for register_globals being enabled - if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') - { - $result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; - } - else + // Don't check for register_globals on 5.4+ + if (version_compare($php_version, '5.4.0-dev') < 0) { - $result = '<strong style="color:green">' . $lang['YES'] . '</strong>'; - } - - $template->assign_block_vars('checks', array( - 'TITLE' => $lang['PHP_REGISTER_GLOBALS'], - 'TITLE_EXPLAIN' => $lang['PHP_REGISTER_GLOBALS_EXPLAIN'], - 'RESULT' => $result, + // Check for register_globals being enabled + if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') + { + $result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; + } + else + { + $result = '<strong style="color:green">' . $lang['YES'] . '</strong>'; + } - 'S_EXPLAIN' => true, - 'S_LEGEND' => false, - )); + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_REGISTER_GLOBALS'], + 'TITLE_EXPLAIN' => $lang['PHP_REGISTER_GLOBALS_EXPLAIN'], + 'RESULT' => $result, + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + } // Check for url_fopen if (@ini_get('allow_url_fopen') == '1' || strtolower(@ini_get('allow_url_fopen')) == 'on') @@ -244,6 +250,26 @@ class install_install extends module 'S_EXPLAIN' => true, 'S_LEGEND' => false, )); + + // Check for php json support + if (@extension_loaded('json')) + { + $passed['json'] = true; + $result = '<strong style="color:green">' . $lang['YES'] . '</strong>'; + } + else + { + $result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_JSON_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PHP_JSON_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); /** * Better not enabling and adding to the loaded extensions due to the specific requirements needed @@ -1152,7 +1178,7 @@ class install_install extends module $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); - $sql_query = remove_comments($sql_query); + $sql_query = phpbb_remove_comments($sql_query); $sql_query = split_sql_file($sql_query, $delimiter); @@ -1190,7 +1216,7 @@ class install_install extends module // Change language strings... $sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query); - $sql_query = remove_comments($sql_query); + $sql_query = phpbb_remove_comments($sql_query); $sql_query = split_sql_file($sql_query, ';'); foreach ($sql_query as $sql) @@ -1769,7 +1795,7 @@ class install_install extends module 'user_email' => '', 'user_lang' => $data['default_lang'], 'user_style' => 1, - 'user_timezone' => 0, + 'user_timezone' => 'UTC', 'user_dateformat' => $lang['default_dateformat'], 'user_allow_massemail' => 0, ); @@ -1852,6 +1878,21 @@ class install_install extends module } /** + * Check if the avatar directory is writable and disable avatars + * if it isn't writable. + */ + function disable_avatars_if_unwritable() + { + global $phpbb_root_path; + + if (!phpbb_is_writable($phpbb_root_path . 'images/avatars/upload/')) + { + set_config('allow_avatar', 0); + set_config('allow_avatar_upload', 0); + } + } + + /** * Generate a list of available mail server authentication methods */ function mail_auth_select($selected_method) |