function ensure_active_session() { if (is_password_protection_enabled()) { if (isset($_SESSION['session_start'])) { if (!is_active_session()) { $_SESSION['session_expired'] = TRUE; header('Location:lockscreen.php'); } } else { header('Location:lockscreen.php'); } } }
if (!is_password_protection_enabled()) { header('Location:index.php'); } if (count($_POST) > 0) { if (isset($_POST['password'])) { $hash = hash('sha512', $_POST['password']); $password_hash = load_password_hash(); if ($hash == $password_hash) { $_SESSION['session_start'] = time(); } else { $invalid_password = true; } } } if (isset($_SESSION['session_start'])) { if (is_active_session()) { header('Location:index.php'); } } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>NoTrack Lockscreen</title> <!-- Tell the browser to be responsive to screen width --> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <!-- Bootstrap 3.3.6 -->