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 e93e2c0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 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) {
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();
}
}

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 e93e2c0

Please sign in to comment.