From e6f9dea9a5a3c450847cdf1a11f77633fca09e43 Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sun, 16 Mar 2014 20:56:12 +0100 Subject: Added database query for login purposes. --- www/functions/func_register.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'www/functions/func_register.php') diff --git a/www/functions/func_register.php b/www/functions/func_register.php index e7c5536..b089e24 100755 --- a/www/functions/func_register.php +++ b/www/functions/func_register.php @@ -48,7 +48,7 @@ function register($db){ $id_ar = $id_db->fetchArray(SQLITE3_NUM); $id = $id_ar[0]; - /*Generates the encrypted password and the database transactions*/ + /*Generates the encrypted password and the database transaction*/ $pepper = file_get_contents("../database/pepper.txt"); $password = $cleartext_password . $pepper; @@ -59,6 +59,7 @@ function register($db){ BEGIN TRANSACTION; UPDATE user SET name='" . $safe_name . "', password='" . $hash_password . "', invites=5, status=1, register=(SELECT datetime()) WHERE id=" . $id . "; INSERT INTO files (id, parent, owner, name, folder, mime, size, share, size, hash) VALUES (NULL, 0, $id, '/', 'DIRECTORY', NULL, NULL, 'PUBLIC', 0, ''); + INSERT INTO log (id, user, login) VALUES (NULL, (SELECT id FROM user WHERE name='" . $safe_name"'), (SELECT datetime())); COMMIT;") ){ -- cgit v1.2.3