Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 325ea14fd4
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (27 sloc) 0.91 kB
<?php
//print_r($_POST);exit();
require_once("include/bittorrent.php");
if (!mkglobal("username:password"))
die();
session_start();
dbconn();
function bark($text = "Username or password incorrect")
{
stderr("Login failed!", $text);
}
$res = mysql_query("SELECT id, passhash, secret, enabled,status FROM users WHERE username = " . sqlesc($username) . "");
$row = mysql_fetch_assoc($res);
if (!$row)
bark();
if ($row["passhash"] != md5($row["secret"] . $password . $row["secret"]))
bark();
if($row["status"]=="pending")
bark('You have not confirmed your email address yet. More information is <a href="faq.php#user1">here</a>.');
if ($row["enabled"] == "no")
bark("This account has been disabled.");
logincookie($row["id"], $row["passhash"]);
if (!empty($_POST["returnto"]))
header("Location: $_POST[returnto]");
else
header("Location: browse.php");
?>
Jump to Line
Something went wrong with that request. Please try again.