From 786428a5f2636c189e97111f7b706a5e0e4b6f30 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Wed, 19 Feb 2014 22:15:19 +0100 Subject: Changed database schema again. --- www/login.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'www/login.php') diff --git a/www/login.php b/www/login.php index e9c7c93..ed73bdc 100644 --- a/www/login.php +++ b/www/login.php @@ -37,10 +37,20 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { /*___Login___*/ if ($real_password == $hash_password) { + if($db->exec(" + BEGIN TRANSACTION; + INSERT INTO log (id, user, login) VALUES (NULL, (SELECT id FROM user WHERE name='$username'), (SELECT datetime()) ); + COMMIT; + ")){ + $_SESSION["login"] = true; $_SESSION["username"] = "$unsafe_username"; header("Refresh: 0; /"); + + } else { + header("Refresh: 0; login?reason=database"); + } } else { header("Refresh: 0; login?reason=failure"); } -- cgit v1.2.3