I have been confronted with cheating from both groups:
- providers evaluating themselves with best marks using other usernames
- providers evaluating competing providers giving bad marks using other usernames
- users overrating providers using several usernames
- users taking vengeance from providers by using several usernames
To be able to track the different usernames, I came up with a small hack:
Quote
if (pnUserLoggedIn())
{
// get the users stored in the cookie
$cook = $_COOKIE['session_mgr'];
// transform back into an array
$cookusers = unserialize($cook);
// get username
$cuser = pnUserGetVar('uname');
// check if user is found in cookie
if(in_array($cuser,$cookusers))
{
// do nothing
}
else
{
// add new user to the array
$cookusers[] = $cuser;
// store in cookie
$serial_cook = serialize($cookusers);
setcookie('session_mgr',$serial_cook,time()+(60*60*24*365));
// store in DB if there is more than one username
if($cookusers[1] != Null)
{
$SQL = "INSERT INTO usercookies (cooknames) VALUES ('$serial_cook')";
list($dbconn) = pnDBGetConn();
$result = $dbconn->Execute($SQL);
$result->Close();
}
}
}
do you think it will work like that?
edited by: manarak, Jun 25, 2008 - 06:46 PM
