www.pudn.com > coolchat.zip > checkrand.pl
sub checkrand
{
my($username,$randnum,$room) = @_;
my ($key,$time,$ip,$lowid,$first_id,$keydatapath);
$lowid = lc($username);
$keydatapath = "$Userdatapath/$lowid.KEY";
if(open KEYDATA,"<$keydatapath")
{
$checkip = ;
$key = ;
$ip = ;
close KEYDATA;
$checkip =~ s/\n|\r//g;
$key =~ s/\n|\r//g;
$ip =~ s/\n|\r//g;
return 1 if(($checkip eq 1)&&($ip ne $ENV{'REMOTE_ADDR'}));
return 0 if($key eq $randnum);
}
return 1;
}
1;