mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/soft-delete] Simplify the query output if the user has m_restore
PHPBB3-9657
This commit is contained in:
parent
36c9f6aa87
commit
44ed05f567
1 changed files with 6 additions and 2 deletions
|
@ -42,6 +42,11 @@ class phpbb_content_visibility
|
||||||
if ($auth->acl_get('m_restore', $forum_id))
|
if ($auth->acl_get('m_restore', $forum_id))
|
||||||
{
|
{
|
||||||
$status_ary[] = ITEM_DELETED;
|
$status_ary[] = ITEM_DELETED;
|
||||||
|
|
||||||
|
// If the user has m_restore, the rest of the function will not
|
||||||
|
// make more content visible, so we can return the query here.
|
||||||
|
// This avoids one OR in all queries
|
||||||
|
return $db->sql_in_set($table_alias . $mode . '_visibility', $status_ary);
|
||||||
}
|
}
|
||||||
|
|
||||||
$clause = $db->sql_in_set($table_alias . $mode . '_visibility', $status_ary);
|
$clause = $db->sql_in_set($table_alias . $mode . '_visibility', $status_ary);
|
||||||
|
@ -52,8 +57,7 @@ class phpbb_content_visibility
|
||||||
$poster_column = ($mode == 'topic') ? 'topic_poster' : 'poster_id';
|
$poster_column = ($mode == 'topic') ? 'topic_poster' : 'poster_id';
|
||||||
$clause = '(' . $clause . "
|
$clause = '(' . $clause . "
|
||||||
OR ($table_alias{$mode}_visibility = " . ITEM_DELETED . "
|
OR ($table_alias{$mode}_visibility = " . ITEM_DELETED . "
|
||||||
AND $table_alias$poster_column = " . $user->data['user_id'] . '))';
|
AND $table_alias$poster_column = " . (int) $user->data['user_id'] . '))';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $clause;
|
return $clause;
|
||||||
|
|
Loading…
Add table
Reference in a new issue