summaryrefslogtreecommitdiff
path: root/www/login.php
diff options
context:
space:
mode:
authorHorus32014-02-19 22:15:19 +0100
committerHorus32014-02-19 22:15:19 +0100
commit786428a5f2636c189e97111f7b706a5e0e4b6f30 (patch)
treefe54e74f644d559166f3fc6c85678d178276d908 /www/login.php
parent56a9e2810315757f200b904c56694319a69fd321 (diff)
downloadfiles.iamfabulous.de-786428a5f2636c189e97111f7b706a5e0e4b6f30.tar.gz
Changed database schema again.
Diffstat (limited to 'www/login.php')
-rw-r--r--www/login.php10
1 files changed, 10 insertions, 0 deletions
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");
}