mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
only print interface/device links if the user is allowed to see that device/interface. (TODO: graph security)
git-svn-id: http://www.observium.org/svn/observer/trunk@1060 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+12
-1
@@ -284,7 +284,11 @@ function generateiflink($interface, $text=0, $type = NULL)
|
||||
if ($interface['ifAlias']) { $contents .= htmlentities($interface['ifAlias'] ."<br />" ); }
|
||||
$contents .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_month\'>";
|
||||
$link = overlib_link($url, $text, $contents, $class);
|
||||
return $link;
|
||||
if(interfacepermitted($interface['interface_id'])) {
|
||||
return $link;
|
||||
} else {
|
||||
return fixifName($interface['label']);
|
||||
}
|
||||
}
|
||||
|
||||
function overlib_link($url, $text, $contents, $class) {
|
||||
@@ -312,6 +316,13 @@ function generatedevicelink($device, $text=0, $start=0, $end=0)
|
||||
$contents .= "<img src=\'$graph_url\'><br /><img src=\'$graph_url_b\'";
|
||||
$text = htmlentities($text);
|
||||
$link = overlib_link($url, $text, $contents, $class);
|
||||
if(devicepermitted($device['device_id'])) {
|
||||
return $link;
|
||||
} else {
|
||||
return $device['hostname'];
|
||||
}
|
||||
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user