[-]
[+]
|
Changed |
_service:set_version:ix-inventory-system.spec
|
|
[-]
[+]
|
Changed |
ix-inventory-system.spec
^
|
|
[-]
[+]
|
Changed |
_service:recompress:tar_scm:inventory-system-0.0.4657.tar.bz2/contrib/inventory.php
^
|
@@ -33,11 +33,17 @@
$object = spotEntity ('object', $_REQUEST['object_id']);
$attrs = getAttrValues ($_REQUEST['object_id']);
$fqdn = @$attrs[3]['value'];
+ $hnarr = explode(".",$fqdn);
+ if ( $hnarr[0] == "" ) {
+ $hnarr = explode(".",$object['name']);
+ }
+ $hn = $hnarr[0];
$mdbh =& MDB2::singleton($config['inv']['db'], $config['mdb2']['options'] );
$idsql = "SELECT inv_system_id FROM inv_system_properties WHERE
(datakey='get_system_hostname' AND value = '" . $object['name'] . "') OR
(datakey='get_system_hostname' AND value = '" . $fqdn . "') OR
- (datakey='get_system_hostname' AND value = '" . $object['label'] . "' AND '" . $object['label'] . "' != '')
+ (datakey='get_system_hostname' AND value = '" . $object['label'] . "' AND '" . $object['label'] . "' != '') OR
+ (datakey='get_system_hostname' AND value = '" . $hn . "')
GROUP BY inv_system_id";
$idres = $mdbh->query($idsql);
if (PEAR::isError($idres)) {
|