From 831e947a8f93c4838d9f081e16cd9671de0ebeaa Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 May 2024 01:15:38 +0700 Subject: [PATCH 1/2] Upd. Processing the get parameter --- uniforce/router.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/uniforce/router.php b/uniforce/router.php index abd4e0c..6276e9c 100644 --- a/uniforce/router.php +++ b/uniforce/router.php @@ -8,21 +8,28 @@ require_once 'inc' . DIRECTORY_SEPARATOR . 'actions.php'; // Actions +$first_load = 0; +foreach ($_GET as $key => $value) { + if ($key == 'first_load') { + $first_load = (int)$value; + } +} + // URL ROUTING switch (true){ // Installation - case \Cleantalk\USP\Common\State::getInstance()->data->is_installed === false: + case \Cleantalk\USP\Common\State::getInstance()->data->is_installed === false && $first_load === 0: $page = 'install'; break; // Login - case \Cleantalk\USP\Variables\Cookie::get('authentificated') !== \Cleantalk\USP\Common\State::getInstance()->data->security_key: + case \Cleantalk\USP\Variables\Cookie::get('authentificated') !== \Cleantalk\USP\Common\State::getInstance()->data->security_key && $first_load === 0: $additional_js = array( 'ct_js_test', ); $page = 'login'; break; // Settings - case \Cleantalk\USP\Variables\Cookie::get('authentificated') === \Cleantalk\USP\Common\State::getInstance()->data->security_key: + case \Cleantalk\USP\Variables\Cookie::get('authentificated') === \Cleantalk\USP\Common\State::getInstance()->data->security_key || $first_load === 1: $additional_js = array( 'scanner-plugin', 'scanner', From a7979dc683844974a035aafd4795ff0c9f33de45 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 May 2024 01:15:18 +0700 Subject: [PATCH 2/2] Fix. The exact value of first_load --- uniforce/router.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uniforce/router.php b/uniforce/router.php index 6276e9c..c6de547 100644 --- a/uniforce/router.php +++ b/uniforce/router.php @@ -11,7 +11,11 @@ $first_load = 0; foreach ($_GET as $key => $value) { if ($key == 'first_load') { - $first_load = (int)$value; + if ((int)$value !== 1) { + $first_load = 0; + } else { + $first_load = 1; + } } }