From 5eb5b09badb5043fd849e42447c33f55e1c71b7e Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Wed, 5 Oct 2011 16:18:15 +0000 Subject: [PATCH] fix renamehost 'n' shizzle? git-svn-id: http://www.observium.org/svn/observer/trunk@2652 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/common.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/common.php b/includes/common.php index 60b8ef292..7f6fcee7b 100644 --- a/includes/common.php +++ b/includes/common.php @@ -300,7 +300,15 @@ function getidbyname($hostname) { global $cache; - return $cache['devices']['hostname'][$hostname]; + if ($cache['devices']['hostname'][$hostname]) + { + $id = $cache['devices']['hostname'][$hostname]; + } else + { + $id = dbFetchCell("SELECT `device_id` FROM `devices` WHERE `hostname` = ?", array($domain)); + } + + return $id; } function gethostosbyid($id)