Skip to content

Commit

Permalink
Upd. Processing the get parameter (#26)
Browse files Browse the repository at this point in the history
* Upd. Processing the get parameter

* Fix. The exact value of first_load
  • Loading branch information
AntonV1211 authored May 8, 2024
1 parent f457034 commit 5e0dc2f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions uniforce/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,32 @@

require_once 'inc' . DIRECTORY_SEPARATOR . 'actions.php'; // Actions

$first_load = 0;
foreach ($_GET as $key => $value) {
if ($key == 'first_load') {
if ((int)$value !== 1) {
$first_load = 0;
} else {
$first_load = 1;
}
}
}

// 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',
Expand Down

0 comments on commit 5e0dc2f

Please sign in to comment.