4
What is in your xoops_xoopspoll_log table? Do you have different ID's or IP's for the three votes?
I checked the voting function in /class/xoopspolllog.php and have questiions with this function:
function hasVoted($poll_id, $ip, $user_id=null)
{
global $xoopsModuleConfig;
//
$filter = '';
if ($xoopsModuleConfig['limit_by_uid'] == 1){
if ($user_id > 0) { //otherwise anons cannot vote at all.
$filter .= ' AND user_id ='.intval($user_id);
}
}
if ($xoopsModuleConfig['limit_by_ip'] == 1)
$filter .= ' AND ip ="'.intval($ip).'"';
//if both are set to no then have to default to original behavior otherwise it will break.
if ($filter == '') {
if ( !empty($user_id) ) {
$filter .= " AND user_id=".intval($user_id);
} else {
$filter .= " AND ip='".$ip."'";
}
}
//
$db =& Database::getInstance();
$sql = "SELECT COUNT(*) FROM ".$db->prefix("xoopspoll_log")." WHERE poll_id=".intval($poll_id).$filter;
//
list($count) = $db->fetchRow($db->query($sql));
if ( $count > 0 ) {
return true;
}
return false;
}
The function makes to many presumptions on the state of the preferences and the case for both checks is now allowing that eg user1 can not vote more than once from ip1 but can vote again from ip2.
I would say when there is already a vote from user1 or from ip1, the new vote should be refused.