mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/7260] Don't delete poll if one exists and editing user lacks permission
PHPBB3-7260
This commit is contained in:
parent
25c579c00d
commit
aa4519fb44
1 changed files with 26 additions and 0 deletions
|
@ -402,6 +402,16 @@ if ($post_data['poll_start'])
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$original_poll_data = array(
|
||||||
|
'poll_title' => $post_data['poll_title'],
|
||||||
|
'poll_length' => $post_data['poll_length'],
|
||||||
|
'poll_max_options' => $post_data['poll_max_options'],
|
||||||
|
'poll_option_text' => implode("\n", $post_data['poll_options']),
|
||||||
|
'poll_start' => $post_data['poll_start'],
|
||||||
|
'poll_last_vote' => $post_data['poll_last_vote'],
|
||||||
|
'poll_vote_change' => $post_data['poll_vote_change'],
|
||||||
|
);
|
||||||
|
|
||||||
$orig_poll_options_size = sizeof($post_data['poll_options']);
|
$orig_poll_options_size = sizeof($post_data['poll_options']);
|
||||||
|
|
||||||
$message_parser = new parse_message();
|
$message_parser = new parse_message();
|
||||||
|
@ -912,6 +922,22 @@ if ($submit || $preview || $refresh)
|
||||||
$message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
|
$message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS'];
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
else if (!$auth->acl_get('f_poll', $forum_id) && ($mode == 'edit') && ($post_id == $post_data['topic_first_post_id']) && ($original_poll_data['poll_title'] != ''))
|
||||||
|
{
|
||||||
|
// We have a poll but the editing user is not permitted to create/edit it.
|
||||||
|
// So we just keep the original poll-data.
|
||||||
|
$poll = array_merge($original_poll_data, array(
|
||||||
|
'enable_bbcode' => $post_data['enable_bbcode'],
|
||||||
|
'enable_urls' => $post_data['enable_urls'],
|
||||||
|
'enable_smilies' => $post_data['enable_smilies'],
|
||||||
|
'img_status' => $img_status,
|
||||||
|
));
|
||||||
|
|
||||||
|
$message_parser->parse_poll($poll);
|
||||||
|
|
||||||
|
$post_data['poll_options'] = (isset($poll['poll_options'])) ? $poll['poll_options'] : '';
|
||||||
|
$post_data['poll_title'] = (isset($poll['poll_title'])) ? $poll['poll_title'] : '';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$poll = array();
|
$poll = array();
|
||||||
|
|
Loading…
Add table
Reference in a new issue