function login_init($autologouttime) { $resetLogin = FALSE; if (!isset($_SESSION["Login"])) { $resetLogin = TRUE; } else { if ($autologouttime > -1) { $timeSinceLastAction = time() - $_SESSION["Login"]["last-action"]; if ($timeSinceLastAction > $autologouttime) { $resetLogin = TRUE; } } } if ($resetLogin) { login_reset(); } $_SESSION["Login"]["last-action"] = time(); }
db_queryWith("UPDATE accounts SET balance = balance - :volume WHERE userid = :userid", array("userid" => $sourceAccount, "volume" => $volume)); db_queryWith("UPDATE accounts SET balance = balance + :volume WHERE userid = :userid", array("userid" => $targetAccount, "volume" => $volume)); header("Location: index.php?page=ehome"); } else { db_queryWith("DELETE FROM transactions WHERE tid = :tid AND isVerified = 0", array("tid" => $_POST["tid"])); header("Location: index.php?page=ehome"); } } break; case "etakeover": pb_replace_all("main", "etakeover.html"); display_userstate($_POST["userid"]); pb_replace_with("headline", ""); break; case "_logout": login_reset(); header("Location: index.php"); break; case "!dberror": pb_replace_all("main", "dberror.html"); break; case "!auth": pb_replace_all("main", "auth.html"); break; default: pb_replace_all("main", "default.html"); break; } if (login_privileges() !== 0) { pb_replace_with("logout", "<a href='?page=logout'>Logout</a>"); } else {