Skip to content

Commit

Permalink
#2351 - User IP fixes, and Poll Voting form token to 1 count per scre…
Browse files Browse the repository at this point in the history
…en refresh.
  • Loading branch information
FrederickChan committed Jan 14, 2021
1 parent d3a3059 commit 7b8df69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/core_functions_include.php
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,7 @@ function fusion_get_username($user_id) {
function fusion_get_userdata($key = NULL) {
global $userdata;
if (empty($userdata)) {
$userdata = ["user_level" => 0, "user_rights" => "", "user_groups" => "", "user_theme" => 'Default'];
$userdata = ["user_level" => 0, "user_rights" => "", "user_groups" => "", "user_theme" => 'Default', "user_ip"=>USER_IP];
}
$userdata = $userdata + [
"user_id" => 0,
Expand Down
3 changes: 2 additions & 1 deletion infusions/member_poll_panel/poll_classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,10 @@ public function DisplayPoll() {
$render['poll_table'][0]['poll_option'][] = form_checkbox('check', $data1, '-1', ['reverse_label' => TRUE, 'type' => 'radio', 'value' => $im1, 'input_id' => 'check-'.$im1]);
}

$render['poll_table'][0]['openform'] = openform('voteform', 'post', clean_request(), ['enctype' => TRUE]).form_hidden('poll_id', '', $data['poll_id']);
$render['poll_table'][0]['openform'] = openform('voteform', 'post', clean_request(), ['max_tokens'=>1]).form_hidden('poll_id', '', $data['poll_id']);
$render['poll_table'][0]['button'] = form_button("cast_vote", self::$locale['POLL_020'], self::$locale['POLL_020'], ['class' => 'btn-primary']);
$render['poll_table'][0]['closeform'] = closeform();

} else {
if (!empty($data['poll_title']) && $data['poll_started'] < time()) {
$render['poll_table'][0]['max_vote'] = $this->_countVote("poll_id='".$data['poll_id']."'");
Expand Down

0 comments on commit 7b8df69

Please sign in to comment.