Location: PHPKode > projects > H-tracker > takelogin.php
<?
//
//  H-Tracker v0.2
//    http://h-tracker.org
//    Based on TorrentTrader (http://www.torrenttrader.org)
//
//
require_once("backend/functions.php");
require_once("backend/phpbb2Bridge.php");
if (mkglobal("username:password")) {
    $password = md5($password);

    $res = mysql_query("SELECT id, password, secret, enabled, email FROM users WHERE username = " . sqlesc($username) . " AND status = 'confirmed'");
    $row = mysql_fetch_array($res);
    
    if ($row["status"] == "pending")
        $message = "Your account is currently pending, please check your email";
    
    if (!$row)
        $message = "Username Incorrect";
    elseif ($row["password"] != $password)
        $message = "Password Incorrect";
    elseif ($row["enabled"] == "no")
        $message = "This account has been disabled by an administrator.";
insert_phpBB2user($username, $password, $row["email"]);
  if (login_phpBB2user($username, $password, TRUE)==false)
  {
    update_phpBB2userPassword($username,$password); // login failed: try to update the password in case it was changed
    login_phpBB2user($username, $password, TRUE);
  }   

    if (!$message){
     logincookie($row["id"], $row["password"], hash_pad($row["secret"], 20));
        if(strpos(strtoupper(@gethostbyaddr(getip())), "PROXY.AOL"))
{
   show_error_msg("Warning!", "<h1>AOL Proxy Detected</h1><hr>Sorry but the AOL browser is banned from MYSITE. Please use another browser like Firefox/IE");
}
        if (!empty($_POST["returnto"])) {
            header("Refresh: 0; url=" . $_POST["returnto"]);
            die();
        }
        else { 
            header("Refresh: 0; url=index.php");
            die();
        }
    }else{
        show_error_msg("Access Denied", $message,1);
    }
}

logoutcookie();
?>
Return current item: H-tracker