diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-10-07 16:50:35 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-10-07 16:50:35 +0200 |
commit | e5b2dc922f1c2e94332ffcc5e9ea002ce5326837 (patch) | |
tree | 355c29f083ab1a0b60bd8af68e989209bc58e657 /phpBB/viewtopic.php | |
parent | 3fd1fa5492b96715f3bfbd16fcbe416e07ebb6e7 (diff) | |
parent | 0d6c323611eeacf0170dede6bd7980be894f7020 (diff) | |
download | forums-e5b2dc922f1c2e94332ffcc5e9ea002ce5326837.tar forums-e5b2dc922f1c2e94332ffcc5e9ea002ce5326837.tar.gz forums-e5b2dc922f1c2e94332ffcc5e9ea002ce5326837.tar.bz2 forums-e5b2dc922f1c2e94332ffcc5e9ea002ce5326837.tar.xz forums-e5b2dc922f1c2e94332ffcc5e9ea002ce5326837.zip |
Merge pull request #3615 from rxu/ticket/13846
[ticket/13846] Fix softdelete feature workflow in viewtopic
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r-- | phpBB/viewtopic.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 26524283e1..4220eabe06 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1826,6 +1826,12 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) (!$s_cannot_delete && !$s_cannot_delete_lastpost && !$s_cannot_delete_time && !$s_cannot_delete_locked) )); + $softdelete_allowed = ($auth->acl_get('m_softdelete', $forum_id) || + ($auth->acl_get('f_softdelete', $forum_id) && $user->data['user_id'] == $poster_id)) && ($row['post_visibility'] != ITEM_DELETED); + + $permanent_delete_allowed = ($auth->acl_get('m_delete', $forum_id) || + ($auth->acl_get('f_delete', $forum_id) && $user->data['user_id'] == $poster_id)); + // Can this user receive a Private Message? $can_receive_pm = ( // They must be a "normal" user @@ -1888,7 +1894,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', 'U_QUOTE' => ($quote_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', - 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', + 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=' . (($softdelete_allowed) ? 'soft_delete' : 'delete') . "&f=$forum_id&p={$row['post_id']}") : '', 'U_SEARCH' => $user_cache[$poster_id]['search'], 'U_PM' => $u_pm, @@ -1927,6 +1933,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '', 'S_POST_HIDDEN' => $row['hide_post'], 'L_POST_DISPLAY' => ($row['hide_post']) ? $user->lang('POST_DISPLAY', '<a class="display_post" data-post-id="' . $row['post_id'] . '" href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '', + 'S_DELETE_PERMANENT' => $permanent_delete_allowed, ); $user_poster_data = $user_cache[$poster_id]; |