mirror of
https://github.com/phpbb/phpbb.git
synced 2025-10-05 04:01:49 +02:00
Merge branch 'develop' of https://github.com/phpbb/phpbb3 into feature/softdelete-1-permission
* 'develop' of https://github.com/phpbb/phpbb3: (480 commits) [ticket/6723] Show info that message has been deleted before delivery [ticket/11385] Fix issue with migration module tool not getting extension module info [ticket/11386] Fix failing tests from constructor changes [ticket/11386] Fix circular reference error & serialize error [ticket/11386] Remove tests that check if finder cache is working [ticket/11386] Forgot to get the migration classes [ticket/11386] Update tests with new constructors for ext.manager/migrator [ticket/11386] Use finder to find migration files [ticket/11363] Fix to make get_module_infos get from all extensions [ticket/11381] Make finder able to search in all available extensions [ticket/11103] Revert whitespace changes [ticket/11103] Few more minor language things [ticket/11103] Don't call generate_board_url many times [ticket/11103] Case time in queries as an int [ticket/11103] Fix effectively installed check [ticket/11103] Remove padding from notifications for now. [ticket/11363] Fix a couple bugs and throw errors if the file not found [ticket/11372] Migrator should only check if effectively installed if not [ticket/11363] Load module info files for extensions too [ticket/11103] Notifications Migration file ... Conflicts: phpBB/includes/functions_posting.php phpBB/includes/mcp/mcp_queue.php phpBB/includes/search/fulltext_mysql.php phpBB/includes/search/fulltext_native.php phpBB/includes/search/fulltext_postgres.php phpBB/includes/search/fulltext_sphinx.php phpBB/install/database_update.php phpBB/styles/prosilver/template/ajax.js
This commit is contained in:
@@ -618,7 +618,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
|
||||
*/
|
||||
function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true)
|
||||
{
|
||||
global $db, $config;
|
||||
global $db, $config, $phpbb_container;
|
||||
|
||||
$approved_topics = 0;
|
||||
$forum_ids = $topic_ids = array();
|
||||
@@ -715,6 +715,14 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
|
||||
set_config_count('num_topics', $approved_topics * (-1), true);
|
||||
}
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
$phpbb_notifications->delete_notifications(array(
|
||||
'topic',
|
||||
'approve_topic',
|
||||
'topic_in_queue',
|
||||
), $topic_ids);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -723,7 +731,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
|
||||
*/
|
||||
function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true, $call_delete_topics = true)
|
||||
{
|
||||
global $db, $config, $phpbb_root_path, $phpEx, $auth, $user;
|
||||
global $db, $config, $phpbb_root_path, $phpEx, $auth, $user, $phpbb_container;
|
||||
|
||||
if ($where_type === 'range')
|
||||
{
|
||||
@@ -892,6 +900,16 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
|
||||
delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false);
|
||||
}
|
||||
|
||||
$phpbb_notifications = $phpbb_container->get('notification_manager');
|
||||
|
||||
$phpbb_notifications->delete_notifications(array(
|
||||
'quote',
|
||||
'bookmark',
|
||||
'post',
|
||||
'approve_post',
|
||||
'post_in_queue',
|
||||
), $post_ids);
|
||||
|
||||
return sizeof($post_ids);
|
||||
}
|
||||
|
||||
@@ -2326,13 +2344,17 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
|
||||
* and group names must be carried through for the moderators table
|
||||
* Cache moderators. Called whenever permissions are changed
|
||||
* via admin_permissions. Changes of usernames and group names
|
||||
* must be carried through for the moderators table.
|
||||
*
|
||||
* @param phpbb_db_driver $db Database connection
|
||||
* @param phpbb_cache_driver_interface Cache driver
|
||||
* @param phpbb_auth $auth Authentication object
|
||||
* @return null
|
||||
*/
|
||||
function cache_moderators()
|
||||
function phpbb_cache_moderators($db, $cache, $auth)
|
||||
{
|
||||
global $db, $cache, $auth, $phpbb_root_path, $phpEx;
|
||||
|
||||
// Remove cached sql results
|
||||
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
|
||||
|
||||
@@ -2502,6 +2524,20 @@ function cache_moderators()
|
||||
$db->sql_multi_insert(MODERATOR_CACHE_TABLE, $sql_ary);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache moderators. Called whenever permissions are changed
|
||||
* via admin_permissions. Changes of usernames and group names
|
||||
* must be carried through for the moderators table.
|
||||
*
|
||||
* @deprecated 3.1
|
||||
* @return null
|
||||
*/
|
||||
function cache_moderators()
|
||||
{
|
||||
global $db, $cache, $auth;
|
||||
return phpbb_cache_moderators($db, $cache, $auth);
|
||||
}
|
||||
|
||||
/**
|
||||
* View log
|
||||
* If $log_count is set to false, we will skip counting all entries in the database.
|
||||
@@ -2774,12 +2810,16 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
|
||||
}
|
||||
|
||||
/**
|
||||
* Update foes - remove moderators and administrators from foe lists...
|
||||
* Removes moderators and administrators from foe lists.
|
||||
*
|
||||
* @param phpbb_db_driver $db Database connection
|
||||
* @param phpbb_auth $auth Authentication object
|
||||
* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
|
||||
* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
|
||||
* @return null
|
||||
*/
|
||||
function update_foes($group_id = false, $user_id = false)
|
||||
function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false)
|
||||
{
|
||||
global $db, $auth;
|
||||
|
||||
// update foes for some user
|
||||
if (is_array($user_id) && sizeof($user_id))
|
||||
{
|
||||
@@ -2888,6 +2928,20 @@ function update_foes($group_id = false, $user_id = false)
|
||||
unset($perms);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes moderators and administrators from foe lists.
|
||||
*
|
||||
* @deprecated 3.1
|
||||
* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
|
||||
* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
|
||||
* @return null
|
||||
*/
|
||||
function update_foes($group_id = false, $user_id = false)
|
||||
{
|
||||
global $db, $auth;
|
||||
return phpbb_update_foes($db, $auth, $group_id, $user_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists inactive users
|
||||
*/
|
||||
|
Reference in New Issue
Block a user