diff options
| author | Nils Adermann <naderman@naderman.de> | 2011-11-18 20:31:40 +0100 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2011-11-18 20:31:40 +0100 |
| commit | 3df4b83cd3306013d78b93024905a67ecc97df25 (patch) | |
| tree | 736955d03d2bcf8ca93428a5a78c649f49fe3ae7 /phpBB/posting.php | |
| parent | 0a4efcbe8c9e4fe13d4a726f30f38d01d1334e32 (diff) | |
| parent | 4be9c70827c5d87bd654bae22095b8165a689ffa (diff) | |
| download | forums-3df4b83cd3306013d78b93024905a67ecc97df25.tar forums-3df4b83cd3306013d78b93024905a67ecc97df25.tar.gz forums-3df4b83cd3306013d78b93024905a67ecc97df25.tar.bz2 forums-3df4b83cd3306013d78b93024905a67ecc97df25.tar.xz forums-3df4b83cd3306013d78b93024905a67ecc97df25.zip | |
Merge branch 'develop-olympus' into develop
* develop-olympus:
[ticket/9776] Delete poll if no poll options were submitted.
Diffstat (limited to 'phpBB/posting.php')
| -rw-r--r-- | phpBB/posting.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 74a8ebecb5..207ac32a3d 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -902,6 +902,23 @@ if ($submit || $preview || $refresh) $message_parser->warn_msg[] = $user->lang['NO_DELETE_POLL_OPTIONS']; }*/ } + else if ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && $auth->acl_get('f_poll', $forum_id)) + { + // The user removed all poll options, this is equal to deleting the poll. + $poll = array( + 'poll_title' => '', + 'poll_length' => 0, + 'poll_max_options' => 0, + 'poll_option_text' => '', + 'poll_start' => 0, + 'poll_last_vote' => 0, + 'poll_vote_change' => 0, + 'poll_options' => array(), + ); + + $post_data['poll_options'] = $post_data['poll_title'] = ''; + $post_data['poll_start'] = $post_data['poll_length'] = $post_data['poll_max_options'] = $post_data['poll_last_vote'] = $post_data['poll_vote_change'] = 0; + } 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. |
