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 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);