From 91398c9e48df7ce0da6763790d9ec233ab06e729 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 8 Oct 2012 15:03:54 +0200 Subject: [PATCH] [feature/soft-delete] Change order of functions PHPBB3-9567 --- phpBB/includes/content_visibility.php | 50 +++++++++++++-------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/phpBB/includes/content_visibility.php b/phpBB/includes/content_visibility.php index 868400b5f6..182df69ec2 100644 --- a/phpBB/includes/content_visibility.php +++ b/phpBB/includes/content_visibility.php @@ -22,6 +22,30 @@ if (!defined('IN_PHPBB')) */ class phpbb_content_visibility { + /** + * Can the current logged-in user soft-delete posts? + * + * @param $forum_id int Forum ID whose permissions to check + * @param $poster_id int Poster ID of the post in question + * @param $post_locked bool Is the post locked? + * @return bool + */ + static function can_soft_delete($forum_id, $poster_id, $post_locked) + { + global $auth, $user; + + if ($auth->acl_get('m_softdelete', $forum_id)) + { + return true; + } + else if ($auth->acl_get('f_softdelete', $forum_id) && $poster_id == $user->data['user_id'] && !$post_locked) + { + return true; + } + + return false; + } + /** * Create topic/post visibility SQL for a given forum ID * @@ -207,7 +231,7 @@ class phpbb_content_visibility } /** - * Change visibility status of one post or a hole topic + * Change visibility status of one post or all posts of a topic * * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED} * @param $post_id mixed Post ID or array of post IDs to act on, @@ -298,30 +322,6 @@ class phpbb_content_visibility } } - /** - * Can the current logged-in user soft-delete posts? - * - * @param $forum_id int Forum ID whose permissions to check - * @param $poster_id int Poster ID of the post in question - * @param $post_locked bool Is the post locked? - * @return bool - */ - static function can_soft_delete($forum_id, $poster_id, $post_locked) - { - global $auth, $user; - - if ($auth->acl_get('m_softdelete', $forum_id)) - { - return true; - } - else if ($auth->acl_get('f_softdelete', $forum_id) && $poster_id == $user->data['user_id'] && !$post_locked) - { - return true; - } - - return false; - } - /** * Remove topic from forum statistics *