mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
Merge remote-tracking branch 'upstream/develop' into feature/avatars
* upstream/develop: (255 commits) [ticket/10935] Limit number of PM rules per user to 5000 [ticket/10801] Fixed quickmod tools. [ticket/9551] uncomment line and change length to 255 [ticket/10925] Clarify installation requirements for SQLite [ticket/10938] Serve subforum listing on forumlist from template loop [ticket/10640] Change subject length in mcp in subsilver [ticket/10640] Change subject length in MCP [ticket/10640] Do not change default value of truncate_string() [ticket/10640] Change maximum subject length [ticket/10936] remove PCRE and mbstring support check [ticket/10936] fix language key [ticket/10829] Delete T_STYLESHEET_NAME - no longer used. [ticket/10829] $style_name -> $style_path in style class. [ticket/10743] Renaming user->theme [ticket/10743] Changing obtain_cfg_items [ticket/10882] Fix test name - oops. [ticket/10931] Apply strtolower() correctly, i.e. not on false. [ticket/10931] Also test get_bytes() and get_string() with false. [ticket/10931] Make to_numeric function globally available. [ticket/10932] Use included composer.phar in build process ... Conflicts: phpBB/includes/mcp/mcp_warn.php phpBB/install/database_update.php phpBB/styles/prosilver/template/ucp_avatar_options.html
This commit is contained in:
@@ -527,62 +527,12 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
WHERE session_user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Remove any undelivered mails...
|
||||
$sql = 'SELECT msg_id, user_id
|
||||
FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE author_id = ' . $user_id . '
|
||||
AND folder_id = ' . PRIVMSGS_NO_BOX;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$undelivered_msg = $undelivered_user = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
// Clean the private messages tables from the user
|
||||
if (!function_exists('phpbb_delete_user_pms'))
|
||||
{
|
||||
$undelivered_msg[] = $row['msg_id'];
|
||||
$undelivered_user[$row['user_id']][] = true;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (sizeof($undelivered_msg))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE author_id = ' . $user_id . '
|
||||
AND folder_id = ' . PRIVMSGS_NO_BOX;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Delete all to-information
|
||||
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Set the remaining author id to anonymous - this way users are still able to read messages from users being removed
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
|
||||
SET author_id = ' . ANONYMOUS . '
|
||||
WHERE author_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . PRIVMSGS_TABLE . '
|
||||
SET author_id = ' . ANONYMOUS . '
|
||||
WHERE author_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
|
||||
foreach ($undelivered_user as $_user_id => $ary)
|
||||
{
|
||||
if ($_user_id == $user_id)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ',
|
||||
user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . '
|
||||
WHERE user_id = ' . $_user_id;
|
||||
$db->sql_query($sql);
|
||||
include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
|
||||
}
|
||||
phpbb_delete_user_pms($user_id);
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
@@ -1947,6 +1897,27 @@ function validate_jabber($jid)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies whether a style ID corresponds to an active style.
|
||||
*
|
||||
* @param int $style_id The style_id of a style which should be checked if activated or not.
|
||||
* @return boolean
|
||||
*/
|
||||
function phpbb_style_is_active($style_id)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = 'SELECT style_active
|
||||
FROM ' . STYLES_TABLE . '
|
||||
WHERE style_id = '. (int) $style_id;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$style_is_active = (bool) $db->sql_fetchfield('style_active');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return $style_is_active;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove avatar
|
||||
*/
|
||||
|
Reference in New Issue
Block a user