doh silly me , i'll have to set a logged out flag , will help me in the long run :D thanks dude
> hi, > this is only a very fast response :)) > is solved this kind of problem like that: > (quick solution for a chatboard - user cannot login for xxxxx seconds - > maxidletime) > /***********two functions:******************/ > > function logoutMsgBoardUser($UserName) > > global $MessageBoardTable,$SiteID; > $DB=new connectDB(); > $actDate= date("Y-m-d H:i:s"); > $newMessage=addslashes($UserName)." logged out."; > $host="System"; > $Query="update ".$MessageBoardTable." > set logged_out='1' where > name='".addslashes($UserName)."' > and site_id='".$SiteID."' > and logged_out!='1' > "; > $DB->Query($Query); > $Query="insert into ".$MessageBoardTable." > (site_id,name,msg,created,host,archiv,aktiv,logged_out) > values > > '".$SiteID."', > '', > '".$newMessage."', > '".$actDate."', > '".$host."', > '0', > '1', > '1' > )"; > $DB->Query($Query); > } > > function getMsgBoardUserIdleTime($UserName) > > global $MessageBoardTable,$SiteID; > $DB=new ConnectDB(); > $Query="select created from ".$MessageBoardTable." where > site_id='".$SiteID."' and logged_out='0' and > name='".addslashes($UserName)."' and aktiv='1' order by id desc limit > 1"; > $DB->Query($Query); > if ($DB->next_record()) > > $lastUserPost=$DB->Record['created']; > $actDate= date("Y-m-d H:i:s"); > $Result=strtotime(date ($actDate))-strtotime($lastUserPost); > } else > > $Result=0; > } > return $Result; > } > /***************and the code... i think thats all**************/ > if ($msglogin=='1') { > $newMessage=" <b>entered the Messageboard</b>"; > if (getMsgBoardUserIdleTime($MName) >0) { > echo "Eine User mit diesem Namen ist bereits Online, bitte waehle > einen > anderen..."; > $logged_out=true; > $MName=""; > } > } > > if (isset($MName) && $MName!="") { > $MyIdleTime=getMsgBoardUserIdleTime($MName); > if ($MyIdleTime > $MaxIdleTime) { > logoutMsgBoardUser($MName); > $logged_out=true; > $MName=""; > echo " logged out by system after ".$MyIdleTime." seconds without > saying > anything ;)"; > } > } > > volker > > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Sunday, June 01, 2003 4:11 AM > Subject: [PHP] trikky authentication question > > >> hi guys i have an authentication class , there is one last big issue >> to fix , i am trying to prevent multiple logins , it does this ok >> except , > the >> first login gets kicked instead of the second one , i have a >> last_login date entry to work with , what else should i have so on the >> login check if the user is logged in , there is an issue using the >> logged in feature , ok u give it an interval of say 2 hours , this may >> prevent that person reloggin in for two hours right ?? :| , or say its >> a few minutes , i can log bak in after a few minutes and still kick >> the first login, what are my options >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php