aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-08 15:03:54 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-08 15:03:54 +0200
commit91398c9e48df7ce0da6763790d9ec233ab06e729 (patch)
treed0a401bb997aac3a8c4b382b8514bcff0cfaafc5 /phpBB/includes
parentc525e900d3b96b829c939010db343d8032698011 (diff)
downloadforums-91398c9e48df7ce0da6763790d9ec233ab06e729.tar
forums-91398c9e48df7ce0da6763790d9ec233ab06e729.tar.gz
forums-91398c9e48df7ce0da6763790d9ec233ab06e729.tar.bz2
forums-91398c9e48df7ce0da6763790d9ec233ab06e729.tar.xz
forums-91398c9e48df7ce0da6763790d9ec233ab06e729.zip
[feature/soft-delete] Change order of functions
PHPBB3-9567
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/content_visibility.php50
1 files 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
@@ -23,6 +23,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
*
* Note: Read permissions are not checked.
@@ -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,
@@ -299,30 +323,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
*
* @param $topic_id int The topic to act on