mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
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
This commit is contained in:
@@ -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&f=$forum_id&p={$row['post_id']}") : ''),
|
||||
'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '',
|
||||
'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? 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' => (!$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&f=$forum_id&p={$row['post_id']}") : ''),
|
||||
'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '',
|
||||
|
||||
'U_PROFILE' => $user_cache[$poster_id]['profile'],
|
||||
'U_SEARCH' => $user_cache[$poster_id]['search'],
|
||||
|
Reference in New Issue
Block a user