当前位置: 首页>>代码示例>>PHP>>正文


PHP get_device_id_by_port_id函数代码示例

本文整理汇总了PHP中get_device_id_by_port_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_device_id_by_port_id函数的具体用法?PHP get_device_id_by_port_id怎么用?PHP get_device_id_by_port_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_device_id_by_port_id函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: port_permitted

function port_permitted($port_id, $device_id = null)
{
    global $permissions;
    if (!is_numeric($device_id)) {
        $device_id = get_device_id_by_port_id($port_id);
    }
    if ($_SESSION['userlevel'] >= '5') {
        $allowed = true;
    } else {
        if (device_permitted($device_id)) {
            $allowed = true;
        } else {
            if ($permissions['port'][$port_id]) {
                $allowed = true;
            } else {
                $allowed = false;
            }
        }
    }
    return $allowed;
}
开发者ID:RobsanInc,项目名称:librenms,代码行数:21,代码来源:functions.inc.php

示例2: port_permitted

function port_permitted($port_id, $device_id = NULL)
{
    global $permissions;
    if (!is_numeric($device_id)) {
        $device_id = get_device_id_by_port_id($port_id);
    }
    if ($_SESSION['userlevel'] >= "5") {
        $allowed = TRUE;
    } elseif (device_permitted($device_id)) {
        $allowed = TRUE;
    } elseif ($permissions['port'][$port_id]) {
        $allowed = TRUE;
    } else {
        $allowed = FALSE;
    }
    return $allowed;
}
开发者ID:RomanBogachev,项目名称:observium,代码行数:17,代码来源:functions.inc.php

示例3: get_device_id_by_port_id

<?php

if ($vars['tab'] == 'port' && is_numeric($vars['device']) && port_permitted($vars['port'])) {
    $check_device = get_device_id_by_port_id($vars['port']);
    $permit_ports = 1;
}
if (!is_numeric($vars['device'])) {
    $vars['device'] = device_by_name($vars['device']);
}
if (device_permitted($vars['device']) || $check_device == $vars['device']) {
    $selected['iface'] = 'selected';
    $tab = str_replace('.', '', mres($vars['tab']));
    if (!$tab) {
        $tab = 'overview';
    }
    $select[$tab] = 'active';
    $device = device_by_id_cache($vars['device']);
    $attribs = get_dev_attribs($device['device_id']);
    $entity_state = get_dev_entity_state($device['device_id']);
    // print_r($entity_state);
    $pagetitle[] = $device['hostname'];
    if ($config['os'][$device['os']]['group']) {
        $device['os_group'] = $config['os'][$device['os']]['group'];
    }
    echo '<div class="panel panel-default">';
    echo '<table class="device-header-table" style="margin: 0px 7px 7px 7px;" cellspacing="0" class="devicetable" width="99%">';
    require 'includes/device-header.inc.php';
    echo '</table>';
    echo '</div>';
    if (device_permitted($device['device_id'])) {
        echo '<ul class="nav nav-tabs">';
开发者ID:greggcz,项目名称:librenms,代码行数:31,代码来源:device.inc.php

示例4: print_error

    print_error('<h4>No device specified</h4>
                   A valid device was not specified in the URL. Please retype and try again.');
    return;
}
// Allow people to see this page if they have permission to see one of the ports, but don't show them tabs.
$permit_tabs = array();
if ($vars['tab'] == "port" && is_numeric($vars['device']) && (isset($vars['port']) || isset($vars['ifdescr']))) {
    // If we've been given a 'ifdescr' variable, try to work out the port_id from this
    if (!is_numeric($vars['port']) && !empty($vars['ifdescr'])) {
        $ifdescr = base64_decode($vars['ifdescr']);
        if (!$ifdescr) {
            $ifdescr = $vars['ifdescr'];
        }
        $vars['port'] = get_port_id_by_ifDescr($vars['device'], $ifdescr);
    }
    if (port_permitted($vars['port']) && $vars['device'] == get_device_id_by_port_id($vars['port'])) {
        $permit_tabs['ports'] = TRUE;
    }
}
if ($vars['tab'] == "health" && is_numeric($vars['id']) && isset($vars['id'])) {
    if (is_entity_permitted($vars['id'], 'sensor')) {
        $permit_tabs['health'] = TRUE;
    }
}
// print_vars($permit_tabs);
// If there is no valid device specified in the URL, generate an error.
if (!isset($cache['devices']['id'][$vars['device']]) && !count($permit_tabs)) {
    print_error('<h4>No valid device specified</h4>
                  A valid device was not specified in the URL. Please retype and try again.');
    return;
}
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:device.inc.php


注:本文中的get_device_id_by_port_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。