From 5246c47ee65e54588a9fe922c148ffe6c236eb1b Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Wed, 16 Apr 2025 13:11:51 +0300 Subject: [PATCH] Makes csrf_token a global constant and moves it to includes --- app/{templates => includes}/csrf_token.php | 0 app/templates/config.php | 2 +- app/templates/form-login.php | 2 +- app/templates/form-password-forgot.php | 2 +- app/templates/form-password-reset.php | 2 +- app/templates/form-register.php | 2 +- app/templates/profile-edit.php | 4 ++-- app/templates/security.php | 8 ++++---- public_html/index.php | 5 +++++ 9 files changed, 16 insertions(+), 11 deletions(-) rename app/{templates => includes}/csrf_token.php (100%) diff --git a/app/templates/csrf_token.php b/app/includes/csrf_token.php similarity index 100% rename from app/templates/csrf_token.php rename to app/includes/csrf_token.php diff --git a/app/templates/config.php b/app/templates/config.php index d2c5151..eda1801 100644 --- a/app/templates/config.php +++ b/app/templates/config.php @@ -37,7 +37,7 @@

Welcome to !
Please enter login credentials:

- +
Enter your email address and we will send you
instructions to reset your password.

- +

Set new password

- +

Enter credentials for registration:

- +
- +

edit the profile fields

@@ -133,7 +133,7 @@ diff --git a/app/templates/security.php b/app/templates/security.php index bd5ad0a..ba3f0e0 100644 --- a/app/templates/security.php +++ b/app/templates/security.php @@ -35,7 +35,7 @@
- +
@@ -77,7 +77,7 @@ - + @@ -104,7 +104,7 @@
- +
@@ -151,7 +151,7 @@ - + diff --git a/public_html/index.php b/public_html/index.php index 0c5ce77..a94a258 100644 --- a/public_html/index.php +++ b/public_html/index.php @@ -11,6 +11,11 @@ * Version: 0.4 */ +// Define CSRF token include path globally +if (!defined('CSRF_TOKEN_INCLUDE')) { + define('CSRF_TOKEN_INCLUDE', dirname(__DIR__) . '/app/includes/csrf_token.php'); +} + // we start output buffering and // flush it later only when there is no redirect ob_start();