aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-08-31 12:29:45 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-08-31 12:29:45 +0000
commit7ce940680a410f9c8086001d8fb0c316e5dcf646 (patch)
tree128c0b32804abaafde4dc6085cbe1906b0533c75 /phpBB/viewtopic.php
parent58b8e85c3d6ce59c0b7dbac854d71dd6e993996e (diff)
downloadforums-7ce940680a410f9c8086001d8fb0c316e5dcf646.tar
forums-7ce940680a410f9c8086001d8fb0c316e5dcf646.tar.gz
forums-7ce940680a410f9c8086001d8fb0c316e5dcf646.tar.bz2
forums-7ce940680a410f9c8086001d8fb0c316e5dcf646.tar.xz
forums-7ce940680a410f9c8086001d8fb0c316e5dcf646.zip
Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10076 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index ed4b60cf2c..eaa17279a2 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1465,6 +1465,20 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$s_first_unread = $first_unread = true;
}
+ $edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || (
+ $user->data['user_id'] == $poster_id &&
+ $auth->acl_get('f_edit', $forum_id) &&
+ !$row['post_edit_locked'] &&
+ ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])
+ )));
+
+ $delete_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || (
+ $user->data['user_id'] == $poster_id &&
+ $auth->acl_get('f_delete', $forum_id) &&
+ $topic_data['topic_last_post_id'] == $row['post_id'] &&
+ // we do not want to allowe removal of the last post if a moderator locked it!
+ !$row['post_edit_locked']
+ )));
//
$postrow = array(
@@ -1499,10 +1513,10 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
- 'U_EDIT' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
+ 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&amp;mode=post_details&amp;f=$forum_id&amp;p=" . $row['post_id'], true, $user->session_id) : '',
- 'U_DELETE' => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
+ 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
'U_PROFILE' => $user_cache[$poster_id]['profile'],
'U_SEARCH' => $user_cache[$poster_id]['search'],