add page to remove deleted ports (pour mon petit grenouille!)

nn
  _.__-'@_ \/  _@'-__._
 /     '--)   (--`     \
/  >__<<_/  o  \_>>__<  \
 \\=x  \=x \|/ x=/  x=//



git-svn-id: http://www.observium.org/svn/observer/trunk@1074 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-04-24 22:43:25 +00:00
parent 464f495e29
commit fc0050d83c
8 changed files with 253 additions and 185 deletions

View File

@ -13,6 +13,37 @@ function permissions_cache($user_id) {
return $permissions;
}
function interfacepermitted($interface_id, $device_id = NULL)
{
global $_SESSION; global $permissions;
if(!$device_id) { $device_id = mysql_result(mysql_query("SELECT `device_id` from ports WHERE interface_id = '".$interface_id."'"),0); }
if ($_SESSION['userlevel'] >= "5") {
$allowed = TRUE;
} elseif ( devicepermitted($device_id)) {
$allowed = TRUE;
} elseif ( $permissions['port'][$interface_id]) {
$allowed = TRUE;
} else {
$allowed = FALSE;
}
return $allowed;
}
function devicepermitted($device_id)
{
global $_SESSION; global $permissions;
if ($_SESSION['userlevel'] >= "5") {
$allowed = true;
} elseif ( $permissions['device'][$device_id] ) {
$allowed = true;
} else {
$allowed = false;
}
return $allowed;
}
function print_graph_tag ($args)
{
echo generate_graph_tag ($args);