aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2010-08-20 12:15:23 -0400
committerChris Smith <toonarmy@phpbb.com>2010-08-22 19:30:43 +0100
commitaa4519fb44f4ff83e923c6cc4d5bde3f20082340 (patch)
tree17ab461cd5f8fc6f2cd1e6a47bb117717196e431 /phpBB
parent25c579c00d25356afead09f13031e69e22f91324 (diff)
downloadforums-aa4519fb44f4ff83e923c6cc4d5bde3f20082340.tar
forums-aa4519fb44f4ff83e923c6cc4d5bde3f20082340.tar.gz
forums-aa4519fb44f4ff83e923c6cc4d5bde3f20082340.tar.bz2
forums-aa4519fb44f4ff83e923c6cc4d5bde3f20082340.tar.xz
forums-aa4519fb44f4ff83e923c6cc4d5bde3f20082340.zip
[ticket/7260] Don't delete poll if one exists and editing user lacks permission
PHPBB3-7260
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/posting.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index df063ef391..8cacac2910 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -402,6 +402,16 @@ if ($post_data['poll_start'])
$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']);
$message_parser = new parse_message();
@@ -912,6 +922,22 @@ if ($submit || $preview || $refresh)
$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
{
$poll = array();