=2) { $thesessionid=$anarray[0]; $theloginnick=$anarray[1]; if (strlen($theloginnick)>25) {$theloginnick=substr($theloginnick,0,25);} $theloginnick=(strtolower($theloginnick)); } } $errormsg=""; if (isset($_GET['act'])) { session_start(); if ($_GET['act']=="2") { if (isset($_SESSION['SESSIONID'])) {session_destroy();} if (isset($_COOKIE["session"])) { $anarray=explode("|",$_COOKIE["session"]); if (count($anarray)>=2) { $thesessionid=$anarray[0]; $theloginnick=$anarray[1]; if (strlen($theloginnick)>25) {$theloginnick=substr($theloginnick,0,25);} $theloginnick=(strtolower($theloginnick)); setcookie("session","",time()-2592000,"/",".startvg.com"); // delete cookie session_destroy(); } } } else if (isset($_POST['login']) && isset($_POST['password'])) { $theloginnick=trim($_POST['login']); if (strlen($theloginnick)>25) {$theloginnick=substr($theloginnick,0,25);} $theloginnick=(strtolower($theloginnick)); if (strlen($theloginnick)==0 && strlen(trim($_POST['password']))==0) { include($_SERVER['DOCUMENT_ROOT']."/inc/login_".$lang.".htm"); exit; } $theloginpass=md5(trim($_POST['password'])); $db_link = mysqli_connect("dbm", "cl_user", "05ln29c647g5", "cl_startvg"); if (!$db_link) {die(GetStr(STR_SERVERBUSY));} $result = mysqli_query($db_link, "SELECT password FROM emaildetails WHERE username=\"".$theloginnick."\" LIMIT 1"); if (mysqli_num_rows($result)==1) { $row=mysqli_fetch_assoc($result); if ($row['password']==$theloginpass) { // logged! if (isset($_POST['openidnonce'])) { if (strlen($_POST['openidnonce'])==32) { $resid=mysqli_query($db_link,"SELECT email FROM tempopenids WHERE nonce=\"".($_POST['openidnonce'])."\" LIMIT 1"); if (mysqli_num_rows($resid)==1) { $rowid=mysqli_fetch_assoc($resid); mysqli_query($db_link,"DELETE FROM tempopenids WHERE email=\"".$rowid['email']."\" LIMIT 1"); mysqli_query($db_link,"REPLACE INTO openids SET username=\"".$theloginnick."\",email=\"".$rowid['email']."\""); } } } $thesessionid=md5($theloginnick.$row['password'].$_SERVER['REMOTE_ADDR']."frrEFgf24FZj/8kLee"); mysqli_free_result($result); mysqli_close($db_link); $anarray=array($thesessionid,$theloginnick); $thecookie=implode("|",$anarray); setcookie("session",$thecookie,time()+2592000,"/",".startvg.com"); //setcookie("browsecnt","",time()-2592000,"/",".startvg.com"); //if ($row['regionid']>0) {setcookie("srcreg",addslashes($row['regionid']),time()+2592000,"/",".startvg.com");} //if ($row['country']!="--") {setcookie("srccou",addslashes($row['country']),time()+2592000,"/",".startvg.com");} $_SESSION['SESSIONID']=$thesessionid; $_SESSION['NICKNAME']=$theloginnick; //set default src country //if ($row['country']!="--") {setcookie("srccou",$row['country'],time()+2592000,"/",".startvg.com");} else {setcookie("srccou","",time()-2592000,"/",".startvg.com");} //mysql_query("REPLACE INTO usersessions SET username=\"".$theloginnick."\",sessionid=\"".$thesessionid."\",last=CURRENT_TIMESTAMP(),ip=\"".$_SERVER['REMOTE_ADDR']."\""); // mysql_query("UPDATE users SET laston=CURRENT_TIMESTAMP() WHERE username=\"".$theloginnick."\" LIMIT 1"); echo(chr(0xef).chr(0xbb).chr(0xbf)."".GetStr(STR_THANKYOU)." ".$theloginnick." ".GetStr(STR_YOURNOWLOGGED).""); exit; } else { $errormsg=GetStr(STR_INVALIDIDORPW)."."; } } else { $errormsg=GetStr(STR_INVALIDIDORPW)."."; } } else { setcookie("session","",time()-2592000,"/",".startvg.com"); session_destroy(); } } // endif act.... ?> StartVG -