From 10f6716566fce9d9c38f3dd99419595b2a1cba4c Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Tue, 30 Jun 2015 16:36:34 +0200 Subject: [PATCH] [ticket/13740] Restore original install folder This reverts commit 934e2821f1cef5e2e21ad6d96f7beb45647ed81c. PHPBB3-13740 --- phpBB/common.php | 2 +- .../convertors/convert_phpbb20.php | 0 .../convertors/functions_phpbb20.php | 0 .../data/confusables.php | 0 .../database_update.php | 2 +- phpBB/{install_old => install}/index.php | 2 +- .../install_convert.php | 0 phpBB/install/install_install.php | 2368 +++++++++++++++++ phpBB/install/install_main.php | 78 + .../install_update.php | 0 phpBB/{install_old => install}/phpinfo.php | 0 phpBB/install/schemas/index.htm | 10 + phpBB/install/schemas/oracle_schema.sql | 37 + phpBB/install/schemas/postgres_schema.sql | 80 + phpBB/install/schemas/schema_data.sql | 821 ++++++ phpBB/{install => install_new}/app.php | 0 phpBB/{install => install_new}/phpbbcli.php | 0 17 files changed, 3397 insertions(+), 3 deletions(-) rename phpBB/{install_old => install}/convertors/convert_phpbb20.php (100%) rename phpBB/{install_old => install}/convertors/functions_phpbb20.php (100%) rename phpBB/{install_old => install}/data/confusables.php (100%) rename phpBB/{install_old => install}/database_update.php (99%) rename phpBB/{install_old => install}/index.php (99%) rename phpBB/{install_old => install}/install_convert.php (100%) create mode 100644 phpBB/install/install_install.php create mode 100644 phpBB/install/install_main.php rename phpBB/{install_old => install}/install_update.php (100%) rename phpBB/{install_old => install}/phpinfo.php (100%) create mode 100644 phpBB/install/schemas/index.htm create mode 100644 phpBB/install/schemas/oracle_schema.sql create mode 100644 phpBB/install/schemas/postgres_schema.sql create mode 100644 phpBB/install/schemas/schema_data.sql rename phpBB/{install => install_new}/app.php (100%) rename phpBB/{install => install_new}/phpbbcli.php (100%) mode change 100755 => 100644 diff --git a/phpBB/common.php b/phpBB/common.php index 38761cfadc..0b898d9553 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -52,7 +52,7 @@ if (!defined('PHPBB_INSTALLED')) } // $phpbb_root_path accounts for redirects from e.g. /adm - $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx; + $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/index.' . $phpEx; // Replace any number of consecutive backslashes and/or slashes with a single slash // (could happen on some proxy setups and/or Windows servers) $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path); diff --git a/phpBB/install_old/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php similarity index 100% rename from phpBB/install_old/convertors/convert_phpbb20.php rename to phpBB/install/convertors/convert_phpbb20.php diff --git a/phpBB/install_old/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php similarity index 100% rename from phpBB/install_old/convertors/functions_phpbb20.php rename to phpBB/install/convertors/functions_phpbb20.php diff --git a/phpBB/install_old/data/confusables.php b/phpBB/install/data/confusables.php similarity index 100% rename from phpBB/install_old/data/confusables.php rename to phpBB/install/data/confusables.php diff --git a/phpBB/install_old/database_update.php b/phpBB/install/database_update.php similarity index 99% rename from phpBB/install_old/database_update.php rename to phpBB/install/database_update.php index 853848d637..7ba11c37c4 100644 --- a/phpBB/install_old/database_update.php +++ b/phpBB/install/database_update.php @@ -122,7 +122,7 @@ if (!isset($config['version_update_from'])) $orig_version = $config['version_update_from']; -$user->add_lang(array('common', 'acp/common', 'install', 'migrator')); +$user->add_lang(array('common', 'acp/common', 'old_install', 'migrator')); // Add own hook handler, if present. :o if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx)) diff --git a/phpBB/install_old/index.php b/phpBB/install/index.php similarity index 99% rename from phpBB/install_old/index.php rename to phpBB/install/index.php index 3559a10971..a1a8fc02b6 100644 --- a/phpBB/install_old/index.php +++ b/phpBB/install/index.php @@ -210,7 +210,7 @@ if (!file_exists($phpbb_root_path . 'language/' . $language) || !is_dir($phpbb_r } // And finally, load the relevant language files -$load_lang_files = array('common', 'acp/common', 'acp/board', 'install', 'posting'); +$load_lang_files = array('common', 'acp/common', 'acp/board', 'old_install', 'posting'); $new_path = $phpbb_root_path . 'install/update/new/language/' . $language . '/'; $old_path = $phpbb_root_path . 'language/' . $language . '/'; diff --git a/phpBB/install_old/install_convert.php b/phpBB/install/install_convert.php similarity index 100% rename from phpBB/install_old/install_convert.php rename to phpBB/install/install_convert.php diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php new file mode 100644 index 0000000000..0e223866b1 --- /dev/null +++ b/phpBB/install/install_install.php @@ -0,0 +1,2368 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +*/ +if (!defined('IN_INSTALL')) +{ + // Someone has tried to access the file direct. This is not a good idea, so exit + exit; +} + +if (!empty($setmodules)) +{ + // If phpBB is already installed we do not include this module + if (phpbb_check_installation_exists($phpbb_root_path, $phpEx) && !file_exists($phpbb_root_path . 'cache/install_lock')) + { + return; + } + + $module[] = array( + 'module_type' => 'install', + 'module_title' => 'INSTALL', + 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), + 'module_order' => 10, + 'module_subs' => '', + 'module_stages' => array('INTRO', 'REQUIREMENTS', 'DATABASE', 'ADMINISTRATOR', 'CONFIG_FILE', 'ADVANCED', 'CREATE_TABLE', 'FINAL'), + 'module_reqs' => '' + ); +} + +/** +* Installation +*/ +class install_install extends module +{ + /** + * @var \phpbb\filesystem\filesystem_interface + */ + protected $filesystem; + + function install_install(&$p_master) + { + $this->p_master = &$p_master; + $this->filesystem = new \phpbb\filesystem\filesystem(); + } + + function main($mode, $sub) + { + global $lang, $template, $language, $phpbb_root_path, $phpEx; + global $phpbb_container, $cache, $phpbb_log, $request, $phpbb_config_php_file; + + switch ($sub) + { + case 'intro': + $phpbb_container->get('cache.driver')->purge(); + + $this->page_title = $lang['SUB_INTRO']; + + $template->assign_vars(array( + 'TITLE' => $lang['INSTALL_INTRO'], + 'BODY' => $lang['INSTALL_INTRO_BODY'], + 'L_SUBMIT' => $lang['NEXT_STEP'], + 'S_LANG_SELECT' => '', + 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language", + )); + + break; + + case 'requirements': + $this->check_server_requirements($mode, $sub); + + break; + + case 'database': + $this->obtain_database_settings($mode, $sub); + + break; + + case 'administrator': + $this->obtain_admin_settings($mode, $sub); + + break; + + case 'config_file': + $this->create_config_file($mode, $sub); + + break; + + case 'advanced': + $this->obtain_advanced_settings($mode, $sub); + + break; + + case 'create_table': + $this->load_schema($mode, $sub); + break; + + case 'final': + // Enable super globals to prevent issues with the new \phpbb\request\request object + $request->enable_super_globals(); + + // Create a normal container now + $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx); + $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container(); + + // Sets the global variables + /* @var $cache \phpbb\cache\service */ + $cache = $phpbb_container->get('cache'); + + /* @var $phpbb_log \phpbb\log\log_interface */ + $phpbb_log = $phpbb_container->get('log'); + + $this->build_search_index($mode, $sub); + $this->add_modules($mode, $sub); + $this->add_language($mode, $sub); + $this->add_bots($mode, $sub); + $this->email_admin($mode, $sub); + $this->disable_avatars_if_unwritable(); + $this->populate_migrations($phpbb_container->get('ext.manager'), $phpbb_container->get('migrator')); + + // Remove the lock file + @unlink($phpbb_root_path . 'cache/install_lock'); + + break; + } + + $this->tpl_name = 'install_install'; + } + + /** + * Checks that the server we are installing on meets the requirements for running phpBB + */ + function check_server_requirements($mode, $sub) + { + global $lang, $template, $phpbb_root_path, $phpEx, $language; + + $this->page_title = $lang['STAGE_REQUIREMENTS']; + + $template->assign_vars(array( + 'TITLE' => $lang['REQUIREMENTS_TITLE'], + 'BODY' => $lang['REQUIREMENTS_EXPLAIN'], + )); + + $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( + 'S_LEGEND' => true, + 'LEGEND' => $lang['PHP_SETTINGS'], + 'LEGEND_EXPLAIN' => $lang['PHP_SETTINGS_EXPLAIN'], + )); + + // Test the minimum PHP version + $php_version = PHP_VERSION; + + if (version_compare($php_version, '5.3.9') < 0) + { + $result = '' . $lang['NO'] . ''; + } + else + { + $passed['php'] = true; + + // We also give feedback on whether we're running in safe mode + $result = '' . $lang['YES']; + if (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) == 'on') + { + $result .= ', ' . $lang['PHP_SAFE_MODE']; + } + $result .= ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_VERSION_REQD'], + 'RESULT' => $result, + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + + // Don't check for register_globals on 5.4+ + if (version_compare($php_version, '5.4.0-dev') < 0) + { + // Check for register_globals being enabled + if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') + { + $result = '' . $lang['NO'] . ''; + } + else + { + $result = '' . $lang['YES'] . ''; + } + + $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') + { + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_URL_FOPEN_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PHP_URL_FOPEN_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + // Check for getimagesize + if (@function_exists('getimagesize')) + { + $passed['imagesize'] = true; + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PHP_GETIMAGESIZE_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PHP_GETIMAGESIZE_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + // Check for PCRE UTF-8 support + if (@preg_match('//u', '')) + { + $passed['pcre'] = true; + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['PCRE_UTF_SUPPORT'], + 'TITLE_EXPLAIN' => $lang['PCRE_UTF_SUPPORT_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + + // Check for php json support + if (@extension_loaded('json')) + { + $passed['json'] = true; + $result = '' . $lang['YES'] . ''; + } + else + { + $result = '' . $lang['NO'] . ''; + } + + $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, + )); + + $passed['mbstring'] = true; + if (@extension_loaded('mbstring')) + { + // Test for available database modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['MBSTRING_CHECK'], + 'LEGEND_EXPLAIN' => $lang['MBSTRING_CHECK_EXPLAIN'], + )); + + $checks = array( + array('func_overload', '&', MB_OVERLOAD_MAIL|MB_OVERLOAD_STRING), + array('encoding_translation', '!=', 0), + array('http_input', '!=', array('pass', '')), + array('http_output', '!=', array('pass', '')) + ); + + foreach ($checks as $mb_checks) + { + $ini_val = @ini_get('mbstring.' . $mb_checks[0]); + switch ($mb_checks[1]) + { + case '&': + if (intval($ini_val) & $mb_checks[2]) + { + $result = '' . $lang['NO'] . ''; + $passed['mbstring'] = false; + } + else + { + $result = '' . $lang['YES'] . ''; + } + break; + + case '!=': + if (!is_array($mb_checks[2]) && $ini_val != $mb_checks[2] || + is_array($mb_checks[2]) && !in_array($ini_val, $mb_checks[2])) + { + $result = '' . $lang['NO'] . ''; + $passed['mbstring'] = false; + } + else + { + $result = '' . $lang['YES'] . ''; + } + break; + } + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['MBSTRING_' . strtoupper($mb_checks[0])], + 'TITLE_EXPLAIN' => $lang['MBSTRING_' . strtoupper($mb_checks[0]) . '_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + } + } + + // Test for available database modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['PHP_SUPPORTED_DB'], + 'LEGEND_EXPLAIN' => $lang['PHP_SUPPORTED_DB_EXPLAIN'], + )); + + $available_dbms = get_available_dbms(false, true); + $passed['db'] = $available_dbms['ANY_DB_SUPPORT']; + unset($available_dbms['ANY_DB_SUPPORT']); + + foreach ($available_dbms as $db_name => $db_ary) + { + if (!$db_ary['AVAILABLE']) + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($db_name)], + 'RESULT' => '' . $lang['UNAVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($db_name)], + 'RESULT' => '' . $lang['AVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + } + + // Test for other modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['PHP_OPTIONAL_MODULE'], + 'LEGEND_EXPLAIN' => $lang['PHP_OPTIONAL_MODULE_EXPLAIN'], + )); + + foreach ($this->php_dlls_other as $dll) + { + if (!@extension_loaded($dll)) + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '' . $lang['UNAVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + continue; + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DLL_' . strtoupper($dll)], + 'RESULT' => '' . $lang['AVAILABLE'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + + // Can we find Imagemagick anywhere on the system? + $exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : ''; + + $magic_home = getenv('MAGICK_HOME'); + $img_imagick = ''; + if (empty($magic_home)) + { + $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/'); + $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH')))); + + $locations = array_merge($path_locations, $locations); + foreach ($locations as $location) + { + // The path might not end properly, fudge it + if (substr($location, -1, 1) !== '/') + { + $location .= '/'; + } + + if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000) + { + $img_imagick = str_replace('\\', '/', $location); + continue; + } + } + } + else + { + $img_imagick = str_replace('\\', '/', $magic_home); + } + + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['APP_MAGICK'], + 'RESULT' => ($img_imagick) ? '' . $lang['AVAILABLE'] . ', ' . $img_imagick . '' : '' . $lang['NO_LOCATION'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + + // Check permissions on files/directories we need access to + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['FILES_REQUIRED'], + 'LEGEND_EXPLAIN' => $lang['FILES_REQUIRED_EXPLAIN'], + )); + + $directories = array('cache/', 'files/', 'store/'); + + umask(0); + + $passed['files'] = true; + foreach ($directories as $dir) + { + $exists = $write = false; + + // Try to create the directory if it does not exist + if (!file_exists($phpbb_root_path . $dir)) + { + @mkdir($phpbb_root_path . $dir, 0777); + + try + { + $this->filesystem->phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE); + } + catch (\phpbb\filesystem\exception\filesystem_exception $e) + { + // Do nothing + } + } + + // Now really check + if (file_exists($phpbb_root_path . $dir) && is_dir($phpbb_root_path . $dir)) + { + try + { + $this->filesystem->phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE); + } + catch (\phpbb\filesystem\exception\filesystem_exception $e) + { + // Do nothing + } + + $exists = true; + } + + // Now check if it is writable by storing a simple file + $fp = @fopen($phpbb_root_path . $dir . 'test_lock', 'wb'); + if ($fp !== false) + { + $write = true; + } + @fclose($fp); + + @unlink($phpbb_root_path . $dir . 'test_lock'); + + $passed['files'] = ($exists && $write && $passed['files']) ? true : false; + + $exists = ($exists) ? '' . $lang['FOUND'] . '' : '' . $lang['NOT_FOUND'] . ''; + $write = ($write) ? ', ' . $lang['WRITABLE'] . '' : (($exists) ? ', ' . $lang['UNWRITABLE'] . '' : ''); + + $template->assign_block_vars('checks', array( + 'TITLE' => $dir, + 'RESULT' => $exists . $write, + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + + // Check permissions on files/directories it would be useful access to + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['FILES_OPTIONAL'], + 'LEGEND_EXPLAIN' => $lang['FILES_OPTIONAL_EXPLAIN'], + )); + + $directories = array('config.' . $phpEx, 'images/avatars/upload/'); + + foreach ($directories as $dir) + { + $write = $exists = true; + if (file_exists($phpbb_root_path . $dir)) + { + if (!$this->filesystem->is_writable($phpbb_root_path . $dir)) + { + $write = false; + } + } + else + { + $write = $exists = false; + } + + $exists_str = ($exists) ? '' . $lang['FOUND'] . '' : '' . $lang['NOT_FOUND'] . ''; + $write_str = ($write) ? ', ' . $lang['WRITABLE'] . '' : (($exists) ? ', ' . $lang['UNWRITABLE'] . '' : ''); + + $template->assign_block_vars('checks', array( + 'TITLE' => $dir, + 'RESULT' => $exists_str . $write_str, + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + + // And finally where do we want to go next (well today is taken isn't it :P) + $s_hidden_fields = ($img_imagick) ? '' : ''; + + $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, + 'U_ACTION' => $url, + )); + } + + /** + * Obtain the information required to connect to the database + */ + function obtain_database_settings($mode, $sub) + { + global $lang, $template, $phpEx; + + $this->page_title = $lang['STAGE_DATABASE']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + $connect_test = false; + $error = array(); + $available_dbms = get_available_dbms(false, true); + + // Has the user opted to test the connection? + if (isset($_POST['testdb'])) + { + if (!isset($available_dbms[$data['dbms']]) || !$available_dbms[$data['dbms']]['AVAILABLE']) + { + $error[] = $lang['INST_ERR_NO_DB']; + $connect_test = false; + } + else if (!preg_match(get_preg_expression('table_prefix'), $data['table_prefix'])) + { + $error[] = $lang['INST_ERR_DB_INVALID_PREFIX']; + $connect_test = false; + } + else + { + $connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']); + } + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['DB_CONNECTION'], + 'LEGEND_EXPLAIN' => false, + )); + + if ($connect_test) + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DB_TEST'], + 'RESULT' => '' . $lang['SUCCESSFUL_CONNECT'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['DB_TEST'], + 'RESULT' => '' . implode('
', $error) . '
', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + } + + if (!$connect_test) + { + // Update the list of available DBMS modules to only contain those which can be used + $available_dbms_temp = array(); + foreach ($available_dbms as $type => $dbms_ary) + { + if (!$dbms_ary['AVAILABLE']) + { + continue; + } + + $available_dbms_temp[$type] = $dbms_ary; + } + + $available_dbms = &$available_dbms_temp; + + // And now for the main part of this page + $data['table_prefix'] = (!empty($data['table_prefix']) ? $data['table_prefix'] : 'phpbb_'); + + foreach ($this->db_config_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $data[$config_key], $options), + ) + ); + } + } + + // And finally where do we want to go next (well today is taken isn't it :P) + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + if ($connect_test) + { + foreach ($this->db_config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + } + + $url = ($connect_test) ? $this->p_master->module_url . "?mode=$mode&sub=administrator" : $this->p_master->module_url . "?mode=$mode&sub=database"; + $s_hidden_fields .= ($connect_test) ? '' : ''; + + $submit = $lang['NEXT_STEP']; + + $template->assign_vars(array( + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Obtain the administrator's name, password and email address + */ + function obtain_admin_settings($mode, $sub) + { + global $lang, $template, $phpEx; + + $this->page_title = $lang['STAGE_ADMINISTRATOR']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $passed = false; + + $data['default_lang'] = ($data['default_lang'] !== '') ? $data['default_lang'] : $data['language']; + + if (isset($_POST['check'])) + { + $error = array(); + + // Check the entered email address and password + if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email'] == '') + { + $error[] = $lang['INST_ERR_MISSING_DATA']; + } + + if ($data['admin_pass1'] != $data['admin_pass2'] && $data['admin_pass1'] != '') + { + $error[] = $lang['INST_ERR_PASSWORD_MISMATCH']; + } + + // Test against the default username rules + if ($data['admin_name'] != '' && utf8_strlen($data['admin_name']) < 3) + { + $error[] = $lang['INST_ERR_USER_TOO_SHORT']; + } + + if ($data['admin_name'] != '' && utf8_strlen($data['admin_name']) > 20) + { + $error[] = $lang['INST_ERR_USER_TOO_LONG']; + } + + // Test against the default password rules + if ($data['admin_pass1'] != '' && utf8_strlen($data['admin_pass1']) < 6) + { + $error[] = $lang['INST_ERR_PASSWORD_TOO_SHORT']; + } + + if ($data['admin_pass1'] != '' && utf8_strlen($data['admin_pass1']) > 30) + { + $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG']; + } + + if ($data['board_email'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email'])) + { + $error[] = $lang['INST_ERR_EMAIL_INVALID']; + } + + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang['STAGE_ADMINISTRATOR'], + 'LEGEND_EXPLAIN' => false, + )); + + if (!sizeof($error)) + { + $passed = true; + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['ADMIN_TEST'], + 'RESULT' => '' . $lang['TESTS_PASSED'] . '', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + else + { + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['ADMIN_TEST'], + 'RESULT' => '' . implode('
', $error) . '
', + + 'S_EXPLAIN' => false, + 'S_LEGEND' => false, + )); + } + } + + if (!$passed) + { + foreach ($this->admin_config_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $data[$config_key], $options), + ) + ); + } + } + else + { + foreach ($this->admin_config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + } + + $s_hidden_fields .= ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + + foreach ($this->db_config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + + $submit = $lang['NEXT_STEP']; + + $url = ($passed) ? $this->p_master->module_url . "?mode=$mode&sub=config_file" : $this->p_master->module_url . "?mode=$mode&sub=administrator"; + $s_hidden_fields .= ($passed) ? '' : ''; + + $template->assign_vars(array( + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Writes the config file to disk, or if unable to do so offers alternative methods + */ + function create_config_file($mode, $sub) + { + global $lang, $template, $phpbb_root_path, $phpEx; + + $this->page_title = $lang['STAGE_CONFIG_FILE']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + $written = false; + + // Create a list of any PHP modules we wish to have loaded + $available_dbms = get_available_dbms($data['dbms']); + + // Create a lock file to indicate that there is an install in progress + $fp = @fopen($phpbb_root_path . 'cache/install_lock', 'wb'); + if ($fp === false) + { + // We were unable to create the lock file - abort + $this->p_master->error($lang['UNABLE_WRITE_LOCK'], __LINE__, __FILE__); + } + @fclose($fp); + + @chmod($phpbb_root_path . 'cache/install_lock', 0777); + + // Time to convert the data provided into a config file + $config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER']); + + // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... + if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && $this->filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx)) || $this->filesystem->is_writable($phpbb_root_path)) + { + // Assume it will work ... if nothing goes wrong below + $written = true; + + if (!($fp = @fopen($phpbb_root_path . 'config.' . $phpEx, 'w'))) + { + // Something went wrong ... so let's try another method + $written = false; + } + + if (!(@fwrite($fp, $config_data))) + { + // Something went wrong ... so let's try another method + $written = false; + } + + @fclose($fp); + + if ($written) + { + // We may revert back to chmod() if we see problems with users not able to change their config.php file directly + try + { + $this->filesystem->phpbb_chmod($phpbb_root_path . 'config.' . $phpEx, CHMOD_READ); + } + catch (\phpbb\filesystem\exception\filesystem_exception $e) + { + // Do nothing + } + } + } + + if (isset($_POST['dldone'])) + { + // Do a basic check to make sure that the file has been uploaded + // Note that all we check is that the file has _something_ in it + // We don't compare the contents exactly - if they can't upload + // a single file correctly, it's likely they will have other problems.... + if (filesize($phpbb_root_path . 'config.' . $phpEx) > 10) + { + $written = true; + } + } + + $config_options = array_merge($this->db_config_options, $this->admin_config_options); + + foreach ($config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + + if (!$written) + { + // OK, so it didn't work let's try the alternatives + + if (isset($_POST['dlconfig'])) + { + // They want a copy of the file to download, so send the relevant headers and dump out the data + header("Content-Type: text/x-delimtext; name=\"config.$phpEx\""); + header("Content-disposition: attachment; filename=config.$phpEx"); + echo $config_data; + exit; + } + + // The option to download the config file is always available, so output it here + $template->assign_vars(array( + 'BODY' => $lang['CONFIG_FILE_UNABLE_WRITE'], + 'L_DL_CONFIG' => $lang['DL_CONFIG'], + 'L_DL_CONFIG_EXPLAIN' => $lang['DL_CONFIG_EXPLAIN'], + 'L_DL_DONE' => $lang['DONE'], + 'L_DL_DOWNLOAD' => $lang['DL_DOWNLOAD'], + 'S_HIDDEN' => $s_hidden_fields, + 'S_SHOW_DOWNLOAD' => true, + 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=config_file", + )); + return; + } + else + { + $template->assign_vars(array( + 'BODY' => $lang['CONFIG_FILE_WRITTEN'], + 'L_SUBMIT' => $lang['NEXT_STEP'], + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=advanced", + )); + return; + } + } + + /** + * Provide an opportunity to customise some advanced settings during the install + * in case it is necessary for them to be set to access later + */ + function obtain_advanced_settings($mode, $sub) + { + global $lang, $template, $phpEx, $request; + + $this->page_title = $lang['STAGE_ADVANCED']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $s_hidden_fields = ($data['img_imagick']) ? '' : ''; + $s_hidden_fields .= ''; + + // HTTP_HOST is having the correct browser url in most cases... + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); + + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') !== false) + { + $server_name = substr($server_name, 0, strpos($server_name, ':')); + } + + $data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true; + $data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name; + $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : $request->server('SERVER_PORT', 0); + $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ($request->is_secure() ? 'https://' : 'http://'); + $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : $request->is_secure(); + + if ($data['script_path'] === '') + { + $name = htmlspecialchars_decode($request->server('PHP_SELF')); + if (!$name) + { + $name = htmlspecialchars_decode($request->server('REQUEST_URI')); + } + + // Replace backslashes and doubled slashes (could happen on some proxy setups) + $name = str_replace(array('\\', '//'), '/', $name); + $data['script_path'] = trim(dirname(dirname($name))); + } + + foreach ($this->advanced_config_options as $config_key => $vars) + { + if (!is_array($vars) && strpos($config_key, 'legend') === false) + { + continue; + } + + if (strpos($config_key, 'legend') !== false) + { + $template->assign_block_vars('options', array( + 'S_LEGEND' => true, + 'LEGEND' => $lang[$vars]) + ); + + continue; + } + + $options = isset($vars['options']) ? $vars['options'] : ''; + + $template->assign_block_vars('options', array( + 'KEY' => $config_key, + 'TITLE' => $lang[$vars['lang']], + 'S_EXPLAIN' => $vars['explain'], + 'S_LEGEND' => false, + 'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '', + 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $data[$config_key], $options), + ) + ); + } + + $config_options = array_merge($this->db_config_options, $this->admin_config_options); + foreach ($config_options as $config_key => $vars) + { + if (!is_array($vars)) + { + continue; + } + $s_hidden_fields .= ''; + } + + $submit = $lang['NEXT_STEP']; + + $url = $this->p_master->module_url . "?mode=$mode&sub=create_table"; + + $template->assign_vars(array( + 'BODY' => $lang['STAGE_ADVANCED_EXPLAIN'], + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => $s_hidden_fields, + 'U_ACTION' => $url, + )); + } + + /** + * Load the contents of the schema into the database and then alter it based on what has been input during the installation + */ + function load_schema($mode, $sub) + { + global $db, $lang, $template, $phpbb_root_path, $phpEx, $request; + + $this->page_title = $lang['STAGE_CREATE_TABLE']; + $s_hidden_fields = ''; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + if ($data['dbms'] == '') + { + // Someone's been silly and tried calling this page direct + // So we send them back to the start to do it again properly + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + // HTTP_HOST is having the correct browser url in most cases... + $server_name = strtolower(htmlspecialchars_decode($request->header('Host', $request->server('SERVER_NAME')))); + $referer = strtolower($request->header('Referer')); + + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') !== false) + { + $server_name = substr($server_name, 0, strpos($server_name, ':')); + } + + $cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : $server_name; + + // Try to come up with the best solution for cookie domain... + if (strpos($cookie_domain, 'www.') === 0) + { + $cookie_domain = str_replace('www.', '.', $cookie_domain); + } + + // If we get here and the extension isn't loaded it should be safe to just go ahead and load it + $available_dbms = get_available_dbms($data['dbms']); + + if (!isset($available_dbms[$data['dbms']])) + { + // Someone's been silly and tried providing a non-existant dbms + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $dbms = $available_dbms[$data['dbms']]['DRIVER']; + + // Instantiate the database + $db = new $dbms(); + $db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false); + + // NOTE: trigger_error does not work here. + $db->sql_return_on_error(true); + + // If mysql is chosen, we need to adjust the schema filename slightly to reflect the correct version. ;) + if ($data['dbms'] == 'mysql') + { + if (version_compare($db->sql_server_info(true), '4.1.3', '>=')) + { + $available_dbms[$data['dbms']]['SCHEMA'] .= '_41'; + } + else + { + $available_dbms[$data['dbms']]['SCHEMA'] .= '_40'; + } + } + + // Ok we have the db info go ahead and read in the relevant schema + // and work on building the table + $dbms_schema = 'schemas/' . $available_dbms[$data['dbms']]['SCHEMA'] . '_schema.sql'; + + // How should we treat this schema? + $delimiter = $available_dbms[$data['dbms']]['DELIM']; + + if (file_exists($dbms_schema)) + { + $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) + { + // Ignore errors when the functions or types already exist + // to allow installing phpBB twice in the same database with + // a different prefix + $db->sql_query($sql); + } + unset($sql_query); + } + + // Ok we have the db info go ahead and work on building the table + if (file_exists('schemas/schema.json')) + { + $db_table_schema = @file_get_contents('schemas/schema.json'); + $db_table_schema = json_decode($db_table_schema, true); + } + else + { + global $phpbb_root_path, $phpEx, $table_prefix; + $table_prefix = 'phpbb_'; + + if (!defined('CONFIG_TABLE')) + { + // We need to include the constants file for the table constants + // when we generate the schema from the migration files. + include($phpbb_root_path . 'includes/constants.' . $phpEx); + } + + $finder = new \phpbb\finder(new \phpbb\filesystem\filesystem(), $phpbb_root_path, null, $phpEx); + $classes = $finder->core_path('phpbb/db/migration/data/') + ->get_classes(); + + $sqlite_db = new \phpbb\db\driver\sqlite(); + $factory = new \phpbb\db\tools\factory(); + $db_tools = $factory->get($sqlite_db, true); + $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix); + $db_table_schema = $schema_generator->get_schema(); + } + + 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'); + } + + $factory = new \phpbb\db\tools\factory(); + $db_tools = $factory->get($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'); + + // Deal with any special comments and characters + switch ($data['dbms']) + { + case 'mssql': + case 'mssql_odbc': + case 'mssqlnative': + $sql_query = preg_replace('#\# MSSQL IDENTITY (phpbb_[a-z_]+) (ON|OFF) \##s', 'SET IDENTITY_INSERT \1 \2;', $sql_query); + break; + + case 'postgres': + $sql_query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $sql_query); + break; + + case 'mysql': + case 'mysqli': + $sql_query = str_replace('\\', '\\\\', $sql_query); + break; + } + + // Change prefix + $sql_query = preg_replace('# phpbb_([^\s]*) #i', ' ' . $data['table_prefix'] . '\1 ', $sql_query); + + // Change language strings... + $sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query); + + $sql_query = phpbb_remove_comments($sql_query); + $sql_query = split_sql_file($sql_query, ';'); + + foreach ($sql_query as $sql) + { + //$sql = trim(str_replace('|', ';', $sql)); + if (!$db->sql_query($sql)) + { + $error = $db->sql_error(); + $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); + } + } + unset($sql_query); + + $current_time = time(); + + $user_ip = $request->server('REMOTE_ADDR') ? phpbb_ip_normalise($request->server('REMOTE_ADDR')) : ''; + + if ($data['script_path'] !== '/') + { + // Adjust destination path (no trailing slash) + if (substr($data['script_path'], -1) == '/') + { + $data['script_path'] = substr($data['script_path'], 0, -1); + } + + $data['script_path'] = str_replace(array('../', './'), '', $data['script_path']); + + if ($data['script_path'][0] != '/') + { + $data['script_path'] = '/' . $data['script_path']; + } + } + + // Set default config and post data, this applies to all DB's + $sql_ary = array( + 'INSERT INTO ' . $data['table_prefix'] . "config (config_name, config_value) + VALUES ('board_startdate', '$current_time')", + + 'INSERT INTO ' . $data['table_prefix'] . "config (config_name, config_value) + VALUES ('default_lang', '" . $db->sql_escape($data['default_lang']) . "')", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['img_imagick']) . "' + WHERE config_name = 'img_imagick'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['server_name']) . "' + WHERE config_name = 'server_name'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['server_port']) . "' + WHERE config_name = 'server_port'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['board_email']) . "' + WHERE config_name = 'board_email'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['board_email']) . "' + WHERE config_name = 'board_contact'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($cookie_domain) . "' + WHERE config_name = 'cookie_domain'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($lang['default_dateformat']) . "' + WHERE config_name = 'default_dateformat'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['email_enable']) . "' + WHERE config_name = 'email_enable'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_delivery']) . "' + WHERE config_name = 'smtp_delivery'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_host']) . "' + WHERE config_name = 'smtp_host'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_auth']) . "' + WHERE config_name = 'smtp_auth_method'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_user']) . "' + WHERE config_name = 'smtp_username'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['smtp_pass']) . "' + WHERE config_name = 'smtp_password'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['cookie_secure']) . "' + WHERE config_name = 'cookie_secure'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['force_server_vars']) . "' + WHERE config_name = 'force_server_vars'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['script_path']) . "' + WHERE config_name = 'script_path'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['server_protocol']) . "' + WHERE config_name = 'server_protocol'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($data['admin_name']) . "' + WHERE config_name = 'newest_username'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . md5(mt_rand()) . "' + WHERE config_name = 'avatar_salt'", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . md5(mt_rand()) . "' + WHERE config_name = 'plupload_salt'", + + 'UPDATE ' . $data['table_prefix'] . "users + SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "' + WHERE username = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "moderator_cache + SET username = '" . $db->sql_escape($data['admin_name']) . "' + WHERE username = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "forums + SET forum_last_poster_name = '" . $db->sql_escape($data['admin_name']) . "' + WHERE forum_last_poster_name = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "topics + SET topic_first_poster_name = '" . $db->sql_escape($data['admin_name']) . "', topic_last_poster_name = '" . $db->sql_escape($data['admin_name']) . "' + WHERE topic_first_poster_name = 'Admin' + OR topic_last_poster_name = 'Admin'", + + 'UPDATE ' . $data['table_prefix'] . "users + SET user_regdate = $current_time", + + 'UPDATE ' . $data['table_prefix'] . "posts + SET post_time = $current_time, poster_ip = '" . $db->sql_escape($user_ip) . "'", + + 'UPDATE ' . $data['table_prefix'] . "topics + SET topic_time = $current_time, topic_last_post_time = $current_time", + + 'UPDATE ' . $data['table_prefix'] . "forums + SET forum_last_post_time = $current_time", + + 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($db->sql_server_info(true)) . "' + WHERE config_name = 'dbms_version'", + ); + + if (@extension_loaded('gd')) + { + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = 'core.captcha.plugins.gd' + WHERE config_name = 'captcha_plugin'"; + + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '1' + WHERE config_name = 'captcha_gd'"; + } + + $ref = substr($referer, strpos($referer, '://') + 3); + + if (!(stripos($ref, $server_name) === 0)) + { + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '0' + WHERE config_name = 'referer_validation'"; + } + + // We set a (semi-)unique cookie name to bypass login issues related to the cookie name. + $cookie_name = 'phpbb3_'; + $rand_str = md5(mt_rand()); + $rand_str = str_replace('0', 'z', base_convert($rand_str, 16, 35)); + $rand_str = substr($rand_str, 0, 5); + $cookie_name .= strtolower($rand_str); + + $sql_ary[] = 'UPDATE ' . $data['table_prefix'] . "config + SET config_value = '" . $db->sql_escape($cookie_name) . "' + WHERE config_name = 'cookie_name'"; + + foreach ($sql_ary as $sql) + { + //$sql = trim(str_replace('|', ';', $sql)); + + if (!$db->sql_query($sql)) + { + $error = $db->sql_error(); + $this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); + } + } + + $submit = $lang['NEXT_STEP']; + + $url = $this->p_master->module_url . "?mode=$mode&sub=final"; + + $template->assign_vars(array( + 'BODY' => $lang['STAGE_CREATE_TABLE_EXPLAIN'], + 'L_SUBMIT' => $submit, + 'S_HIDDEN' => build_hidden_fields($data), + 'U_ACTION' => $url, + )); + } + + /** + * Build the search index... + */ + function build_search_index($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpbb_dispatcher, $phpEx, $config, $auth, $user; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + $table_prefix = $data['table_prefix']; + + // If we get here and the extension isn't loaded it should be safe to just go ahead and load it + $available_dbms = get_available_dbms($data['dbms']); + + if (!isset($available_dbms[$data['dbms']])) + { + // Someone's been silly and tried providing a non-existant dbms + $this->p_master->redirect("index.$phpEx?mode=install"); + } + + $dbms = $available_dbms[$data['dbms']]['DRIVER']; + + // Instantiate the database + $db = new $dbms(); + $db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false); + + // NOTE: trigger_error does not work here. + $db->sql_return_on_error(true); + + include_once($phpbb_root_path . 'includes/constants.' . $phpEx); + include_once($phpbb_root_path . 'phpbb/search/fulltext_native.' . $phpEx); + + // We need to fill the config to let internal functions correctly work + $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE); + + $error = false; + $search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher); + + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id + FROM ' . POSTS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); + } + $db->sql_freeresult($result); + } + + /** + * Populate the module tables + */ + function add_modules($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx, $phpbb_extension_manager, $config, $phpbb_container; + + // modules require an extension manager + if (empty($phpbb_extension_manager)) + { + /* @var $phpbb_extension_manager \phpbb\extension\manager */ + $phpbb_extension_manager = $phpbb_container->get('ext.manager'); + } + + $_module = new \phpbb\module\module_manager( + new \phpbb\cache\driver\dummy(), + $db, + $phpbb_extension_manager, + MODULES_TABLE, + $phpbb_root_path, + $phpEx + ); + $module_classes = array('acp', 'mcp', 'ucp'); + + // Add categories + foreach ($module_classes as $module_class) + { + $categories = array(); + + // Set the module class + $_module->module_class = $module_class; + + foreach ($this->module_categories[$module_class] as $cat_name => $subs) + { + $basename = ''; + // Check if this sub-category has a basename. If it has, use it. + if (isset($this->module_categories_basenames[$cat_name])) + { + $basename = $this->module_categories_basenames[$cat_name]; + } + $module_data = array( + 'module_basename' => $basename, + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => 0, + 'module_class' => $module_class, + 'module_langname' => $cat_name, + 'module_mode' => '', + 'module_auth' => '', + ); + + // Add category + $_module->update_module_data($module_data); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + + $categories[$cat_name]['id'] = (int) $module_data['module_id']; + $categories[$cat_name]['parent_id'] = 0; + + // Create sub-categories... + if (is_array($subs)) + { + foreach ($subs as $level2_name) + { + $basename = ''; + // Check if this sub-category has a basename. If it has, use it. + if (isset($this->module_categories_basenames[$level2_name])) + { + $basename = $this->module_categories_basenames[$level2_name]; + } + $module_data = array( + 'module_basename' => $basename, + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => (int) $categories[$cat_name]['id'], + 'module_class' => $module_class, + 'module_langname' => $level2_name, + 'module_mode' => '', + 'module_auth' => '', + ); + + $_module->update_module_data($module_data); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + + $categories[$level2_name]['id'] = (int) $module_data['module_id']; + $categories[$level2_name]['parent_id'] = (int) $categories[$cat_name]['id']; + } + } + } + + // Get the modules we want to add... returned sorted by name + $module_info = $_module->get_module_infos($module_class); + + foreach ($module_info as $module_basename => $fileinfo) + { + foreach ($fileinfo['modes'] as $module_mode => $row) + { + foreach ($row['cat'] as $cat_name) + { + if (!isset($categories[$cat_name])) + { + continue; + } + + $module_data = array( + 'module_basename' => $module_basename, + 'module_enabled' => 1, + 'module_display' => (isset($row['display'])) ? (int) $row['display'] : 1, + 'parent_id' => (int) $categories[$cat_name]['id'], + 'module_class' => $module_class, + 'module_langname' => $row['title'], + 'module_mode' => $module_mode, + 'module_auth' => $row['auth'], + ); + + $_module->update_module_data($module_data); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + } + } + } + + // Move some of the modules around since the code above will put them in the wrong place + if ($module_class == 'acp') + { + // Move main module 4 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'acp_main' + AND module_class = 'acp' + AND module_mode = 'main'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'acp', 'move_up', 4); + + // Move permissions intro screen module 4 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'acp_permissions' + AND module_class = 'acp' + AND module_mode = 'intro'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'acp', 'move_up', 4); + + // Move manage users screen module 5 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'acp_users' + AND module_class = 'acp' + AND module_mode = 'overview'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'acp', 'move_up', 5); + + // Move extension management module 1 up... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_langname = 'ACP_EXTENSION_MANAGEMENT' + AND module_class = 'acp' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'acp', 'move_up', 1); + } + + 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, 'mcp', '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, 'mcp', '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, 'mcp', 'move_down', 3); + } + + if ($module_class == 'ucp') + { + // Move attachment module 4 down... + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_basename = 'ucp_attachments' + AND module_class = 'ucp' + AND module_mode = 'attachments'"; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $_module->move_module_by($row, 'ucp', '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, 'ucp', '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, 'ucp', 'move_down', 5); + } + + // And now for the special ones + // (these are modules which appear in multiple categories and thus get added manually to some for more control) + if (isset($this->module_extras[$module_class])) + { + foreach ($this->module_extras[$module_class] as $cat_name => $mods) + { + $sql = 'SELECT module_id, left_id, right_id + FROM ' . MODULES_TABLE . " + WHERE module_langname = '" . $db->sql_escape($cat_name) . "' + AND module_class = '" . $db->sql_escape($module_class) . "'"; + $result = $db->sql_query_limit($sql, 1); + $row2 = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + foreach ($mods as $mod_name) + { + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_langname = '" . $db->sql_escape($mod_name) . "' + AND module_class = '" . $db->sql_escape($module_class) . "' + AND module_basename <> ''"; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $module_data = array( + 'module_basename' => $row['module_basename'], + 'module_enabled' => (int) $row['module_enabled'], + 'module_display' => (int) $row['module_display'], + 'parent_id' => (int) $row2['module_id'], + 'module_class' => $row['module_class'], + 'module_langname' => $row['module_langname'], + 'module_mode' => $row['module_mode'], + 'module_auth' => $row['module_auth'], + ); + + $_module->update_module_data($module_data); + + // Check for last sql error happened + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + } + } + } + + $_module->remove_cache_file($module_class); + } + } + + /** + * Populate the language tables + */ + function add_language($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx; + + $dir = @opendir($phpbb_root_path . 'language'); + + if (!$dir) + { + $this->error('Unable to access the language directory', __LINE__, __FILE__); + } + + $installed_languages = array(); + while (($file = readdir($dir)) !== false) + { + $path = $phpbb_root_path . 'language/' . $file; + + if ($file == '.' || $file == '..' || is_link($path) || is_file($path) || $file == 'CVS') + { + continue; + } + + if (is_dir($path) && file_exists($path . '/iso.txt')) + { + $lang_file = file("$path/iso.txt"); + + $lang_pack = array( + 'lang_iso' => basename($path), + 'lang_dir' => basename($path), + 'lang_english_name' => trim(htmlspecialchars($lang_file[0])), + 'lang_local_name' => trim(htmlspecialchars($lang_file[1], ENT_COMPAT, 'UTF-8')), + 'lang_author' => trim(htmlspecialchars($lang_file[2], ENT_COMPAT, 'UTF-8')), + ); + + $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $lang_pack)); + + $installed_languages[] = (int) $db->sql_nextid(); + if ($db->get_sql_error_triggered()) + { + $error = $db->sql_error($db->get_sql_error_sql()); + $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__); + } + } + } + closedir($dir); + + $sql = 'SELECT * + FROM ' . PROFILE_FIELDS_TABLE; + $result = $db->sql_query($sql); + + $profile_fields = array(); + $insert_buffer = new \phpbb\db\sql_insert_buffer($db, PROFILE_LANG_TABLE); + while ($row = $db->sql_fetchrow($result)) + { + foreach ($installed_languages as $lang_id) + { + $insert_buffer->insert(array( + 'field_id' => $row['field_id'], + 'lang_id' => $lang_id, + 'lang_name' => strtoupper(substr($row['field_name'], 6)),// Remove phpbb_ from field name + 'lang_explain' => '', + 'lang_default_value' => '', + )); + } + } + $db->sql_freeresult($result); + + $insert_buffer->flush(); + } + + /** + * Add search robots to the database + */ + function add_bots($mode, $sub) + { + global $db, $lang, $phpbb_root_path, $phpEx, $config; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + // We need to fill the config to let internal functions correctly work + $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = 'BOTS'"; + $result = $db->sql_query($sql); + $group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); + + if (!$group_id) + { + // If we reach this point then something has gone very wrong + $this->p_master->error($lang['NO_GROUP'], __LINE__, __FILE__); + } + + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + + foreach ($this->bot_list as $bot_name => $bot_ary) + { + $user_row = array( + 'user_type' => USER_IGNORE, + 'group_id' => $group_id, + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => '9E8DA7', + 'user_email' => '', + 'user_lang' => $data['default_lang'], + 'user_style' => 1, + 'user_timezone' => 'UTC', + 'user_dateformat' => $lang['default_dateformat'], + 'user_allow_massemail' => 0, + 'user_allow_pm' => 0, + ); + + $user_id = user_add($user_row); + + if (!$user_id) + { + // If we can't insert this user then continue to the next one to avoid inconsistent data + $this->p_master->db_error('Unable to insert bot into users table', $db->get_sql_error_sql(), __LINE__, __FILE__, true); + continue; + } + + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => (string) $bot_name, + 'user_id' => (int) $user_id, + 'bot_agent' => (string) $bot_ary[0], + 'bot_ip' => (string) $bot_ary[1], + )); + + $db->sql_query($sql); + } + } + + /** + * Sends an email to the board administrator with their password and some useful links + */ + function email_admin($mode, $sub) + { + global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log; + + $this->page_title = $lang['STAGE_FINAL']; + + // Obtain any submitted data + $data = $this->get_submitted_data(); + + // We need to fill the config to let internal functions correctly work + $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE); + + $user->session_begin(); + $auth->login($data['admin_name'], $data['admin_pass1'], false, true, true); + + // OK, Now that we've reached this point we can be confident that everything + // is installed and working......I hope :) + // So it's time to send an email to the administrator confirming the details + // they entered + + if ($config['email_enable']) + { + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + $messenger = new messenger(false); + + $messenger->template('installed', $data['language']); + + $messenger->to($data['board_email'], $data['admin_name']); + + $messenger->anti_abuse_headers($config, $user); + + $messenger->assign_vars(array( + 'USERNAME' => htmlspecialchars_decode($data['admin_name']), + 'PASSWORD' => htmlspecialchars_decode($data['admin_pass1'])) + ); + + $messenger->send(NOTIFY_EMAIL); + } + + // And finally, add a note to the log + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_INSTALLED', false, array($config['version'])); + + $template->assign_vars(array( + 'TITLE' => $lang['INSTALL_CONGRATS'], + 'BODY' => sprintf($lang['INSTALL_CONGRATS_EXPLAIN'], $config['version'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=convert&language=' . $data['language']), '../docs/README.html'), + 'L_SUBMIT' => $lang['INSTALL_LOGIN'], + 'U_ACTION' => append_sid($phpbb_admin_path . 'index.' . $phpEx, 'i=send_statistics&mode=send_statistics'), + )); + } + + /** + * Check if the avatar directory is writable and disable avatars + * if it isn't writable. + */ + function disable_avatars_if_unwritable() + { + global $config, $phpbb_root_path; + + if (!$this->filesystem->is_writable($phpbb_root_path . 'images/avatars/upload/')) + { + $config->set('allow_avatar', 0); + $config->set('allow_avatar_upload', 0); + } + } + + /** + * Populate migrations for the installation + * + * This "installs" all migrations from (root path)/phpbb/db/migrations/data. + * "installs" means it adds all migrations to the migrations table, but does not + * perform any of the actions in the migrations. + * + * @param \phpbb\extension\manager $extension_manager + * @param \phpbb\db\migrator $migrator + */ + function populate_migrations($extension_manager, $migrator) + { + $finder = $extension_manager->get_finder(); + + $migrations = $finder + ->core_path('phpbb/db/migration/data/') + ->get_classes(); + $migrator->populate_migrations($migrations); + } + + /** + * Generate a list of available mail server authentication methods + */ + function mail_auth_select($selected_method) + { + global $lang; + + $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP'); + $s_smtp_auth_options = ''; + + foreach ($auth_methods as $method) + { + $s_smtp_auth_options .= ''; + } + + return $s_smtp_auth_options; + } + + /** + * Get submitted data + */ + function get_submitted_data() + { + global $request; + + return array( + 'language' => basename($request->variable('language', '')), + 'dbms' => $request->variable('dbms', ''), + 'dbhost' => $request->variable('dbhost', ''), + 'dbport' => $request->variable('dbport', ''), + 'dbuser' => $request->variable('dbuser', ''), + 'dbpasswd' => $request->variable('dbpasswd', '', true), + 'dbname' => $request->variable('dbname', ''), + 'table_prefix' => $request->variable('table_prefix', ''), + 'default_lang' => basename($request->variable('default_lang', '')), + 'admin_name' => $request->variable('admin_name', '', true), + 'admin_pass1' => $request->variable('admin_pass1', '', true), + 'admin_pass2' => $request->variable('admin_pass2', '', true), + 'board_email' => strtolower($request->variable('board_email', '')), + 'img_imagick' => $request->variable('img_imagick', ''), + 'ftp_path' => $request->variable('ftp_path', ''), + 'ftp_user' => $request->variable('ftp_user', ''), + 'ftp_pass' => $request->variable('ftp_pass', ''), + 'email_enable' => $request->variable('email_enable', ''), + 'smtp_delivery' => $request->variable('smtp_delivery', ''), + 'smtp_host' => $request->variable('smtp_host', ''), + 'smtp_auth' => $request->variable('smtp_auth', ''), + 'smtp_user' => $request->variable('smtp_user', ''), + 'smtp_pass' => $request->variable('smtp_pass', ''), + 'cookie_secure' => $request->variable('cookie_secure', ''), + 'force_server_vars' => $request->variable('force_server_vars', ''), + 'server_protocol' => $request->variable('server_protocol', ''), + 'server_name' => $request->variable('server_name', ''), + 'server_port' => $request->variable('server_port', ''), + 'script_path' => $request->variable('script_path', ''), + ); + } + + /** + * The information below will be used to build the input fields presented to the user + */ + var $db_config_options = array( + 'legend1' => 'DB_CONFIG', + 'dbms' => array('lang' => 'DBMS', 'type' => 'select', 'options' => 'dbms_select(\'{VALUE}\')', 'explain' => false), + 'dbhost' => array('lang' => 'DB_HOST', 'type' => 'text:25:100', 'explain' => true), + 'dbport' => array('lang' => 'DB_PORT', 'type' => 'text:25:100', 'explain' => true), + 'dbname' => array('lang' => 'DB_NAME', 'type' => 'text:25:100', 'explain' => false), + 'dbuser' => array('lang' => 'DB_USERNAME', 'type' => 'text:25:100', 'explain' => false), + 'dbpasswd' => array('lang' => 'DB_PASSWORD', 'type' => 'password:25:100', 'explain' => false), + 'table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => true), + ); + var $admin_config_options = array( + 'legend1' => 'ADMIN_CONFIG', + 'default_lang' => array('lang' => 'DEFAULT_LANG', 'type' => 'select', 'options' => '$this->module->inst_language_select(\'{VALUE}\')', 'explain' => false), + 'admin_name' => array('lang' => 'ADMIN_USERNAME', 'type' => 'text:25:100', 'explain' => true), + 'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => true), + 'admin_pass2' => array('lang' => 'ADMIN_PASSWORD_CONFIRM', 'type' => 'password:25:100', 'explain' => false), + 'board_email' => array('lang' => 'CONTACT_EMAIL', 'type' => 'email:25:100', 'explain' => false), + ); + var $advanced_config_options = array( + 'legend1' => 'ACP_EMAIL_SETTINGS', + 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'type' => 'radio:enabled_disabled', 'explain' => true), + '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, '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), + 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'type' => 'radio:yes_no', 'explain' => true), + 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true), + 'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true), + 'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true), + 'script_path' => array('lang' => 'SCRIPT_PATH', 'type' => 'text::255', 'explain' => true), + ); + + /** + * Specific PHP modules we may require for certain optional or extended features + */ + var $php_dlls_other = array('zlib', 'ftp', 'gd', 'xml'); + + /** + * A list of the web-crawlers/bots we recognise by default + * + * Candidates but not included: + * 'Accoona [Bot]' 'Accoona-AI-Agent/' + * 'ASPseek [Crawler]' 'ASPseek/' + * 'Boitho [Crawler]' 'boitho.com-dc/' + * 'Bunnybot [Bot]' 'powered by www.buncat.de' + * 'Cosmix [Bot]' 'cfetch/' + * 'Crawler Search [Crawler]' '.Crawler-Search.de' + * 'Findexa [Crawler]' 'Findexa Crawler (' + * 'GBSpider [Spider]' 'GBSpider v' + * 'genie [Bot]' 'genieBot (' + * 'Hogsearch [Bot]' 'oegp v. 1.3.0' + * 'Insuranco [Bot]' 'InsurancoBot' + * 'IRLbot [Bot]' 'http://irl.cs.tamu.edu/crawler' + * 'ISC Systems [Bot]' 'ISC Systems iRc Search' + * 'Jyxobot [Bot]' 'Jyxobot/' + * 'Kraehe [Metasuche]' '-DIE-KRAEHE- META-SEARCH-ENGINE/' + * 'LinkWalker' 'LinkWalker' + * 'MMSBot [Bot]' 'http://www.mmsweb.at/bot.html' + * 'Naver [Bot]' 'nhnbot@naver.com)' + * 'NetResearchServer' 'NetResearchServer/' + * 'Nimble [Crawler]' 'NimbleCrawler' + * 'Ocelli [Bot]' 'Ocelli/' + * 'Onsearch [Bot]' 'onCHECK-Robot' + * 'Orange [Spider]' 'OrangeSpider' + * 'Sproose [Bot]' 'http://www.sproose.com/bot' + * 'Susie [Sync]' '!Susie (http://www.sync2it.com/susie)' + * 'Tbot [Bot]' 'Tbot/' + * 'Thumbshots [Capture]' 'thumbshots-de-Bot' + * 'Vagabondo [Crawler]' 'http://webagent.wise-guys.nl/' + * 'Walhello [Bot]' 'appie 1.1 (www.walhello.com)' + * 'WissenOnline [Bot]' 'WissenOnline-Bot' + * 'WWWeasel [Bot]' 'WWWeasel Robot v' + * 'Xaldon [Spider]' 'Xaldon WebSpider' + */ + var $bot_list = array( + 'AdsBot [Google]' => array('AdsBot-Google', ''), + 'Alexa [Bot]' => array('ia_archiver', ''), + 'Alta Vista [Bot]' => array('Scooter/', ''), + 'Ask Jeeves [Bot]' => array('Ask Jeeves', ''), + 'Baidu [Spider]' => array('Baiduspider', ''), + 'Bing [Bot]' => array('bingbot/', ''), + 'Exabot [Bot]' => array('Exabot', ''), + 'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''), + 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''), + 'Francis [Bot]' => array('http://www.neomo.de/', ''), + 'Gigabot [Bot]' => array('Gigabot/', ''), + 'Google Adsense [Bot]' => array('Mediapartners-Google', ''), + 'Google Desktop' => array('Google Desktop', ''), + 'Google Feedfetcher' => array('Feedfetcher-Google', ''), + 'Google [Bot]' => array('Googlebot', ''), + 'Heise IT-Markt [Crawler]' => array('heise-IT-Markt-Crawler', ''), + 'Heritrix [Crawler]' => array('heritrix/1.', ''), + 'IBM Research [Bot]' => array('ibm.com/cs/crawler', ''), + 'ICCrawler - ICjobs' => array('ICCrawler - ICjobs', ''), + 'ichiro [Crawler]' => array('ichiro/', ''), + 'Majestic-12 [Bot]' => array('MJ12bot/', ''), + 'Metager [Bot]' => array('MetagerBot/', ''), + 'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''), + 'MSN [Bot]' => array('msnbot/', ''), + 'MSNbot Media' => array('msnbot-media/', ''), + 'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''), + 'Online link [Validator]' => array('online link validator', ''), + 'psbot [Picsearch]' => array('psbot/0', ''), + 'Sensis [Crawler]' => array('Sensis Web Crawler', ''), + 'SEO Crawler' => array('SEO search Crawler/', ''), + 'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''), + 'SEOSearch [Crawler]' => array('SEOsearch/', ''), + 'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''), + 'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''), + 'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''), + 'TurnitinBot [Bot]' => array('TurnitinBot/', ''), + 'Voyager [Bot]' => array('voyager/', ''), + 'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''), + 'W3C [Linkcheck]' => array('W3C-checklink/', ''), + 'W3C [Validator]' => array('W3C_Validator', ''), + 'YaCy [Bot]' => array('yacybot', ''), + 'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''), + 'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''), + 'Yahoo [Bot]' => array('Yahoo! Slurp', ''), + 'YahooSeeker [Bot]' => array('YahooSeeker/', ''), + ); + + /** + * Define the module structure so that we can populate the database without + * needing to hard-code module_id values + */ + var $module_categories = array( + 'acp' => array( + 'ACP_CAT_GENERAL' => array( + 'ACP_QUICK_ACCESS', + 'ACP_BOARD_CONFIGURATION', + 'ACP_CLIENT_COMMUNICATION', + 'ACP_SERVER_CONFIGURATION', + ), + 'ACP_CAT_FORUMS' => array( + 'ACP_MANAGE_FORUMS', + 'ACP_FORUM_BASED_PERMISSIONS', + ), + 'ACP_CAT_POSTING' => array( + 'ACP_MESSAGES', + 'ACP_ATTACHMENTS', + ), + 'ACP_CAT_USERGROUP' => array( + 'ACP_CAT_USERS', + 'ACP_GROUPS', + 'ACP_USER_SECURITY', + ), + 'ACP_CAT_PERMISSIONS' => array( + 'ACP_GLOBAL_PERMISSIONS', + 'ACP_FORUM_BASED_PERMISSIONS', + 'ACP_PERMISSION_ROLES', + 'ACP_PERMISSION_MASKS', + ), + 'ACP_CAT_CUSTOMISE' => array( + 'ACP_STYLE_MANAGEMENT', + 'ACP_EXTENSION_MANAGEMENT', + 'ACP_LANGUAGE', + ), + 'ACP_CAT_MAINTENANCE' => array( + 'ACP_FORUM_LOGS', + 'ACP_CAT_DATABASE', + ), + 'ACP_CAT_SYSTEM' => array( + 'ACP_AUTOMATION', + 'ACP_GENERAL_TASKS', + 'ACP_MODULE_MANAGEMENT', + ), + 'ACP_CAT_DOT_MODS' => null, + ), + 'mcp' => array( + 'MCP_MAIN' => null, + 'MCP_QUEUE' => null, + 'MCP_REPORTS' => null, + 'MCP_NOTES' => null, + 'MCP_WARN' => null, + 'MCP_LOGS' => null, + 'MCP_BAN' => null, + ), + 'ucp' => array( + 'UCP_MAIN' => null, + 'UCP_PROFILE' => null, + 'UCP_PREFS' => null, + 'UCP_PM' => null, + 'UCP_USERGROUPS' => null, + 'UCP_ZEBRA' => null, + ), + ); + var $module_categories_basenames = array( + 'UCP_PM' => 'ucp_pm', + ); + + var $module_extras = array( + 'acp' => array( + 'ACP_QUICK_ACCESS' => array( + 'ACP_MANAGE_USERS', + 'ACP_GROUPS_MANAGE', + 'ACP_MANAGE_FORUMS', + 'ACP_MOD_LOGS', + 'ACP_BOTS', + 'ACP_PHP_INFO', + ), + 'ACP_FORUM_BASED_PERMISSIONS' => array( + 'ACP_FORUM_PERMISSIONS', + 'ACP_FORUM_PERMISSIONS_COPY', + 'ACP_FORUM_MODERATORS', + 'ACP_USERS_FORUM_PERMISSIONS', + 'ACP_GROUPS_FORUM_PERMISSIONS', + ), + ), + ); +} diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php new file mode 100644 index 0000000000..d5874dac83 --- /dev/null +++ b/phpBB/install/install_main.php @@ -0,0 +1,78 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +/** +*/ + +if ( !defined('IN_INSTALL') ) +{ + // Someone has tried to access the file direct. This is not a good idea, so exit + exit; +} + +if (!empty($setmodules)) +{ + $module[] = array( + 'module_type' => 'install', + 'module_title' => 'OVERVIEW', + 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), + 'module_order' => 0, + 'module_subs' => array('INTRO', 'LICENSE', 'SUPPORT'), + 'module_stages' => '', + 'module_reqs' => '' + ); +} + +/** +* Main Tab - Installation +*/ +class install_main extends module +{ + function install_main(&$p_master) + { + $this->p_master = &$p_master; + } + + function main($mode, $sub) + { + global $lang, $template, $language; + + switch ($sub) + { + case 'intro' : + $title = $lang['SUB_INTRO']; + $body = $lang['OVERVIEW_BODY']; + break; + + case 'license' : + $title = $lang['GPL']; + $body = implode("
\n", file(__DIR__ . '/../docs/LICENSE.txt')); + break; + + case 'support' : + $title = $lang['SUB_SUPPORT']; + $body = $lang['SUPPORT_BODY']; + break; + } + + $this->tpl_name = 'install_main'; + $this->page_title = $title; + + $template->assign_vars(array( + 'TITLE' => $title, + 'BODY' => $body, + + 'S_LANG_SELECT' => '', + )); + } +} diff --git a/phpBB/install_old/install_update.php b/phpBB/install/install_update.php similarity index 100% rename from phpBB/install_old/install_update.php rename to phpBB/install/install_update.php diff --git a/phpBB/install_old/phpinfo.php b/phpBB/install/phpinfo.php similarity index 100% rename from phpBB/install_old/phpinfo.php rename to phpBB/install/phpinfo.php diff --git a/phpBB/install/schemas/index.htm b/phpBB/install/schemas/index.htm new file mode 100644 index 0000000000..ee1f723a7d --- /dev/null +++ b/phpBB/install/schemas/index.htm @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql new file mode 100644 index 0000000000..2473d31aab --- /dev/null +++ b/phpBB/install/schemas/oracle_schema.sql @@ -0,0 +1,37 @@ +/* + This first section is optional, however its probably the best method + of running phpBB on Oracle. If you already have a tablespace and user created + for phpBB you can leave this section commented out! + + The first set of statements create a phpBB tablespace and a phpBB user, + make sure you change the password of the phpBB user before you run this script!! +*/ + +/* +CREATE TABLESPACE "PHPBB" + LOGGING + DATAFILE 'E:\ORACLE\ORADATA\LOCAL\PHPBB.ora' + SIZE 10M + AUTOEXTEND ON NEXT 10M + MAXSIZE 100M; + +CREATE USER "PHPBB" + PROFILE "DEFAULT" + IDENTIFIED BY "phpbb_password" + DEFAULT TABLESPACE "PHPBB" + QUOTA UNLIMITED ON "PHPBB" + ACCOUNT UNLOCK; + +GRANT ANALYZE ANY TO "PHPBB"; +GRANT CREATE SEQUENCE TO "PHPBB"; +GRANT CREATE SESSION TO "PHPBB"; +GRANT CREATE TABLE TO "PHPBB"; +GRANT CREATE TRIGGER TO "PHPBB"; +GRANT CREATE VIEW TO "PHPBB"; +GRANT "CONNECT" TO "PHPBB"; + +COMMIT; +DISCONNECT; + +CONNECT phpbb/phpbb_password; +*/ diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql new file mode 100644 index 0000000000..65caba8d1c --- /dev/null +++ b/phpBB/install/schemas/postgres_schema.sql @@ -0,0 +1,80 @@ + +BEGIN; + +/* + Domain definition +*/ +CREATE DOMAIN varchar_ci AS varchar(255) NOT NULL DEFAULT ''::character varying; + +/* + Operation Functions +*/ +CREATE FUNCTION _varchar_ci_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) = LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_not_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) != LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_less_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) < LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_less_equal(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) <= LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_greater_than(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) > LOWER($2)' LANGUAGE SQL STRICT; +CREATE FUNCTION _varchar_ci_greater_equals(varchar_ci, varchar_ci) RETURNS boolean AS 'SELECT LOWER($1) >= LOWER($2)' LANGUAGE SQL STRICT; + +/* + Operators +*/ +CREATE OPERATOR <( + PROCEDURE = _varchar_ci_less_than, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = >, + NEGATOR = >=, + RESTRICT = scalarltsel, + JOIN = scalarltjoinsel); + +CREATE OPERATOR <=( + PROCEDURE = _varchar_ci_less_equal, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = >=, + NEGATOR = >, + RESTRICT = scalarltsel, + JOIN = scalarltjoinsel); + +CREATE OPERATOR >( + PROCEDURE = _varchar_ci_greater_than, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = <, + NEGATOR = <=, + RESTRICT = scalargtsel, + JOIN = scalargtjoinsel); + +CREATE OPERATOR >=( + PROCEDURE = _varchar_ci_greater_equals, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = <=, + NEGATOR = <, + RESTRICT = scalargtsel, + JOIN = scalargtjoinsel); + +CREATE OPERATOR <>( + PROCEDURE = _varchar_ci_not_equal, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = <>, + NEGATOR = =, + RESTRICT = neqsel, + JOIN = neqjoinsel); + +CREATE OPERATOR =( + PROCEDURE = _varchar_ci_equal, + LEFTARG = varchar_ci, + RIGHTARG = varchar_ci, + COMMUTATOR = =, + NEGATOR = <>, + RESTRICT = eqsel, + JOIN = eqjoinsel, + HASHES, + MERGES, + SORT1= <); + +COMMIT; + diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql new file mode 100644 index 0000000000..1f856f016c --- /dev/null +++ b/phpBB/install/schemas/schema_data.sql @@ -0,0 +1,821 @@ +# +# $Id$ +# + +# POSTGRES BEGIN # + +# -- Config +INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_attachments', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_autologin', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_gravatar', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote_upload', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bookmarks', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_cdn', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_password_reset', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_forum_notify', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_live_searches', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_mass_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', 'USERNAME_CHARS_ANY'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_report', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_flash', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_links', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_quick_reply', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_bbcode', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_flash', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_img', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_links', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_smilies', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_smilies', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_topic_notify', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('assets_version', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('attachment_quota', '52428800'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method', 'db'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_filesize', '6144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_gallery_path', 'images/avatars/gallery'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_height', '90'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_max_width', '90'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_height', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_width', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_path', 'images/avatars/upload'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_salt', 'phpbb_avatar'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact', 'contact@yourdomain.tld'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact_name', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email', 'address@yourdomain.tld'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig', '{L_CONFIG_BOARD_EMAIL_SIG}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_hide_emails', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_index_text', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone', 'UTC'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('browser_check', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_interval', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('bump_type', 'd'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cache_gc', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_plugin', 'core.captcha.plugins.nogd'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_foreground_noise', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_x_grid', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_y_grid', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_wave', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_3d_noise', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('captcha_gd_fonts', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('confirm_refresh', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_attachment_content', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('check_dnsbl', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('chg_passforce', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('contact_admin_form_enable', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name', 'phpbb3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path', '/'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_fax', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_mail', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('database_gc', '604800'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('dbms_version', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat', 'D M d, Y g:i a'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_edited', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_last_subject', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('display_order', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('extension_force_unstable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('delete_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_check_mx', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_function_name', 'mail'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_size', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_enable', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_http_auth', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_post', '15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_limit_topic', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall_forums', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_overall', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_forum', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topic', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_new', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_topics_active', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_item_statistics', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval', '15'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('force_server_vars', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_lifetime', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_mintime', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('form_token_sid_guests', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('forward_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('forwarded_for_check', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('full_folder_action', '2'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_max_word_len', '254'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_min_word_len', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_common_thres', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_load_upd', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_max_chars', '14'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_min_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_max_word_len', '254'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_min_word_len', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_postgres_ts_name', 'simple'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_indexer_mem_limit', '512'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_sphinx_stopwords', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path', 'images/icons'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_create_thumbnail', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_display_inlined', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_imagick', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_link_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_thumb_width', '400'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize', '12000'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_max', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_time', '21600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_use_forwarded', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_enable', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_package_size', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_use_ssl', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_email', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_password', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_port', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user_filter', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('legend_sort_groupname', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_moderators', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_notifications', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_unreads_search', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_autologin_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_filesize', '262144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_filesize_pm', '262144'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_name_chars', '20'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_num_search_keywords', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_pass_chars', '100'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '60000'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_font_size', '200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_img_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_img_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_smilies', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_urls', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_quote_depth', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_reg_attempts', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars', '255'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_font_size', '200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_height', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_width', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_post_chars', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_post_limit', '3'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('new_member_group_default', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PASS_TYPE_ANY'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('plupload_salt', 'phpbb_plupload'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_recipients', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page', '10'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '60'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_expire_days', '30'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('read_notification_gc', '86400'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('referer_validation', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_interval', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_anonymous_interval', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_type', '\phpbb\search\fulltext_native'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_results', '1800'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_downloads', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_gc', '3600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length', '3600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc', '{L_CONFIG_SITE_DESC}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_url', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_home_text', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename', '{L_CONFIG_SITENAME}'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path', 'images/smilies'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_per_page', '50'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_auth_method', 'PLAIN'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_delivery', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_host', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_password', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_port', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('smtp_username', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_memberships', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('teampage_forums', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', '25'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.0-a1-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); + +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cache_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cron_lock', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('database_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('last_queue_run', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_colour', 'AA0000', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_id', '2', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_username', '', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_files', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_posts', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_topics', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('plupload_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('rand_seed_last_update', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('read_notification_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_date', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('record_online_users', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_indexing_state', '', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('warnings_last_gc', '0', 1); + +# Config text +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info', ''); +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_uid', ''); +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_bitfield', ''); +INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin_info_flags', '7'); + +# -- Forum related auth options +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_announce', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_bbcode', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_bump', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_delete', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_download', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_edit', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_email', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_flash', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_icons', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_ignoreflood', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_img', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_list', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_noapprove', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_poll', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_post', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_postcount', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_print', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_read', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_reply', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_report', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_sigs', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_smilies', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_sticky', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_subscribe', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_user_lock', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_vote', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_votechg', 1); +INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_softdelete', 1); + +# -- Moderator related auth options +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_approve', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_chgposter', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_delete', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_edit', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_info', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_lock', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_merge', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_move', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_report', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_softdelete', 1, 1); + +# -- Global moderator auth option (not a local option) +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_ban', 0, 1); +INSERT INTO phpbb_acl_options (auth_option, is_local, is_global) VALUES ('m_warn', 0, 1); + +# -- Admin related auth options +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_aauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_authgroups', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_authusers', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_backup', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_ban', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bbcode', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_board', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_bots', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_clearlogs', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_email', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_extensions', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_fauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forum', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forumadd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_forumdel', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_group', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_groupadd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_groupdel', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_icons', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_jabber', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_language', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_mauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_modules', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_names', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_phpinfo', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_profile', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_prune', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_ranks', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_reasons', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_roles', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_server', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_styles', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_switchperm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_uauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_user', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_userdel', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_viewauth', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_viewlogs', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('a_words', 1); + +# -- User related auth options +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgavatar', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgcensors', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgemail', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chggrp', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgname', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgpasswd', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_chgprofileinfo', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_download', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_hideonline', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_ignoreflood', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_masspm_group', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_attach', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_bbcode', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_delete', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_download', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_edit', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_emailpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_flash', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_forward', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_img', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_printpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_pm_smilies', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_readpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_savedrafts', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_search', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendemail', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendim', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sendpm', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_sig', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewonline', 1); +INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewprofile', 1); + + +# -- standard auth roles +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_STANDARD', 'ROLE_DESCRIPTION_ADMIN_STANDARD', 'a_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_FORUM', 'ROLE_DESCRIPTION_ADMIN_FORUM', 'a_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_USERGROUP', 'ROLE_DESCRIPTION_ADMIN_USERGROUP', 'a_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_FULL', 'ROLE_DESCRIPTION_ADMIN_FULL', 'a_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_FULL', 'ROLE_DESCRIPTION_USER_FULL', 'u_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_STANDARD', 'ROLE_DESCRIPTION_USER_STANDARD', 'u_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_LIMITED', 'ROLE_DESCRIPTION_USER_LIMITED', 'u_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NOPM', 'ROLE_DESCRIPTION_USER_NOPM', 'u_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NOAVATAR', 'ROLE_DESCRIPTION_USER_NOAVATAR', 'u_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_FULL', 'ROLE_DESCRIPTION_MOD_FULL', 'm_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_STANDARD', 'ROLE_DESCRIPTION_MOD_STANDARD', 'm_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_SIMPLE', 'ROLE_DESCRIPTION_MOD_SIMPLE', 'm_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_QUEUE', 'ROLE_DESCRIPTION_MOD_QUEUE', 'm_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_FULL', 'ROLE_DESCRIPTION_FORUM_FULL', 'f_', 7); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_STANDARD', 'ROLE_DESCRIPTION_FORUM_STANDARD', 'f_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NOACCESS', 'ROLE_DESCRIPTION_FORUM_NOACCESS', 'f_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_READONLY', 'ROLE_DESCRIPTION_FORUM_READONLY', 'f_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_LIMITED', 'ROLE_DESCRIPTION_FORUM_LIMITED', 'f_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_BOT', 'ROLE_DESCRIPTION_FORUM_BOT', 'f_', 9); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_ONQUEUE', 'ROLE_DESCRIPTION_FORUM_ONQUEUE', 'f_', 8); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_POLLS', 'ROLE_DESCRIPTION_FORUM_POLLS', 'f_', 6); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_LIMITED_POLLS', 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS', 'f_', 4); + +# 23 +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NEW_MEMBER', 'ROLE_DESCRIPTION_USER_NEW_MEMBER', 'u_', 6); + +# 24 +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NEW_MEMBER', 'ROLE_DESCRIPTION_FORUM_NEW_MEMBER', 'f_', 10); + +# -- phpbb_styles +INSERT INTO phpbb_styles (style_name, style_copyright, style_active, style_path, bbcode_bitfield, style_parent_id, style_parent_tree) VALUES ('prosilver', '© phpBB Limited', 1, 'prosilver', 'kNg=', 0, ''); + +# -- Forums +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('{L_FORUMS_FIRST_CATEGORY}', '', 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 'Admin', 'AA0000', 972086460, '', '', '', '', '', '', '', 0, 0, ''); + +INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 0, 0, 1, 0, 0, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48); + +# -- Users / Anonymous user +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', 0); + +# -- username: Admin password: admin (change this or remove it once everything is working!) +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_jabber, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', ''); + +# -- Groups +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED', 3, 0, '', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('REGISTERED_COPPA', 3, 0, '', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GLOBAL_MODERATORS', 3, 0, '00AA00', 2, '', '', '', 0); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('ADMINISTRATORS', 3, 1, 'AA0000', 1, '', '', '', 0); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('BOTS', 3, 0, '9E8DA7', 0, '', '', '', 5); +INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('NEWLY_REGISTERED', 3, 0, '', 0, '', '', '', 5); + +# -- Teampage +INSERT INTO phpbb_teampage (group_id, teampage_name, teampage_position, teampage_parent) VALUES (5, '', 1, 0); +INSERT INTO phpbb_teampage (group_id, teampage_name, teampage_position, teampage_parent) VALUES (4, '', 2, 0); + +# -- User -> Group +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (2, 2, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (4, 2, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (5, 2, 0, 1); + +# -- Ranks +INSERT INTO phpbb_ranks (rank_title, rank_min, rank_special, rank_image) VALUES ('{L_RANKS_SITE_ADMIN_TITLE}', 0, 1, ''); + +# -- Roles data + +# Standard Admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 1, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option NOT IN ('a_switchperm', 'a_jabber', 'a_phpinfo', 'a_server', 'a_backup', 'a_styles', 'a_clearlogs', 'a_modules', 'a_language', 'a_email', 'a_bots', 'a_search', 'a_aauth', 'a_roles'); + +# Forum admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 2, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option IN ('a_', 'a_authgroups', 'a_authusers', 'a_fauth', 'a_forum', 'a_forumadd', 'a_forumdel', 'a_mauth', 'a_prune', 'a_uauth', 'a_viewauth', 'a_viewlogs'); + +# User and Groups Admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 3, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option IN ('a_', 'a_authgroups', 'a_authusers', 'a_ban', 'a_group', 'a_groupadd', 'a_groupdel', 'a_ranks', 'a_uauth', 'a_user', 'a_viewauth', 'a_viewlogs'); + +# Full Admin (a_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 4, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%'; + +# All Features (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 5, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%'; + +# Standard Features (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 6, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_flash', 'u_pm_forward'); + +# Limited Features (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 7, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group'); + +# No Private Messages (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_', 'u_chgavatar', 'u_chgcensors', 'u_chgemail', 'u_chgpasswd', 'u_download', 'u_hideonline', 'u_sig', 'u_viewprofile'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 8, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_readpm', 'u_sendpm', 'u_masspm', 'u_masspm_group'); + +# No Avatar (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option NOT IN ('u_attach', 'u_chgavatar', 'u_viewonline', 'u_chggrp', 'u_chgname', 'u_ignoreflood', 'u_pm_attach', 'u_pm_emailpm', 'u_pm_flash', 'u_savedrafts', 'u_search', 'u_sendemail', 'u_sendim', 'u_masspm', 'u_masspm_group'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 9, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_chgavatar'); + +# Full Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 10, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%'; + +# Standard Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 11, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option NOT IN ('m_ban', 'm_chgposter'); + +# Simple Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 12, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_delete', 'm_softdelete', 'm_edit', 'm_info', 'm_report'); + +# Queue Moderator (m_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 13, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'm_%' AND auth_option IN ('m_', 'm_approve', 'm_edit'); + +# Full Access (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%'; + +# Standard Access (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_flash', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock'); + +# No Access (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option = 'f_'; + +# Read Only Access (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe', 'f_print'); + +# Limited Access (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); + +# Bot Access (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_print'); + +# On Moderation Queue (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove'); + +# Standard Access + Polls (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_flash', 'f_ignoreflood', 'f_sticky', 'f_user_lock'); + +# Limited Access + Polls (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg'); + +# New Member (u_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group', 'u_chgprofileinfo'); + +# New Member (f_) +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 24, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove'); + + +# Permissions + +# GUESTS - u_download and u_search ability +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) SELECT 1, 0, auth_option_id, 0, 1 FROM phpbb_acl_options WHERE auth_option IN ('u_', 'u_download', 'u_search'); + +# Admin user - full user features +INSERT INTO phpbb_acl_users (user_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 5, 0); + +# ADMINISTRATOR Group - full user features +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 5, 0); + +# ADMINISTRATOR Group - standard admin +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 1, 0); + +# REGISTERED and REGISTERED_COPPA having standard user features +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 6, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 0, 0, 6, 0); + +# GLOBAL_MODERATORS having full user features +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 5, 0); + +# GLOBAL_MODERATORS having full global moderator access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 10, 0); + +# Giving all groups read only access to the first category +# since administrators and moderators are already within the registered users group we do not need to set them here +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 1, 0, 17, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 1, 0, 17, 0); + +# Giving access to the first forum + +# guests having read only access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 2, 0, 17, 0); + +# registered and registered_coppa having standard access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 2, 0, 15, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 2, 0, 15, 0); + +# global moderators having standard access + polls +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 2, 0, 21, 0); + +# administrators having full forum and full moderator access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 14, 0); +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 10, 0); + +# Bots having bot access +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 2, 0, 19, 0); + +# NEW MEMBERS are not allowed to send private messages +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 0, 0, 23, 0); + +# NEW MEMBERS on the queue +INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 24, 0); + + +# -- Demo Topic +INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, topic_views, topic_posts_approved, topic_posts_unapproved, topic_posts_softdeleted, forum_id, topic_status, topic_type, topic_first_post_id, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id, topic_last_poster_id, topic_last_poster_name, topic_last_poster_colour, topic_last_post_subject, topic_last_post_time, topic_last_view_time, poll_title, topic_visibility) VALUES ('{L_TOPICS_TOPIC_TITLE}', 2, 972086460, 0, 1, 0, 0, 2, 0, 0, 1, 'Admin', 'AA0000', 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, 972086460, '', 1); + +# -- Demo Post +INSERT INTO phpbb_posts (topic_id, forum_id, poster_id, icon_id, post_time, post_username, poster_ip, post_subject, post_text, post_checksum, bbcode_uid, post_visibility) VALUES (1, 2, 2, 0, 972086460, '', '127.0.0.1', '{L_TOPICS_TOPIC_TITLE}', '{L_DEFAULT_INSTALL_POST}', '5dd683b17f641daf84c040bfefc58ce9', '', 1); + +# -- Admin posted to the demo topic +INSERT INTO phpbb_topics_posted (user_id, topic_id, topic_posted) VALUES (2, 1, 1); + +# -- Smilies +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 1); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-D', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 2); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':grin:', 'icon_e_biggrin.gif', '{L_SMILIES_VERY_HAPPY}', 15, 17, 3); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 4); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-)', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 5); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':smile:', 'icon_e_smile.gif', '{L_SMILIES_SMILE}', 15, 17, 6); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 7); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (';-)', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 8); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':wink:', 'icon_e_wink.gif', '{L_SMILIES_WINK}', 15, 17, 9); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 10); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 11); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':sad:', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 12); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 13); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 14); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 15); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 17, 16); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 17, 20); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 17, 21); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 17, 22); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 23); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 24); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 25); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 26); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 27); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 28); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 17, 29); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 17, 30); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 17, 31); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 17, 32); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 17, 33); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 17, 34); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 17, 35); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 17, 36); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 17, 37); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 17, 38); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 17, 39); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 17, 40); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 17, 18, 42); + +# -- icons +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/fire.gif', 16, 16, 1, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/redface.gif', 16, 16, 9, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/mrgreen.gif', 16, 16, 10, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/heart.gif', 16, 16, 4, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/star.gif', 16, 16, 2, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/radioactive.gif', 16, 16, 3, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/thinking.gif', 16, 16, 5, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/info.gif', 16, 16, 8, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/question.gif', 16, 16, 6, 1); +INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/alert.gif', 16, 16, 7, 1); + +# -- reasons +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('warez', '{L_REPORT_WAREZ}', 1); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('spam', '{L_REPORT_SPAM}', 2); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('off_topic', '{L_REPORT_OFF_TOPIC}', 3); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('other', '{L_REPORT_OTHER}', 4); + +# -- extension_groups +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('IMAGES', 1, 1, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('ARCHIVES', 0, 1, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('PLAIN_TEXT', 0, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOCUMENTS', 0, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('REAL_MEDIA', 3, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('WINDOWS_MEDIA', 2, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('FLASH_FILES', 5, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('QUICKTIME_MEDIA', 6, 0, 1, '', 0, ''); +INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOWNLOADABLE_FILES', 0, 0, 1, '', 0, ''); + +# -- extensions +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'gif'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'png'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpeg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'jpg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tif'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tiff'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (1, 'tga'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gtar'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'gz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tar'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'zip'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'rar'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'ace'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'torrent'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'tgz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, 'bz2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (2, '7z'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'txt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'c'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'h'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'cpp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'hpp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'diz'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'csv'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'ini'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'log'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'js'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'xml'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xls'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsb'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'doc'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'docx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'docm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dot'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dotx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dotm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pdf'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ai'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ps'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ppt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pptx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pptm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ods'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'rtf'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'rm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'ram'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wma'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wmv'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (7, 'swf'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mov'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4v'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4a'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mp4'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3gp'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3g2'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'qt'); + +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpeg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); + +# Add default profile fields +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_location', 'profilefields.type.string', 'phpbb_location', '20', '2', '100', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_website', 'profilefields.type.url', 'phpbb_website', '40', '12', '255', '', '', '', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 2, 1, 'VISIT_WEBSITE', '%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_interests', 'profilefields.type.text', 'phpbb_interests', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_occupation', 'profilefields.type.text', 'phpbb_occupation', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_aol', 'profilefields.type.string', 'phpbb_aol', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 5, 1, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 1, '', ''); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'ymsgr:sendim?%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_facebook', 'profilefields.type.string', 'phpbb_facebook', '20', '5', '50', '', '', '[\w.]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 9, 1, 'VIEW_FACEBOOK_PROFILE', 'http://facebook.com/%s/'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_twitter', 'profilefields.type.string', 'phpbb_twitter', '20', '1', '15', '', '', '[\w_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 10, 1, 'VIEW_TWITTER_PROFILE', 'http://twitter.com/%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_skype', 'profilefields.type.string', 'phpbb_skype', '20', '6', '32', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 11, 1, 'VIEW_SKYPE_PROFILE', 'skype:%s?userinfo'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_youtube', 'profilefields.type.string', 'phpbb_youtube', '20', '3', '60', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 12, 1, 'VIEW_YOUTUBE_CHANNEL', 'http://youtube.com/user/%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_googleplus', 'profilefields.type.googleplus', 'phpbb_googleplus', '20', '3', '255', '', '', '[\w]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 13, 1, 'VIEW_GOOGLEPLUS_PROFILE', 'http://plus.google.com/%s'); + +# User Notification Options (for first user) +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, ''); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, 'notification.method.email'); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, ''); +INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, 'notification.method.email'); + +# POSTGRES COMMIT # diff --git a/phpBB/install/app.php b/phpBB/install_new/app.php similarity index 100% rename from phpBB/install/app.php rename to phpBB/install_new/app.php diff --git a/phpBB/install/phpbbcli.php b/phpBB/install_new/phpbbcli.php old mode 100755 new mode 100644 similarity index 100% rename from phpBB/install/phpbbcli.php rename to phpBB/install_new/phpbbcli.php