Skip to content

Check server configuration in legacy front files #19520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 42 additions & 0 deletions front/_check_webserver_config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* ---------------------------------------------------------------------
*
* GLPI - Gestionnaire Libre de Parc Informatique
*
* http://glpi-project.org
*
* @copyright 2015-2025 Teclib' and contributors.
* @copyright 2003-2014 by the INDEPNET Development Team.
* @licence https://www.gnu.org/licenses/gpl-3.0.html
*
* ---------------------------------------------------------------------
*
* LICENSE
*
* This file is part of GLPI.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ---------------------------------------------------------------------
*/

if (!class_exists('Glpi\\Kernel\\Kernel', autoload: false)) {
// `Glpi\Kernel\Kernel` class will exists if the request was processed by the `/public/index.php` file,
// and will not be found otherwise.
http_response_code(404);
readfile(__DIR__ . '/../index.html');
exit();
}
2 changes: 2 additions & 0 deletions front/appliance_item.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Exception\Http\BadRequestHttpException;

Session::checkCentralAccess();
Expand Down
2 changes: 2 additions & 0 deletions front/appliance_item_relation.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Exception\Http\BadRequestHttpException;

Session::checkCentralAccess();
Expand Down
2 changes: 2 additions & 0 deletions front/asset/asset.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

/**
* @var array $CFG_GLPI
*/
Expand Down
2 changes: 2 additions & 0 deletions front/asset/asset_peripheralasset.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

use Glpi\Asset\Asset_PeripheralAsset;
use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;
Expand Down
2 changes: 2 additions & 0 deletions front/asset/assetdefinition.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

/**
* @var array $CFG_GLPI
*/
Expand Down
2 changes: 2 additions & 0 deletions front/asset/customfielddefinition.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

use Glpi\Asset\CustomFieldDefinition;

$custom_field = new CustomFieldDefinition();
Expand Down
2 changes: 2 additions & 0 deletions front/asset/ruledictionarymodel.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

use Glpi\Asset\AssetDefinition;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/asset/ruledictionarymodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

use Glpi\Asset\AssetDefinition;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/asset/ruledictionarytype.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

use Glpi\Asset\AssetDefinition;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/asset/ruledictionarytype.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/../_check_webserver_config.php');

use Glpi\Asset\AssetDefinition;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/auth.others.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

/** @var array $CFG_GLPI */
global $CFG_GLPI;

Expand Down
2 changes: 2 additions & 0 deletions front/auth.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

Session::checkRight("config", UPDATE);

$config = new Config();
Expand Down
2 changes: 2 additions & 0 deletions front/authldap.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

/** @var array $CFG_GLPI */
global $CFG_GLPI;

Expand Down
2 changes: 2 additions & 0 deletions front/calendar_holiday.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/calendarsegment.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/cartridge.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;

Session::checkRightsOr(Cartridge::$rightname, [READ, READ_ASSIGNED]);
Expand Down
2 changes: 2 additions & 0 deletions front/cartridgeitem_printermodel.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/certificate_item.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/change.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;

if (empty($_GET["id"])) {
Expand Down
2 changes: 2 additions & 0 deletions front/change_group.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/change_item.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

$obj = new Change();
$item_obj = new Change_Item();
include(GLPI_ROOT . '/front/commonitilobject_item.form.php');
2 changes: 2 additions & 0 deletions front/change_problem.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/change_supplier.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/change_ticket.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/change_user.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/changecost.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

/**
* @since 0.85
*/
Expand Down
2 changes: 2 additions & 0 deletions front/changesatisfaction.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/changetask.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

$task = new ChangeTask();

include(GLPI_ROOT . "/front/commonitiltask.form.php");
2 changes: 2 additions & 0 deletions front/changetemplatehiddenfield.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

$itiltype = 'Change';
$fieldtype = 'Hidden';
include __DIR__ . '/itiltemplatefield.form.php';
2 changes: 2 additions & 0 deletions front/changetemplatemandatoryfield.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

$itiltype = 'Change';
$fieldtype = 'Mandatory';
include __DIR__ . '/itiltemplatefield.form.php';
2 changes: 2 additions & 0 deletions front/changetemplatepredefinedfield.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

$itiltype = 'Change';
$fieldtype = 'Predefined';
include __DIR__ . '/itiltemplatefield.form.php';
2 changes: 2 additions & 0 deletions front/changetemplatereadonlyfield.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

$itiltype = 'Change';
$fieldtype = 'Readonly';
include __DIR__ . '/itiltemplatefield.form.php';
2 changes: 2 additions & 0 deletions front/changevalidation.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

/**
* @since 0.85
*/
Expand Down
2 changes: 2 additions & 0 deletions front/commonitilcost.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\AccessDeniedHttpException;
use Glpi\Exception\Http\BadRequestHttpException;
Expand Down
2 changes: 2 additions & 0 deletions front/commonitilobject_commonitilobject.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/commonitilobject_item.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\BadRequestHttpException;

Expand Down
2 changes: 2 additions & 0 deletions front/commonitiltask.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\AccessDeniedHttpException;
use Glpi\Exception\Http\BadRequestHttpException;
Expand Down
2 changes: 2 additions & 0 deletions front/commonitilvalidation.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Event;
use Glpi\Exception\Http\AccessDeniedHttpException;
use Glpi\Exception\Http\BadRequestHttpException;
Expand Down
2 changes: 2 additions & 0 deletions front/config.form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* ---------------------------------------------------------------------
*/

require_once(__DIR__ . '/_check_webserver_config.php');

use Glpi\Cache\CacheManager;

Session::checkRight("config", READ);
Expand Down
Loading