View Single Post
  #5  
Old 4th September 2019, 14:50
allfree allfree is offline
Member
 
Join Date: Aug 2019
Italy
Posts: 7
Post re my takelogin
PHP Code:
<?

require_once("include/bittorrent.php");

if (!
mkglobal("username:password"))
    die();

dbconn();

function 
bark($text "Username or password incorrect")
{
  
stderr("<center>Login failed !</center>"$text);
}

$res mysql_query("SELECT id, passhash, secret, enabled FROM users WHERE username = " sqlesc($username) . " AND status = 'confirmed'");
$row mysql_fetch_array($res);

if (!
$row)
    
bark();

if (
$row["passhash"] != md5($row["secret"] . $password $row["secret"]))
    
bark();

if (
$row["enabled"] == "no")
    
bark("<center>This account has been disabled.</center>");

// ADN MOD  PERMANENT LOGIN
$expires = (int) $_POST["expires"];

if (!
$expires or $expires <= or $expires 31556926) {
 
$expires 0x7fffffff;
} else {
 
$expires time() + $expires;
}

logincookie($row["id"], $row["passhash"], 1$expires);  
// END MOD  PERMANENT LOGIN

/// and mod login return
if (!empty($_POST["returnto"]))
    
header("Location: $BASEURL$_POST[returnto]");
else
    
header("Location: $BASEURL/my.php");
///* end mod login return

?>
Reply With Quote
The Following User Says Thank You to allfree For This Useful Post:
BamBam0077 (11th September 2019)