diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-01 04:55:48 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-01 04:55:48 -0500 |
commit | 7a77edf25e3c3dbf0730b176f22616206af81625 (patch) | |
tree | a4286195f0e34a92f1e255cf0f95e793f00ab074 | |
parent | 3a702084e4249830a87dc0914127e00c1bb1b1dd (diff) | |
parent | ae14ac7ba90388abf9f2ae68ae824865eb37236e (diff) | |
download | forums-7a77edf25e3c3dbf0730b176f22616206af81625.tar forums-7a77edf25e3c3dbf0730b176f22616206af81625.tar.gz forums-7a77edf25e3c3dbf0730b176f22616206af81625.tar.bz2 forums-7a77edf25e3c3dbf0730b176f22616206af81625.tar.xz forums-7a77edf25e3c3dbf0730b176f22616206af81625.zip |
Merge PR #893 branch 'develop-olympus' into develop
* develop-olympus:
[ticket/10184] Query bots table to get the user_ids of the bots
[ticket/10184] Disable receiving pms for bots by default
-rw-r--r-- | phpBB/install/database_update.php | 20 | ||||
-rw-r--r-- | phpBB/install/install_install.php | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 377e38c423..dde0fdcf47 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2303,6 +2303,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; diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index f80b8b5661..51cdd5b329 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1772,6 +1772,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); |