aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2010-08-22 19:39:46 +0100
committerChris Smith <toonarmy@phpbb.com>2010-08-22 19:39:46 +0100
commite4a1f08364c29693680c01f14cbd46e5d48ee972 (patch)
tree2173f53570de1e45cee96cf11b247a3e97967f82 /phpBB
parent9731f2492f329a35b80483fa7573763b728c4f40 (diff)
parentaa4519fb44f4ff83e923c6cc4d5bde3f20082340 (diff)
downloadforums-e4a1f08364c29693680c01f14cbd46e5d48ee972.tar
forums-e4a1f08364c29693680c01f14cbd46e5d48ee972.tar.gz
forums-e4a1f08364c29693680c01f14cbd46e5d48ee972.tar.bz2
forums-e4a1f08364c29693680c01f14cbd46e5d48ee972.tar.xz
forums-e4a1f08364c29693680c01f14cbd46e5d48ee972.zip
Merge branch 'ticket/nickvergessen/7260' into develop-olympus
* ticket/nickvergessen/7260: [ticket/7260] Don't delete poll if one exists and editing user lacks permission
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();