mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
Challenge-Response Authentication
This commit is contained in:
+13
-12
@@ -9,7 +9,7 @@ if (!$id)
|
||||
|
||||
dbconn();
|
||||
|
||||
$res = sql_query("SELECT passhash, secret, editsecret, status FROM users WHERE id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
|
||||
$res = sql_query("SELECT passhash, secret, auth_key, editsecret, status FROM users WHERE id = ".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
|
||||
$row = mysql_fetch_assoc($res);
|
||||
|
||||
if (!$row)
|
||||
@@ -30,17 +30,18 @@ if (!mysql_affected_rows())
|
||||
httperr();
|
||||
|
||||
|
||||
if ($securelogin == "yes")
|
||||
{
|
||||
$securelogin_indentity_cookie = true;
|
||||
$passh = md5($row["passhash"].$_SERVER["REMOTE_ADDR"]);
|
||||
}
|
||||
else // when it's op, default is not use secure login
|
||||
{
|
||||
$securelogin_indentity_cookie = false;
|
||||
$passh = md5($row["passhash"]);
|
||||
}
|
||||
logincookie($id, $passh,1,get_setting('system.cookie_valid_days', 365) * 86400,$securelogin_indentity_cookie);
|
||||
//if ($securelogin == "yes")
|
||||
//{
|
||||
// $securelogin_indentity_cookie = true;
|
||||
// $passh = md5($row["passhash"].$_SERVER["REMOTE_ADDR"]);
|
||||
//}
|
||||
//else // when it's op, default is not use secure login
|
||||
//{
|
||||
// $securelogin_indentity_cookie = false;
|
||||
// $passh = md5($row["passhash"]);
|
||||
//}
|
||||
//logincookie($id, $passh,1,get_setting('system.cookie_valid_days', 365) * 86400,$securelogin_indentity_cookie);
|
||||
logincookie($id, $row["auth_key"]);
|
||||
//sessioncookie($row["id"], $passh,false);
|
||||
|
||||
header("Location: ok.php?type=confirm");
|
||||
|
||||
Reference in New Issue
Block a user