added session variables

master
BodgeMaster 2020-02-20 22:01:47 +01:00
parent 16e1fd7b5d
commit 9dff324911
1 changed files with 2 additions and 1 deletions

View File

@ -13,7 +13,8 @@ if ($statement->rowCount() > 0) {
//chechk for correct password //chechk for correct password
if ($dbentry['authentication_string'] == hash($dbentry['authentication_algorithm'], $password . $dbentry['authentication_salt'])) { if ($dbentry['authentication_string'] == hash($dbentry['authentication_algorithm'], $password . $dbentry['authentication_salt'])) {
//password correct //password correct
echo 1; $_SESSION['user_id'] = $dbentry['id'];
$_SESSION['user_ip'] = $_SERVER['REMOTE_ADDR']; //ip will be used to prevent session stealing
} else { } else {
//password inorrect //password inorrect
header("Location: https://lostcave.ddnss.de/common/threadr/login?error=credentials"); header("Location: https://lostcave.ddnss.de/common/threadr/login?error=credentials");