mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 16:08:55 +02:00
Final update for overwriting ifAlias
This commit is contained in:
+7
-2
@@ -435,8 +435,13 @@ function get_dev_entity_state($device) {
|
||||
return $state;
|
||||
}
|
||||
|
||||
function get_dev_attrib($device, $attrib_type) {
|
||||
if ($row = dbFetchRow("SELECT attrib_value FROM devices_attribs WHERE `device_id` = ? AND `attrib_type` = ?", array($device['device_id'], $attrib_type))) {
|
||||
function get_dev_attrib($device, $attrib_type, $attrib_value='') {
|
||||
$params = array($device['device_id'], $attrib_type);
|
||||
if (!empty($attrib_value)) {
|
||||
$sql = " AND `attrib_value`=?";
|
||||
array_push($params, $attrib_value);
|
||||
}
|
||||
if ($row = dbFetchRow("SELECT attrib_value FROM devices_attribs WHERE `device_id` = ? AND `attrib_type` = ? $sql", $params)) {
|
||||
return $row['attrib_value'];
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user