diff --git a/class/api.authFunction.php b/class/api.authFunction.php index 65e52e2..4848e63 100644 --- a/class/api.authFunction.php +++ b/class/api.authFunction.php @@ -8,6 +8,10 @@ $c_Del->deleteRecord($conn, "UPDATE users SET duration = 0 WHERE duration < 0 OR status='delete'"); $c_Del->deleteRecord($conn, "DELETE FROM 2authfactor WHERE status='inactive'"); +$c_Del->deleteRecord($conn, "DELETE FROM 2authfactorlogs WHERE status='inactive'"); + $c_Del->deleteRecord($conn, "UPDATE 2authfactor SET duration = duration - 300 WHERE duration > 0 AND status='active'"); $c_Del->deleteRecord($conn, "UPDATE 2authfactor SET duration = 0, status='inactive' WHERE duration <= 0"); -$c_Del->deleteRecord($conn, "DELETE FROM 2authfactorlogs WHERE status='inactive'"); \ No newline at end of file + +$c_Del->deleteRecord($conn, "UPDATE 2authfactorlogs SET duration = duration - 300 WHERE duration > 0 AND (status='active' OR status='inactive')"); +$c_Del->deleteRecord($conn, "UPDATE 2authfactorlogs SET duration = 0, status='inactive' WHERE duration <= 0"); \ No newline at end of file diff --git a/controller/AuthController.php b/controller/AuthController.php index 7d237ea..8bff096 100644 --- a/controller/AuthController.php +++ b/controller/AuthController.php @@ -44,8 +44,8 @@ function insert_2authfactorlogs($conn,$username, $hash) $dttime = $now->format('Y-m-d H:i:s'); $id = round($dt).round($dt1).round($dt2).round(microtime(true)); - $sql = "INSERT INTO 2authfactorlogs (2authID, username, status, dt, hash) - VALUES ('$id', '$username', 'active', '$dttime', $hash)"; + $sql = "INSERT INTO 2authfactorlogs (2authID, username, status, dt, hash, try, duration) + VALUES ('$id', '$username', 'active', '$dttime', '$hash', 5, 900)"; $conn->exec($sql); return "success"; } diff --git a/validate.php b/validate.php index b162888..44f647f 100644 --- a/validate.php +++ b/validate.php @@ -7,7 +7,9 @@ require 'controller/SelectController.php'; // Select Controller require 'controller/FuncController.php'; // Function Controller require 'controller/EmailController.php'; // Function Controller +require 'controller/DeleteController.php'; // Function Controller +$c_Del = new Delete_Controller(); // Delete controller declarati0n $c_con = new ClassConnection(); // connection declaration $c_InsertControl = new Insert_Controller(); // Insertion controller declaration $c_Auth = new Auth_Controller(); // Auth controller Decleration diff --git a/view/auth/2authfactor.front.php b/view/auth/2authfactor.front.php index 1cf828f..85305fe 100644 --- a/view/auth/2authfactor.front.php +++ b/view/auth/2authfactor.front.php @@ -1,9 +1,15 @@
Two Factor Authentication
Check email for the Verification Code
@@ -21,6 +27,21 @@@@ -32,4 +53,28 @@