Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: inter on February 25, 2015, 04:55:53 AM

Title: [smf 2.0.9] ssi_showPoll bug
Post by: inter on February 25, 2015, 04:55:53 AM
guest can see the results of the survey, despite a ban.

http://support.simplemachines.org/function_db/index.php?action=view_function;id=527
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Deaks on February 25, 2015, 10:24:14 AM
can you provide more information is it a full ban? post ban?  do you have any other ssi mods installed that may interfere with this function? can you provide steps to replicate easier?
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Kindred on February 25, 2015, 11:13:04 AM
yup...  we would need more information.


At the moment, based on the description that you have given, I actually don't see a real bug...

1- you make poll result visible to guests
2- you make the poll/results display using SSI


So, why is it a problem that poll results are displayed to guests (banned or not)?

Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: margarett on February 25, 2015, 11:52:27 AM
Do note that the only ban that would be effective in that case is IP ban (because he is a guest). If the accesses from another IP, then he's like any other guest (non-banned)
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: inter on February 25, 2015, 12:51:54 PM
if the voting results can only look after the vote, but guests can still see them
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: margarett on February 25, 2015, 12:56:16 PM
So the ban isn't really important?

Please confirm if this is the scenario:
* Your guests are allowed to view poll results
* Your poll is configured to show results only after the vote
* Normal guests on the forum can't see the results
* Guests via SSI can see the results

Is that it?
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: inter on February 25, 2015, 01:03:32 PM
* poll is configured to show results only after the vote
* Guests via SSI can see the results (Simple Portal mod)
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Deaks on February 25, 2015, 01:16:23 PM
Quote from: Ρουνικ on February 25, 2015, 10:24:14 AM
do you have any other ssi mods installed that may interfere with this function? can you provide steps to replicate easier?

these are also important a few mods are known to interfere with SSI
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Kindred on February 25, 2015, 03:59:35 PM
also....    can guests actually VOTE?

If they can not vote, then I think they are going to see the results.
I believe that is how the logic works...
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Arantor on February 26, 2015, 12:58:09 AM
And the fact SP is involved may make this an SP bug...
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: margarett on February 26, 2015, 07:48:36 AM
I confirm this.

I create a poll, set it to show results after someone has voted.

I vote and see the results
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=534001.0;attach=240674;image)

A guest cannot see the ongoing results
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=534001.0;attach=240676;image)

Using ssi_showPoll as a guest the result IS SHOWN
(http://www.simplemachines.org/community/index.php?action=dlattach;topic=534001.0;attach=240678;image)


<?php

// Include the SSI file.
require(dirname(__FILE__) . '/SSI.php');

if (!empty(
$user_info['is_guest']))
echo 'I am a guest </br>';
else
echo 'I am a user! </br>';
ssi_showPoll ($topic=9$output_method='echo');

?>
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Oldiesmann on February 26, 2015, 03:59:10 PM
This is weird. The code for that function specifically shows results if you're hiding them and the person viewing the poll can't vote...

$allow_view_results = allowedTo('moderate_board') || $row['hide_results'] == 0 || ($row['hide_results'] == 1 && !$allow_vote) || $is_expired;

The code to display the poll in the topic actually takes into account whether or not you've voted. For now you can get rid of the "|| ($row['hide_results'] == 1 && !$allow_vote)" part to prevent it from showing results to those who can't vote. It doesn't fix the issue of showing results if you've already voted, but it'll solve the bigger issue until a proper fix is determined.
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Ninja ZX-10RR on August 02, 2015, 12:29:45 AM
Yo Oldiesmann, did you have the time to look into this by any chance? Because it's been nearly 6 months and I was wondering whether you could push a proper fix into 2.0.11 or if it's strictly simpleportal-related (if that is the case, being in Support Team, I'd like to know).
Thanks
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: live627 on August 02, 2015, 12:56:38 AM
I think this is in 2.0.10.
Title: Re: [smf 2.0.9] ssi_showPoll bug
Post by: Ninja ZX-10RR on August 02, 2015, 12:59:59 AM
*thumbs up*