From e3bdaea2656f788dd58e04d62896435246b6f23b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 18 Apr 2009 17:22:41 +0000 Subject: [PATCH] Ability to vote in poll is now required for the ability to change existing vote. (Bug #38925) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9470 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/posting.php | 4 ++-- phpBB/viewtopic.php | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 62c64a9c2a..81a85eb3ad 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -142,6 +142,7 @@
  • [Fix] PM Export uses ISO 8601 date now. (Bug #32645)
  • [Fix] Apply append_sid() to newest/latest post links in viewforum/search and UCP main module. (Bug #26815)
  • [Fix] Do not create thumbnail if thumbnail would've the same size as the original image. (Bug #30725)
  • +
  • [Fix] Ability to vote in poll is now required for the ability to change existing vote. (Bug #38925)
  • [Change] Default difference view is now 'inline' instead of 'side by side'
  • [Change] Added new option for merging differences to conflicting files in automatic updater
  • [Change] Add link to user profile in the MCP for user notes and warn user.
  • diff --git a/phpBB/posting.php b/phpBB/posting.php index 1342b74642..cc98e9c496 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -648,7 +648,7 @@ if ($submit || $preview || $refresh) $post_data['poll_length'] = request_var('poll_length', 0); $post_data['poll_option_text'] = utf8_normalize_nfc(request_var('poll_option_text', '', true)); $post_data['poll_max_options'] = request_var('poll_max_options', 1); - $post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0; + $post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0; } // If replying/quoting and last post id has changed @@ -1343,7 +1343,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_ { $template->assign_vars(array( 'S_SHOW_POLL_BOX' => true, - 'S_POLL_VOTE_CHANGE' => ($auth->acl_get('f_votechg', $forum_id)), + 'S_POLL_VOTE_CHANGE' => ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id)), 'S_POLL_DELETE' => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), 'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index b76f6c5e88..2bc8086efe 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -679,8 +679,8 @@ if (!empty($topic_data['poll_start'])) } } - $s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) || - ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change'])) && + // Can not vote at all if no vote permission + $s_can_vote = ($auth->acl_get('f_vote', $forum_id) && (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) && $topic_data['topic_status'] != ITEM_LOCKED && $topic_data['forum_status'] != ITEM_LOCKED) ? true : false;