diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-06 21:49:24 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-06 21:49:24 -0500 |
commit | 26fd70d9cdffe0107635db5f3846dbe5ea6e3fae (patch) | |
tree | 641a33e35665c3b8198fd2d641a687560342ba56 /phpBB/install | |
parent | 74093d0fd383619ec8b58914ebe2edd68145e070 (diff) | |
parent | 2364d4b2172c9f54520f04001b29c517d7138b69 (diff) | |
download | forums-26fd70d9cdffe0107635db5f3846dbe5ea6e3fae.tar forums-26fd70d9cdffe0107635db5f3846dbe5ea6e3fae.tar.gz forums-26fd70d9cdffe0107635db5f3846dbe5ea6e3fae.tar.bz2 forums-26fd70d9cdffe0107635db5f3846dbe5ea6e3fae.tar.xz forums-26fd70d9cdffe0107635db5f3846dbe5ea6e3fae.zip |
Merge remote-tracking branch 'upstream/develop' into ticket/11015
* upstream/develop: (196 commits)
[ticket/11219] Coding guidelines and naming consistency changes
[ticket/10841] Revert more whitespace changes.
[ticket/10841] Revert whitespace changes.
[ticket/10841] adding space after if
[ticket/10841] removing unnecessary spacing
[ticket/10841] changing affectedrows check to COUNT in sql
[ticket/10841] Modifying style and language selectors in UCP
[ticket/11247] Fix wrong property reference in flock class.
[ticket/10602] Avoid a race condition.
[ticket/10602] Use last_queue_run for its intended purpose.
[ticket/10716] Collect standard error from executed php process.
[ticket/10716] Skip test if php is not in PATH.
[ticket/10716] Exclude our dependencies from linting.
[ticket/10103] New and improved wording.
[ticket/10716] Only lint on php 5.3+.
[ticket/10103] Assert with messages.
[ticket/10103] assertLessThan/assertGreaterThan.
[ticket/10103] Inline assignment is bad?
[ticket/10103] $rv had too few characters.
[ticket/10103] Correct flock class documentation.
...
Conflicts:
phpBB/includes/functions.php
tests/cache/cache_test.php
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/database_update.php | 43 | ||||
-rw-r--r-- | phpBB/install/install_install.php | 20 | ||||
-rw-r--r-- | phpBB/install/install_update.php | 2 |
3 files changed, 62 insertions, 3 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index ded9ed00f9..7bd57a510b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -112,6 +112,7 @@ $phpbb_container = phpbb_create_dumped_container_unless_debug( ), array( new phpbb_di_pass_collection_pass(), + new phpbb_di_pass_kernel_pass(), ), $phpbb_root_path, $phpEx @@ -2301,6 +2302,26 @@ function change_database_data(&$no_updates, $version) } } + // Disable receiving pms for bots + $sql = 'SELECT user_id + FROM ' . BOTS_TABLE; + $result = $db->sql_query($sql); + + $bot_user_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $bot_user_ids[] = (int) $row['user_id']; + } + $db->sql_freeresult($result); + + if (!empty($bot_user_ids)) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_allow_pm = 0 + WHERE ' . $db->sql_in_set('user_id', $bot_user_ids); + _sql($sql, $errored, $error_ary); + } + $no_updates = false; break; @@ -2748,6 +2769,28 @@ function change_database_data(&$no_updates, $version) $config->set('site_home_text', ''); } + // PHPBB3-10601: Make inbox default. Add basename to ucp's pm category + + // Get the category wanted while checking, at the same time, if this has already been applied + $sql = 'SELECT module_id, module_basename + FROM ' . MODULES_TABLE . " + WHERE module_basename <> 'ucp_pm' AND + module_langname='UCP_PM' + "; + $result = $db->sql_query_limit($sql, 1); + + if ($row = $db->sql_fetchrow($result)) + { + // This update is still not applied. Applying it + + $sql = 'UPDATE ' . MODULES_TABLE . " + SET module_basename = 'ucp_pm' + WHERE module_id = " . (int) $row['module_id']; + + _sql($sql, $errored, $error_ary); + } + $db->sql_freeresult($result); + break; } } diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 8284cd0464..b440f0ad2c 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1472,8 +1472,14 @@ class install_install extends module 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' => '', + 'module_basename' => $basename, 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => 0, @@ -1501,8 +1507,14 @@ class install_install extends module { 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' => '', + 'module_basename' => $basename, 'module_enabled' => 1, 'module_display' => 1, 'parent_id' => (int) $categories[$cat_name]['id'], @@ -1766,6 +1778,7 @@ class install_install extends module 'user_timezone' => 'UTC', 'user_dateformat' => $lang['default_dateformat'], 'user_allow_massemail' => 0, + 'user_allow_pm' => 0, ); $user_id = user_add($user_row); @@ -2109,6 +2122,9 @@ class install_install extends module 'UCP_ZEBRA' => null, ), ); + var $module_categories_basenames = array( + 'UCP_PM' => 'ucp_pm', + ); var $module_extras = array( 'acp' => array( diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index a556056382..ea9ead6659 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -71,7 +71,7 @@ class install_update extends module function main($mode, $sub) { - global $style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; + global $phpbb_style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; global $request; $this->tpl_name = 'install_update'; |