Merge pull request from GHSA-qcmg-vr56-x9wf
Fix/ghsa qcmg vr56 x9wf
This commit is contained in:
commit
e815ff0309
|
@ -89,7 +89,7 @@ class HostcontactQuery extends IdoQuery
|
||||||
[]
|
[]
|
||||||
)->join(
|
)->join(
|
||||||
['co' => $this->prefix . 'objects'],
|
['co' => $this->prefix . 'objects'],
|
||||||
'co.object_id = c.contact_object_id AND co.is_active = 1',
|
'co.object_id = c.contact_object_id AND co.is_active = 1 AND co.objecttype_id = 10',
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ class HostcontactQuery extends IdoQuery
|
||||||
[]
|
[]
|
||||||
)->joinLeft(
|
)->joinLeft(
|
||||||
['ho' => $this->prefix . 'objects'],
|
['ho' => $this->prefix . 'objects'],
|
||||||
'ho.object_id = h.host_object_id AND ho.is_active = 1',
|
'ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1193,14 +1193,31 @@ abstract class IdoQuery extends DbQuery
|
||||||
|
|
||||||
$this->customVars[strtolower($customvar)] = $alias;
|
$this->customVars[strtolower($customvar)] = $alias;
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
if ($type === 'host') {
|
||||||
$leftcol = 's.' . $type . '_object_id';
|
if (
|
||||||
} elseif ($type === 'service') {
|
$this instanceof ServicecommentQuery
|
||||||
$this->requireVirtualTable('services');
|
|| $this instanceof ServicedowntimeQuery
|
||||||
$leftcol = 's.service_object_id';
|
|| $this instanceof ServicecommenthistoryQuery
|
||||||
} else {
|
|| $this instanceof ServicedowntimestarthistoryQuery
|
||||||
$this->requireVirtualTable('hosts');
|
|| $this instanceof ServiceflappingstarthistoryQuery
|
||||||
$leftcol = 'h.host_object_id';
|
|| $this instanceof ServicegroupQuery
|
||||||
|
|| $this instanceof ServicenotificationQuery
|
||||||
|
|| $this instanceof ServicestatehistoryQuery
|
||||||
|
|| $this instanceof ServicestatusQuery
|
||||||
|
) {
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
$leftcol = 's.host_object_id';
|
||||||
|
} else {
|
||||||
|
$leftcol = 'ho.object_id';
|
||||||
|
if (! $this->hasJoinedTable('ho')) {
|
||||||
|
$this->requireVirtualTable('hosts');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // $type === 'service'
|
||||||
|
$leftcol = 'so.object_id';
|
||||||
|
if (! $this->hasJoinedTable('so')) {
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapped = $this->getMappedField($leftcol);
|
$mapped = $this->getMappedField($leftcol);
|
||||||
|
|
|
@ -89,7 +89,7 @@ class ServicecontactQuery extends IdoQuery
|
||||||
[]
|
[]
|
||||||
)->join(
|
)->join(
|
||||||
['co' => $this->prefix . 'objects'],
|
['co' => $this->prefix . 'objects'],
|
||||||
'co.object_id = c.contact_object_id AND co.is_active = 1',
|
'co.object_id = c.contact_object_id AND co.is_active = 1 AND co.objecttype_id = 10',
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ class ServicecontactQuery extends IdoQuery
|
||||||
[]
|
[]
|
||||||
)->joinLeft(
|
)->joinLeft(
|
||||||
['ho' => $this->prefix . 'objects'],
|
['ho' => $this->prefix . 'objects'],
|
||||||
'ho.object_id = h.host_object_id AND ho.is_active = 1',
|
'ho.object_id = h.host_object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue