Skip to content

Commit

Permalink
Merge pull request #17 from centreon/master
Browse files Browse the repository at this point in the history
Master
  • Loading branch information
Jean-Baptiste authored Jan 22, 2018
2 parents 3746830 + 116cc48 commit d9504a4
Show file tree
Hide file tree
Showing 30 changed files with 834 additions and 511 deletions.
4 changes: 2 additions & 2 deletions doc/en/life_cycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Centreon EMS
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon BAM | 3.5.0 | 18/12/2016 | N/C | SUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon BAM | 3.4.0 | 06/04/2016 | 18/12/2017 | END OF LIFE |
| Centreon BAM | 3.4.0 | 06/04/2016 | 18/12/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon BAM | 3.3.0 | 16/12/2015 | 06/04/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
Expand All @@ -126,7 +126,7 @@ Centreon EMS
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon MBI | 3.1.x | 18/12/2016 | N/C | SUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon MBI | 3.0.x | 26/05/2016 | 18/12/2017 | END OF LIFE |
| Centreon MBI | 3.0.x | 26/05/2016 | 18/12/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon MBI | 2.3.0 | 16/12/2015 | 26/05/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
Expand Down
4 changes: 2 additions & 2 deletions doc/fr/lifecycle.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Centreon EMS
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon BAM | 3.5.0 | 18/12/2016 | N/C | SUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon BAM | 3.4.0 | 06/04/2016 | 18/12/2017 | END OF LIFE |
| Centreon BAM | 3.4.0 | 06/04/2016 | 18/12/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon BAM | 3.3.0 | 16/12/2015 | 06/04/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
Expand All @@ -127,7 +127,7 @@ Centreon EMS
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon MBI | 3.1.x | 18/12/2016 | N/C | SUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon MBI | 3.0.x | 26/05/2016 | 18/12/2017 | END OF LIFE |
| Centreon MBI | 3.0.x | 26/05/2016 | 18/12/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
| Centreon MBI | 2.3.0 | 16/12/2015 | 26/05/2017 | UNSUPPORTED |
+------------------------------------------------------+-------------------------+-------------------+------------------+-----------------------------------------+
Expand Down
34 changes: 19 additions & 15 deletions www/class/centreonLogAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function insertLog($object_type, $object_id, $object_name, $action_type,
if (($auditLog) && ($auditLog['audit_log_option'] == '1')) {
$str_query = "INSERT INTO `log_action`
(action_log_date, object_type, object_id, object_name, action_type, log_contact_id)
VALUES ('".time()."', '" . CentreonDB::escape($object_type) . "', '" .
VALUES ('" . time() . "', '" . CentreonDB::escape($object_type) . "', '" .
CentreonDB::escape($object_id) . "', '" . CentreonDB::escape($object_name) . "', '" .
CentreonDB::escape($action_type) . "', '" . CentreonDB::escape($this->logUser->user_id) . "')";
CentreonDB::escape($action_type) . "', '" . CentreonDB::escape($this->logUser->user_id) . "')";
$pearDBO->query($str_query);

$DBRESULT2 = $pearDBO->query("SELECT MAX(action_log_id) FROM `log_action`");
Expand Down Expand Up @@ -161,7 +161,7 @@ public function listAction($id, $object_type)
public function getHostId($service_id)
{
global $pearDBO;

/* Get Hosts */
$query = "SELECT a.action_log_id, field_value
FROM log_action a, log_action_modification m
Expand Down Expand Up @@ -199,8 +199,8 @@ public function getHostId($service_id)
public function getHostName($host_id)
{
global $pearDB, $pearDBO;
$query = "SELECT host_name FROM host WHERE host_register = '1' AND host_id = ".$host_id;

$query = "SELECT host_name FROM host WHERE host_register = '1' AND host_id = " . $host_id;
$DBRESULT2 = $pearDB->query($query);
$info = $DBRESULT2->fetchRow();
if (isset($info['host_name'])) {
Expand All @@ -219,8 +219,8 @@ public function getHostName($host_id)
public function getHostGroupName($hg_id)
{
global $pearDB, $pearDBO;
$query = "SELECT hg_name FROM hostgroup WHERE hg_id = ".$hg_id;

$query = "SELECT hg_name FROM hostgroup WHERE hg_id = " . $hg_id;
$DBRESULT2 = $pearDB->query($query);
$info = $DBRESULT2->fetchRow();
if (isset($info['hg_name'])) {
Expand All @@ -246,13 +246,11 @@ public function listModification($id, $object_type)
$ref = array();
$i = 0;

$DBRESULT = $pearDBO->query(
"SELECT action_log_id, action_log_date, action_type
FROM log_action
WHERE object_id = '" . CentreonDB::escape($id) . "'
AND object_type = '" . CentreonDB::escape($object_type) . "' ORDER BY action_log_date ASC"
);
while ($row = $DBRESULT->fetchRow()) {
$query = "SELECT action_log_id, action_log_date, action_type FROM log_action" .
" WHERE object_id = '" . CentreonDB::escape($id) . "'" .
" AND object_type = '" . CentreonDB::escape($object_type) . "' ORDER BY action_log_date ASC";
$dbResult = $pearDBO->query($query);
while ($row = $dbResult->fetchRow()) {
$DBRESULT2 = $pearDBO->query(
"SELECT action_log_id,field_name,field_value
FROM `log_action_modification`
Expand Down Expand Up @@ -314,7 +312,7 @@ public function listObjecttype()
$object_type_tab[6] = "hostgroup";
$object_type_tab[7] = "service";
$object_type_tab[8] = "servicegroup";
$object_type_tab[9] = "snmp traps";
$object_type_tab[9] = "traps";
$object_type_tab[10] = "escalation";
$object_type_tab[11] = "host dependency";
$object_type_tab[12] = "hostgroup dependency";
Expand All @@ -325,6 +323,12 @@ public function listObjecttype()
$object_type_tab[17] = "broker";
$object_type_tab[18] = "resources";
$object_type_tab[19] = "meta";
$object_type_tab[20] = "access group";
$object_type_tab[21] = "menu access";
$object_type_tab[22] = "resource access";
$object_type_tab[23] = "action access";
$object_type_tab[24] = "manufacturer";
$object_type_tab[25] = "hostcategories";

return $object_type_tab;
}
Expand Down
11 changes: 6 additions & 5 deletions www/class/centreonMeta.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,16 @@ public function insertVirtualService($metaId, $metaName)

$composedName = 'meta_' . $metaId;

$queryService = 'SELECT service_id '
. 'FROM service '
. 'WHERE service_register = "2" '
. 'AND service_description = "' . $composedName . '" '
. 'AND display_name = "' . $metaName . '" ';
$queryService = 'SELECT service_id, display_name FROM service ' .
'WHERE service_register = "2" AND service_description = "' . $composedName . '" ';
$res = $this->db->query($queryService);
if ($res->rowCount()) {
$row = $res->fetchRow();
$serviceId = $row['service_id'];
if ($row['display_name'] !== $metaName) {
$query = 'UPDATE service SET display_name = "' . $metaName . '" WHERE service_id = ' . $serviceId;
$this->db->query($query);
}
} else {
$query = 'INSERT INTO service (service_description, display_name, service_register) '
. 'VALUES '
Expand Down
1 change: 1 addition & 0 deletions www/include/Administration/configChangelog/viewLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ function searchUserName($user_name)

$objects_type_tab = array();
$objects_type_tab = $centreon->CentreonLogAction->listObjecttype();
sort($objects_type_tab);
$options = "";
foreach ($objects_type_tab as $key => $name) {
$name = _("$name");
Expand Down
22 changes: 10 additions & 12 deletions www/include/core/footer/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ function myToggleAll(duration, toggle) {
document.mozFullScreenElement ||
document.msFullscreenElement
) {
jQuery("#actionBar, .pathWayBracket, .imgPathWay, .pathWay, hr, #QuickSearch, #menu1_bgcolor, ".
"#footer, #menu_1, #Tmenu , #menu_2, #menu_3, #header, .toHideInFullscreen"
).
removeClass('tohide');
jQuery(
"#actionBar, .pathWayBracket, .imgPathWay, .pathWay, hr, #QuickSearch, #menu1_bgcolor, " +
"#footer, #menu_1, #Tmenu , #menu_2, #menu_3, #header, .toHideInFullscreen"
).removeClass('tohide');
jQuery("#fullscreenIcon").attr("src", "./img/icons/fullscreen.png");
jQuery('#contener').css({
'height': 'calc(100% - 170px)'
Expand All @@ -118,10 +118,9 @@ function myToggleAll(duration, toggle) {
}
} else {
jQuery(
"#actionBar, .pathWayBracket, .imgPathWay, .pathWay, hr, #QuickSearch, #menu1_bgcolor,".
" #footer, #menu_1, #Tmenu , #menu_2, #menu_3, #header, .toHideInFullscreen"
).
addClass('tohide');
"#actionBar, .pathWayBracket, .imgPathWay, .pathWay, hr, #QuickSearch, #menu1_bgcolor," +
" #footer, #menu_1, #Tmenu , #menu_2, #menu_3, #header, .toHideInFullscreen"
).addClass('tohide');
jQuery("#fullscreenIcon").attr("src", "./img/icons/fullscreen_off.png");
jQuery('#contener').css({
'height': '100%'
Expand Down Expand Up @@ -157,10 +156,9 @@ function exitHandler() {
if (event === 'FullscreenOff') {
jQuery("#fullscreenIcon").attr("src", "./img/icons/fullscreen.png");
jQuery(
"#actionBar, .pathWayBracket, .imgPathWay, .pathWay, hr, #QuickSearch, #menu1_bgcolor, ".
"#footer, #menu_1, #Tmenu , #menu_2, #menu_3, #header, .toHideInFullscreen"
).
removeClass('tohide');
"#actionBar, .pathWayBracket, .imgPathWay, .pathWay, hr, #QuickSearch, #menu1_bgcolor, " +
"#footer, #menu_1, #Tmenu , #menu_2, #menu_3, #header, .toHideInFullscreen"
).removeClass('tohide');
}
}

Expand Down
22 changes: 18 additions & 4 deletions www/include/monitoring/common-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,15 @@ function get_notified_infos_for_host($hostId)

$stack = array_merge($hostsTpl, $stack);
}
asort($results['contacts'], SORT_NATURAL | SORT_FLAG_CASE);
asort($results['contactGroups'], SORT_NATURAL | SORT_FLAG_CASE);

if (version_compare(phpversion(), '5.4.0') >= 0){
asort($results['contacts'], SORT_NATURAL | SORT_FLAG_CASE);
asort($results['contactGroups'], SORT_NATURAL | SORT_FLAG_CASE);
} else {
natcasesort($results['contacts']);
natcasesort($results['contactGroups']);
}

return $results;
}

Expand Down Expand Up @@ -228,8 +235,15 @@ function get_notified_infos_for_service($serviceId, $hostId)
(count($results['contacts']) == 0) && (count($results['contactGroups']) == 0)) {
return get_notified_infos_for_host($hostId);
}
asort($results['contacts'], SORT_NATURAL | SORT_FLAG_CASE);
asort($results['contactGroups'], SORT_NATURAL | SORT_FLAG_CASE);

if (version_compare(phpversion(), '5.4.0') >= 0){
asort($results['contacts'], SORT_NATURAL | SORT_FLAG_CASE);
asort($results['contactGroups'], SORT_NATURAL | SORT_FLAG_CASE);
} else {
natcasesort($results['contacts']);
natcasesort($results['contactGroups']);
}

return $results;
}

Expand Down
2 changes: 1 addition & 1 deletion www/include/monitoring/objectDetails/serviceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
$host_status[$host_name] = $tab_host_status[$ndo2["current_state"]];

// Get Host informations
$DBRESULT = $pearDB->query("SELECT * FROM host WHERE host_id = " . $pearDB->escape($host_id) . "");
$DBRESULT = $pearDB->query("SELECT * FROM host WHERE host_id = " . $pearDB->escape($host_id));
$host = $DBRESULT->fetchrow();
$DBRESULT->closeCursor();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@
"AND h.host_id = s.host_id " .
"AND (h.name NOT LIKE '_Module_%' OR h.name LIKE '_Module_Meta%') ";
if (!$obj->is_admin) {
$query_svc_status .= "AND s.service_id IN ( " .
"SELECT DISTINCT service_id " .
$query_svc_status .= "AND EXISTS (" .
"SELECT service_id " .
"FROM centreon_acl " .
"WHERE centreon_acl.group_id IN (" . $obj->grouplistStr . ")) ";
"WHERE centreon_acl.host_id = h.host_id " .
"AND centreon_acl.service_id = s.service_id " .
"AND centreon_acl.group_id IN (" . $obj->grouplistStr . ")" .
") ";
}
$DBRESULT = $obj->DBC->query($query_svc_status);
$svc_stat = array_map("myDecode", $DBRESULT->fetchRow());
Expand Down
Loading

0 comments on commit d9504a4

Please sign in to comment.