Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(secu): the ini_set session duration param has been moved in php.i…
Browse files Browse the repository at this point in the history
…ni (#7896)
  • Loading branch information
sc979 committed Oct 2, 2019
1 parent c6f8309 commit 33e3136
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 3 additions & 5 deletions www/api/internal.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@
ini_set('display_errors', 0);

$pearDB = new CentreonDB();
ini_set("session.gc_maxlifetime", "31536000");

CentreonSession::start(1);

if (false === isset($_SESSION["centreon"])) {
if (!isset($_SESSION["centreon"])) {
CentreonWebService::sendResult("Unauthorized", 401);
}

Expand All @@ -58,11 +57,10 @@
* Define Centreon var alias
*/
if (isset($_SESSION["centreon"])) {
$centreon = $_SESSION["centreon"];
$oreon = $centreon;
$oreon = $centreon = $_SESSION["centreon"];
}

if (false === isset($centreon) || false === is_object($centreon)) {
if (!isset($centreon) || !is_object($centreon)) {
CentreonWebService::sendResult("Unauthorized", 401);
}

Expand Down
7 changes: 2 additions & 5 deletions www/include/core/header/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ function microtime_float()

$centreonSession = new CentreonSession();

ini_set("session.gc_maxlifetime", "31536000");

CentreonSession::start();

/*
Expand Down Expand Up @@ -136,15 +134,14 @@ function microtime_float()
* Define Oreon var alias
*/
if (isset($_SESSION["centreon"])) {
$centreon = $_SESSION["centreon"];
$oreon = $centreon;
$oreon = $centreon = $_SESSION["centreon"];
}
if (!isset($centreon) || !is_object($centreon)) {
exit();
}

/*
* Init differents elements we need in a lot of pages
* Init different elements we need in a lot of pages
*/
unset($centreon->Nagioscfg);
$centreon->initNagiosCFG($pearDB);
Expand Down

0 comments on commit 33e3136

Please sign in to comment.