aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-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);