Private GIT

Skip to content
Snippets Groups Projects
Commit 94ee61fb authored by Laurent Pinsivy's avatar Laurent Pinsivy
Browse files

Merge branch '2.8.x' of https://github.com/centreon/centreon into 2.8.x

parents d6706418 c586a040
Branches
Tags
No related merge requests found
Showing
with 191 additions and 24 deletions
stage('Source') {
node {
sh 'cd /opt/centreon-build && git pull && cd -'
scm checkout
sh '/opt/centreon-build/jobs/web/pipeline/mon-web-source.sh'
def source = readProperties file: 'source.properties'
env.VERSION = "${source.VERSION}"
env.RELEASE = "${source.RELEASE}"
}
}
##############
Centreon 2.8.4
##############
Released February Xth, 2017.
The 2.8.4 release for Centreon Web is now available for download. Here are its release notes.
Features
--------
Bug Fixes
---------
Known bugs or issues
--------------------
* Centreon Engine performance chart still in RRDTools PNG format ;
* Zoom out on chart change period on filters ;
* User with ACL can't see it own previously created meta service ;
* Problem with recurrent downtimes and DST ;
......@@ -10,3 +10,4 @@ Please find here the release notes dedicated to the last 2.8.x version of Centre
centreon-2.8.1
centreon-2.8.2
centreon-2.8.3
centreon-2.8.4
##############
Centreon 2.8.4
##############
Released February Xth, 2017.
The 2.8.4 release for Centreon Web is now available for download. Here are its release notes.
Features
--------
Bug Fixes
---------
Known bugs or issues
--------------------
* Centreon Engine performance chart still in RRDTools PNG format ;
* Zoom out on chart change period on filters ;
* User with ACL can't see it own previously created meta service ;
* Problem with recurrent downtimes and DST ;
......@@ -10,3 +10,4 @@ Please find here the release notes dedicated to the last 2.8.x version of Centre
centreon-2.8.1
centreon-2.8.2
centreon-2.8.3
centreon-2.8.4
<?php
/*
* Copyright 2005-2017 Centreon
* Centreon is developped by : Julien Mathis and Romain Le Merlus under
* GPL Licence 2.0.
*
* 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 2 of the License.
*
* 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 <http://www.gnu.org/licenses>.
*
* Linking this program statically or dynamically with other modules is making a
* combined work based on this program. Thus, the terms and conditions of the GNU
* General Public License cover the whole combination.
*
* As a special exception, the copyright holders of this program give Centreon
* permission to link this program with independent modules to produce an executable,
* regardless of the license terms of these independent modules, and to copy and
* distribute the resulting executable under terms of Centreon choice, provided that
* Centreon also meet, for each linked independent module, the terms and conditions
* of the license of that module. An independent module is a module which is not
* derived from this program. If you modify this program, you may extend this
* exception to your version of the program, but you are not obliged to do so. If you
* do not wish to do so, delete this exception statement from your version.
*
* For more information : contact@centreon.com
*
*/
require_once _CENTREON_PATH_ . 'www/class/centreonSession.class.php';
require_once dirname(__FILE__) . "/webService.class.php";
/**
* Class CentreonKeepalive
*/
class CentreonKeepalive extends CentreonWebService
{
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Keep alive
*/
public function getKeepAlive()
{
$session = new CentreonSession();
$session->updateSession($this->pearDB);
}
}
......@@ -97,6 +97,23 @@ class CentreonSession
}
}
/**
* Update session to keep alive
*
* @param \CentreonDB $pearDB
*/
public function updateSession($pearDB)
{
session_start();
/* Update last_reload parameter */
$query = 'UPDATE `session` '
. 'SET `last_reload` = "' . time() . '", '
. '`ip_address` = "' . $_SERVER["REMOTE_ADDR"] . '" '
. 'WHERE `session_id` = "' . session_id() . '" ';
$pearDB->query($query);
}
public static function getUser($sessionId, $pearDB)
{
$sessionId = str_replace(array('_', '%'), array('', ''), $sessionId);
......
......@@ -276,19 +276,18 @@ class CentreonTimeperiod
*
* @return array
*/
public function getLinkedHostsByName($timeperiodName, $checkTemplates = true)
public function getLinkedHostsByName($timeperiodName, $register = false)
{
if ($checkTemplates) {
$register = 0;
} else {
$register = 1;
$registerClause = '';
if ($register === '0' || $register === '1') {
$registerClause = 'AND h.host_register = "' . $register . '" ';
}
$linkedCommands = array();
$linkedHosts = array();
$query = 'SELECT DISTINCT h.host_name '
. 'FROM host h, timeperiod t '
. 'WHERE h.timeperiod_tp_id = t.tp_id '
. 'AND h.host_register = "' . $register . '" '
. 'WHERE (h.timeperiod_tp_id = t.tp_id OR h.timeperiod_tp_id2 = t.tp_id) '
. $registerClause
. 'AND t.tp_name = "' . $this->db->escape($timeperiodName) . '" ';
$result = $this->db->query($query);
......@@ -298,10 +297,10 @@ class CentreonTimeperiod
}
while ($row = $result->fetchRow()) {
$linkedCommands[] = $row['host_name'];
$linkedHosts[] = $row['host_name'];
}
return $linkedCommands;
return $linkedHosts;
}
/**
......@@ -309,19 +308,18 @@ class CentreonTimeperiod
*
* @return array
*/
public function getLinkedServicesByName($timeperiodName, $checkTemplates = true)
public function getLinkedServicesByName($timeperiodName, $register = false)
{
if ($checkTemplates) {
$register = 0;
} else {
$register = 1;
$registerClause = '';
if ($register === '0' || $register === '1') {
$registerClause = 'AND s.service_register = "' . $register . '" ';
}
$linkedCommands = array();
$linkedServices = array();
$query = 'SELECT DISTINCT s.service_description '
. 'FROM service s, timeperiod t '
. 'WHERE s.timeperiod_tp_id = t.tp_id '
. 'AND s.service_register = "' . $register . '" '
. 'WHERE (s.timeperiod_tp_id = t.tp_id OR s.timeperiod_tp_id2 = t.tp_id) '
. $registerClause
. 'AND t.tp_name = "' . $this->db->escape($timeperiodName) . '" ';
$result = $this->db->query($query);
......@@ -331,9 +329,35 @@ class CentreonTimeperiod
}
while ($row = $result->fetchRow()) {
$linkedCommands[] = $row['service_description'];
$linkedServices[] = $row['service_description'];
}
return $linkedCommands;
return $linkedServices;
}
/**
* Returns array of Contacts linked to the timeperiod
*
* @return array
*/
public function getLinkedContactsByName($timeperiodName)
{
$linkedContacts = array();
$query = 'SELECT DISTINCT c.command_name '
. 'FROM command c, timeperiod t '
. 'WHERE (c.timeperiod_tp_id = t.tp_id OR c.timeperiod_tp_id2 = t.tp_id) '
. 'AND t.tp_name = "' . $this->db->escape($timeperiodName) . '" ';
$result = $this->db->query($query);
if (PEAR::isError($result)) {
throw new \Exception('Error while getting linked contacts of ' . $timeperiodName);
}
while ($row = $result->fetchRow()) {
$linkedContacts[] = $row['command_name'];
}
return $linkedContacts;
}
}
/* Refresh session every 15 seconds*/
setInterval(function(){
jQuery.ajax({
method: 'GET',
url: './api/internal.php?object=centreon_keepalive&action=keepalive'
});
},15000);
......@@ -94,6 +94,7 @@ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
<script type='text/javascript' src='./include/common/javascript/changetab.js'></script>
<?php } ?>
<script type="text/javascript" src="./class/centreonToolTip.js"></script>
<script type="text/javascript" src="./include/common/javascript/keepAlive.js"></script>
<?php
/*
......
......@@ -64,8 +64,8 @@ if ((isset($_GET["token"]) || isset($_GET["akey"])) && isset($_GET['username']))
$row = $DBRESULT->fetchRow();
$res = $pearDB->query("SELECT session_id FROM session WHERE session_id = '".$mySessionId."'");
if (!$res->numRows()) {
$DBRESULT = $pearDB->query("INSERT INTO `session` (`session_id` , `user_id` , `current_page` , `last_reload`, `ip_address`) VALUES (?, ?, '', ?, ?)");
$DBRESULT = $pearDB->execute($DBRESULT, array($mySessionId, $row["contact_id"], time(), $_SERVER["REMOTE_ADDR"], $token));
$DBRESULT = $pearDB->prepare("INSERT INTO `session` (`session_id` , `user_id` , `current_page` , `last_reload`, `ip_address`) VALUES (?, ?, '', ?, ?)");
$DBRESULT = $pearDB->execute($DBRESULT, array($mySessionId, $row["contact_id"], time(), $_SERVER["REMOTE_ADDR"]));
}
} else {
die('Invalid token');
......
......@@ -2,7 +2,7 @@
-- Insert version
--
INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '2.8.3');
INSERT INTO `informations` (`key` ,`value`) VALUES ('version', '2.8.4');
--
-- Contenu de la table `contact`
......
-- Change version of Centreon
UPDATE `informations` SET `value` = '2.8.4' WHERE CONVERT( `informations`.`key` USING utf8 ) = 'version' AND CONVERT ( `informations`.`value` USING utf8 ) = '2.8.3' LIMIT 1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment