mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
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
This commit is contained in:
commit
7a77edf25e
2 changed files with 21 additions and 0 deletions
|
@ -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;
|
$no_updates = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1772,6 +1772,7 @@ class install_install extends module
|
||||||
'user_timezone' => 'UTC',
|
'user_timezone' => 'UTC',
|
||||||
'user_dateformat' => $lang['default_dateformat'],
|
'user_dateformat' => $lang['default_dateformat'],
|
||||||
'user_allow_massemail' => 0,
|
'user_allow_massemail' => 0,
|
||||||
|
'user_allow_pm' => 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
$user_id = user_add($user_row);
|
$user_id = user_add($user_row);
|
||||||
|
|
Loading…
Add table
Reference in a new issue