double out

Started on the old forum in March 2010 · view the original in the archive · old links redirect here

No replies · 308 views · started 16 years ago · 1 min read

pretend Developer · 107 posts #1

session out of date if same session exists. this doesnt work any ideas?

function logged($sid)
{

if(trim($sid)=="")return false;
$loginfo = mysql_fetch_array(mysql_query("SELECT uname, upwd, ipadd, browser FROM rwc_sessions WHERE sid='".$sid."' LIMIT 1"));
if($loginfo['uname']==0||$loginfo['uname']==""||!isuser($loginfo['uname']))
{
return false;
}
//password is out of date
$uinfo = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM rwc_users WHERE id='".$loginfo['uname']."' AND pass='".$loginfo['upwd']."'"));
if($uinfo[0]==0)
{
return false;
}

global $ubr; global $uip;
if($uip!=$loginfo['ipadd']||$ubr!=$loginfo['browser'])
{
autopm(1, $loginfo['uname'], 'IP: '.$uip.'[br/]Browser: '.$ubr.'[br/]has guessed your session ID, though they cant login its necessary to forward this PM to an Admin');
return false;
}
return true;
}
function isuser($uid)
{
$isit = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM rwc_users WHERE id='".$uid."'"));
if($isit[0]>0)
{
return true;
}
return false;
}
function sid2uid($sid)
{
$theuid = mysql_fetch_array(mysql_query("SELECT uname FROM rwc_sessions WHERE sid='".$sid."' LIMIT 1"));
return $theuid[0];
}

Nice Effects

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close