N°8796 - Add PHP code style validation in iTop and extensions - format whole code base

This commit is contained in:
odain
2025-11-07 15:39:53 +01:00
parent 12f23113f5
commit 890a2568c8
2110 changed files with 53099 additions and 63885 deletions

View File

@@ -1,4 +1,5 @@
<?php
/**
* Copyright (C) 2013-2024 Combodo SAS
*
@@ -33,8 +34,7 @@ require_once(APPROOT.'/application/loginwebpage.class.inc.php');
$bPortal = utils::ReadParam('portal', false);
$sUrl = utils::GetAbsoluteUrlAppRoot();
if ($operation == 'do_logoff')
{
if ($operation == 'do_logoff') {
// Reload the same dummy page to let the "calling" page execute its 'onunload' method before performing the actual logoff.
// Note the redirection MUST NOT be made via an HTTP "header" since onunload is called only when the actual content of the DOM
// is replaced by some other content. So the "bouncing" page must provide some content (in our case a script making the redirection).
@@ -44,8 +44,7 @@ if ($operation == 'do_logoff')
exit;
}
if (Session::IsSet('auth_user'))
{
if (Session::IsSet('auth_user')) {
$sAuthUser = Session::Get('auth_user');
UserRights::Login($sAuthUser); // Set the user's language
}
@@ -53,15 +52,11 @@ if (Session::IsSet('auth_user'))
LoginWebPage::ResetSession();
$bLoginDebug = MetaModel::GetConfig()->Get('login_debug');
if ($bLoginDebug)
{
if ($bLoginDebug) {
IssueLog::Info("---------------------------------");
if (isset($sAuthUser))
{
if (isset($sAuthUser)) {
IssueLog::Info("--> Logout user: [$sAuthUser]");
}
else
{
} else {
IssueLog::Info("--> Logout");
}
$sSessionLog = session_id().' '.utils::GetSessionLog();
@@ -71,13 +66,10 @@ if ($bLoginDebug)
$aPluginList = LoginWebPage::GetLoginPluginList('iLogoutExtension');
/** @var iLogoutExtension $oLogoutExtension */
foreach ($aPluginList as $oLogoutExtension)
{
if ($bLoginDebug)
{
foreach ($aPluginList as $oLogoutExtension) {
if ($bLoginDebug) {
$sCurrSessionLog = session_id().' '.utils::GetSessionLog();
if ($sCurrSessionLog != $sSessionLog)
{
if ($sCurrSessionLog != $sSessionLog) {
$sSessionLog = $sCurrSessionLog;
IssueLog::Info("SESSION: $sSessionLog");
}
@@ -87,11 +79,9 @@ foreach ($aPluginList as $oLogoutExtension)
$oLogoutExtension->LogoutAction();
}
if ($bLoginDebug)
{
if ($bLoginDebug) {
$sCurrSessionLog = session_id().' '.utils::GetSessionLog();
if ($sCurrSessionLog != $sSessionLog)
{
if ($sCurrSessionLog != $sSessionLog) {
$sSessionLog = $sCurrSessionLog;
IssueLog::Info("SESSION: $sSessionLog");
}
@@ -100,8 +90,8 @@ if ($bLoginDebug)
LoginWebPage::ResetSession(true);
if ($bLoginDebug) {
$sSessionLog = session_id().' '.utils::GetSessionLog();
IssueLog::Info("SESSION: $sSessionLog");
$sSessionLog = session_id().' '.utils::GetSessionLog();
IssueLog::Info("SESSION: $sSessionLog");
}
$oPage = LoginWebPage::NewLoginWebPage();