aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-01 04:55:00 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-01 04:55:00 -0500
commitae14ac7ba90388abf9f2ae68ae824865eb37236e (patch)
tree34403efdb38a9a119b9b77c726d068e411b9c6a1
parentb2a252d2748be0f18901db5fc0294566af04a2dc (diff)
parentad2d560f3f6ab0232728392b2c1c946f2b07902d (diff)
downloadforums-ae14ac7ba90388abf9f2ae68ae824865eb37236e.tar
forums-ae14ac7ba90388abf9f2ae68ae824865eb37236e.tar.gz
forums-ae14ac7ba90388abf9f2ae68ae824865eb37236e.tar.bz2
forums-ae14ac7ba90388abf9f2ae68ae824865eb37236e.tar.xz
forums-ae14ac7ba90388abf9f2ae68ae824865eb37236e.zip
Merge PR #893 branch 'nickvergessen/ticket/10184' into develop-olympus
* nickvergessen/ticket/10184: [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.php20
-rw-r--r--phpBB/install/install_install.php1
2 files changed, 21 insertions, 0 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 399ad3429a..983b1b46c4 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2171,6 +2171,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 67ebb8b1c5..0575b58d92 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1859,6 +1859,7 @@ class install_install extends module
'user_timezone' => 0,
'user_dateformat' => $lang['default_dateformat'],
'user_allow_massemail' => 0,
+ 'user_allow_pm' => 0,
);
$user_id = user_add($user_row);