File size: 825B
function checkpass($nick, $pass, $fields)
{ //
global $PassDelay, ErrorMess, $LoginLater;
if ($fields !== "*") $fields .= ",pass,lastrefr";
if ($fields == "") $fields = "pass,lastrefr";
$now = time();
$r = GetRandom();
$sql="select $fields from users where nick='$nick'";
$result=mysql_query($sqlCount) or die(mysql_error());
if (mysql_num_rows($result)!=1) LogResult($ErrorMess,$InvNickMess,"index.php?p=$r");;
$row = mysql_fetch_array($result);
if (($now-$row['lastrefr']) < $PassDelay) LogResult($ErrorMess,$LoginLater,"index.php?p=$r");
if ($row['pass']==$pass) return $result;
else
{
$sql = "update users set lastrefr=$now where nick='$nick'";
mysql_query($sqlUpd) or die(mysql_error());
LogResult($ErrorMess,$InvPassMess,"index.php?p=$r");
}
return "";
}