Skip to content

Commit

Permalink
Update code to fix code climate issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sae126V committed Nov 13, 2024
1 parent d76dcf0 commit 3a2767d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
38 changes: 19 additions & 19 deletions htdocs/landing/index.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
<?php
if(session_start() === PHP_SESSION_NONE) {
session_start();
}
if (session_start() === PHP_SESSION_NONE) {
session_start();
}

// Check if SSL client verification is successful
$sslClientVerify = isset($_SERVER['SSL_CLIENT_VERIFY'])
? $_SERVER['SSL_CLIENT_VERIFY']
: 'NONE';
// Check if SSL client verification is successful
$sslClientVerify = isset($_SERVER['SSL_CLIENT_VERIFY'])
? $_SERVER['SSL_CLIENT_VERIFY']
: 'NONE';

$pathName = isset($_SERVER['REQUEST_URI'])
? $_SERVER['REQUEST_URI']
: '/';
$pathName = isset($_SERVER['REQUEST_URI'])
? $_SERVER['REQUEST_URI']
: '/';

if (
if (
$sslClientVerify === 'SUCCESS'
&& empty($_SESSION['SSL-Retry_login'])
&& $pathName === "/"
) {
// Redirect the user to the /portal from the root URL.
header("Location: /portal");
die();
}
) {
// Redirect the user to the /portal from the root URL.
header("Location: /portal");
die();
}

require_once __DIR__.'/../../lib/Gocdb_Services/Factory.php';
$configServ = \Factory::getConfigService();
$configServ->setLocalInfoOverride($_SERVER['SERVER_NAME']);
require_once __DIR__.'/../../lib/Gocdb_Services/Factory.php';
$configServ = \Factory::getConfigService();
$configServ->setLocalInfoOverride($_SERVER['SERVER_NAME']);
?>
<!doctype html>
<html lang="en">
Expand Down
4 changes: 2 additions & 2 deletions htdocs/web_portal/components/Get_User_Principle.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function Get_User_Principle(){
}
}

if(session_start() === PHP_SESSION_NONE) {
if (session_start() === PHP_SESSION_NONE) {
session_start();
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/Gocdb_Services/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3a2767d

Please sign in to comment.