activated == 1) { $validate = md5(rand(0,1000)); setcookie("login",$data->login,time()+60*60*24,"/",".crimewar2004.com"); setcookie("validate",$validate,time()+60*60*24,"/",".crimewar2004.com"); mysql_query("REPLACE INTO `[online]`(`time`,`login`,`IP`,`validate`) values(NOW(),'{$_SERVER['REMOTE_ADDR']}','{$data->login}','$validate')"); $_SESSION['login'] = $data->login; $_SESSION['IP'] = $_SERVER['REMOTE_ADDR']; $dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup` FROM `[users]` WHERE `login`='{$_SESSION['login']}'"); $_SESSION['data'] = mysql_fetch_object($dbres); } } else if($_GET['x'] == "logout") { mysql_query("DELETE FROM `[online]` WHERE `login`='{$_COOKIE['login']}' AND `validate`='{$_COOKIE['validate']}' AND `IP`='{$_SERVER['REMOTE_ADDR']}'"); setcookie("login",'',time()-24*60*60,"/",""); setcookie("validate",'',time()-24*60*60,"/",""); unset($_SESSION['login']); unset($_SESSION['IP']); unset($_SESSION['data']); } /* ------------------------- */ ?> [( Criminals )] "> \n \n"; else if($_GET['x'] == "lostpass") { print " \n"; if(isset($_GET['id'],$_GET['code'])) { $dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `id`='{$_GET['id']}' AND `code`='{$_GET['code']}' AND `area`='lostpass'"); if($data = mysql_fetch_object($dbres)) { $dbres = mysql_query("SELECT `login`,`email` FROM `[users]` WHERE `login`='{$data->login}'"); $data = mysql_fetch_object($dbres); $newpass = rand(100000,999999); mysql_query("UPDATE `[users]` SET `pass`=MD5('$newpass') WHERE `login`='{$data->login}'"); mysql_query("DELETE FROM `[temp]` WHERE `id`='{$_GET['id']}'"); mail($data->email,"Criminals password","Je wachtwoord is gereset, je kan nu inloggen met: $newpass","From: Criminals \n"); print " \n"; } } else if(isset($_POST['email'],$_POST['login'])) { $dbres = mysql_query("SELECT `login`,`email` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `email`='{$_POST['email']}'AND `activated`=1"); if($data = mysql_fetch_object($dbres)) { $code = rand(100000,999999); mysql_query("INSERT INTO `[temp]`(`login`,`code`,`area`,`time`) values('{$data->login}',$code,'lostpass',NOW())"); $id = mysql_insert_id(); mail($data->email,"Criminals password","Er is een aanvraag binnengekomen om je wachtwoord te resetten. Als jij dit niet hebt aangevraagd, negeer deze email dan. Heb jij dit wel gedaan, klik dan op deze link:\nhttp://www.crimewar2004.com/login.php?x=lostpass&id=$id&code=$code","From: Criminals "); print " \n"; } else print " \n"; } print << ENDHTML; } else if($data) { if($data->activated == 0) print " \n"; else print " \n \n"; } else { print " \n"; if(isset($_POST['login'],$_POST['pass'])) print " \n"; print << ENDHTML; } /* ------------------------- */ ?>
Login
Je bent nu uitgelogd\n
Wachtwoord vergeten
Je nieuwe wachtwoord is ge-emailed naar {$data->email}
Er is een email gestuurd naar {$data->email} met verdere instructies
Er is geen gebruiker met die login en e-mail

Login:
E-Mail:
Je account is nog niet geactiveerd
Login
Je bent nu ingelogd\n \n
Login
Verkeerde login of wachtwoord
Login:
Wachtwoord:
Wachtwoord vergeten?