From e93e2c0987acf3f24ab0d9f40bbe9472fc83fec3 Mon Sep 17 00:00:00 2001 From: Sae126V Date: Wed, 13 Nov 2024 08:43:21 +0000 Subject: [PATCH] Update code to fix code climate issues --- htdocs/landing/index.php | 30 +++++++++---------- .../components/Get_User_Principle.php | 4 +-- lib/Gocdb_Services/Config.php | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/landing/index.php b/htdocs/landing/index.php index 4b0f334d8..b9149e4a0 100644 --- a/htdocs/landing/index.php +++ b/htdocs/landing/index.php @@ -1,30 +1,30 @@ setLocalInfoOverride($_SERVER['SERVER_NAME']); +require_once __DIR__.'/../../lib/Gocdb_Services/Factory.php'; +$configServ = \Factory::getConfigService(); +$configServ->setLocalInfoOverride($_SERVER['SERVER_NAME']); ?> diff --git a/htdocs/web_portal/components/Get_User_Principle.php b/htdocs/web_portal/components/Get_User_Principle.php index d999c7736..ba3b0c310 100644 --- a/htdocs/web_portal/components/Get_User_Principle.php +++ b/htdocs/web_portal/components/Get_User_Principle.php @@ -173,7 +173,7 @@ function Get_User_Principle(){ } } - if(session_start() === PHP_SESSION_NONE) { + if (session_start() === PHP_SESSION_NONE) { session_start(); } @@ -237,7 +237,7 @@ function redirectUserToDiscoveryPage() * @param $principleString string * * If `$needAuthTokenOnly` is set to `true` -> It returns authToken - * @param $needAuthTokenOnly bool + * @param $needAuthTokenOnly bool * * The user's principle string or * The IAuthenticationToken for the user or diff --git a/lib/Gocdb_Services/Config.php b/lib/Gocdb_Services/Config.php index 601096664..2ec13b21f 100644 --- a/lib/Gocdb_Services/Config.php +++ b/lib/Gocdb_Services/Config.php @@ -570,7 +570,7 @@ public function getEmailTo() public function isAdminAllowedToUseIGTF() { - if (strtolower( $this->GetLocalInfoXML()->igtf->admin_only) === 'true') { + if (strtolower($this->GetLocalInfoXML()->igtf->admin_only) === 'true') { return true; }