[feature/soft-delete] Comment out stuff about f_restore for performance reason

PHPBB3-9657
This commit is contained in:
Joas Schilling 2012-09-28 16:14:44 +02:00
parent 3bc3cf6e00
commit 8b2181eb85

View file

@ -47,9 +47,15 @@ class phpbb_content_visibility
{ {
// The user can see all types, so we simplify this to an empty string, // The user can see all types, so we simplify this to an empty string,
// as we don't need to restrict anything on the query. // as we don't need to restrict anything on the query.
return ''; return '1 = 1';
}
} }
return $db->sql_in_set($table_alias . $mode . '_visibility', $status_ary);
/**
* @todo: Commented out, because the performance is not the best
*
// If the user has m_restore, the rest of the function will not // If the user has m_restore, the rest of the function will not
// make more content visible, so we can return the query here. // make more content visible, so we can return the query here.
return $db->sql_in_set($table_alias . $mode . '_visibility', $status_ary); return $db->sql_in_set($table_alias . $mode . '_visibility', $status_ary);
@ -64,7 +70,7 @@ class phpbb_content_visibility
$clause = '(' . $clause . " $clause = '(' . $clause . "
OR ($table_alias{$mode}_visibility = " . ITEM_DELETED . " OR ($table_alias{$mode}_visibility = " . ITEM_DELETED . "
AND $table_alias$poster_column = " . (int) $user->data['user_id'] . '))'; AND $table_alias$poster_column = " . (int) $user->data['user_id'] . '))';
} }*/
return $clause; return $clause;
} }
@ -100,6 +106,9 @@ class phpbb_content_visibility
AND ' . $db->sql_in_set($table_alias . 'forum_id', $restore_forums) . ')'; AND ' . $db->sql_in_set($table_alias . 'forum_id', $restore_forums) . ')';
} }
/*
* @todo: Commented out, because the performance is not the best
*
// we also allow the user to view deleted posts he himself made // we also allow the user to view deleted posts he himself made
$user_restore_forums = array_diff(array_intersect($forum_ids, array_keys($auth->acl_getf('f_restore', true))), $restore_forums); $user_restore_forums = array_diff(array_intersect($forum_ids, array_keys($auth->acl_getf('f_restore', true))), $restore_forums);
if (sizeof($user_restore_forums) && !sizeof($restore_forums)) if (sizeof($user_restore_forums) && !sizeof($restore_forums))
@ -111,6 +120,7 @@ class phpbb_content_visibility
AND $table_alias{$mode}_visibility = " . ITEM_DELETED . " AND $table_alias{$mode}_visibility = " . ITEM_DELETED . "
AND " . $db->sql_in_set($table_alias . 'forum_id', $user_restore_forums) . ')'; AND " . $db->sql_in_set($table_alias . 'forum_id', $user_restore_forums) . ')';
} }
*/
$where_sql .= ')'; $where_sql .= ')';
@ -148,6 +158,9 @@ class phpbb_content_visibility
AND ' . $db->sql_in_set($table_alias . 'forum_id', $restore_forums) . ')'; AND ' . $db->sql_in_set($table_alias . 'forum_id', $restore_forums) . ')';
} }
/*
* @todo: Commented out, because the performance is not the best
*
// we also allow the user to view deleted posts he himself made // we also allow the user to view deleted posts he himself made
$user_restore_forums = array_diff(array_keys($auth->acl_getf('f_restore', true)), $exclude_forum_ids); $user_restore_forums = array_diff(array_keys($auth->acl_getf('f_restore', true)), $exclude_forum_ids);
if (sizeof($user_restore_forums) && !sizeof($restore_forums)) if (sizeof($user_restore_forums) && !sizeof($restore_forums))
@ -159,6 +172,7 @@ class phpbb_content_visibility
AND $table_alias{$mode}_visibility = " . ITEM_DELETED . " AND $table_alias{$mode}_visibility = " . ITEM_DELETED . "
AND " . $db->sql_in_set($table_alias . 'forum_id', $user_restore_forums) . ')'; AND " . $db->sql_in_set($table_alias . 'forum_id', $user_restore_forums) . ')';
} }
*/
$where_sql .= ')'; $where_sql .= ')';