aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/database_update.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/install/database_update.php')
-rw-r--r--phpBB/install/database_update.php20
1 files changed, 20 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;
}