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


PHP print_error_permission函数代码示例

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


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

示例1: http_auth_require_login

/**
 * This function forces a login prompt via basic HTTP authentication by making the browser believe
 * the authentication has failed. Required to log out a basic HTTP auth session.
 */
function http_auth_require_login()
{
    $realm = $GLOBALS['config']['login_message'];
    header('WWW-Authenticate: Basic realm="' . $realm . '"');
    header('HTTP/1.1 401 Unauthorized');
    print_error_permission();
    session_logout();
    die;
}
开发者ID:Natolumin,项目名称:observium,代码行数:13,代码来源:http-auth.inc.php

示例2: print_error_permission

<?php

/**
 * Observium Network Management and Monitoring System
 * Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
 *
 * @package    observium
 * @subpackage webui
 * @author     Adam Armstrong <adama@observium.org>
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
if ($_SESSION['userlevel'] < 10) {
    print_error_permission();
    return;
}
$export_device = $device;
if ($config['snmp']['hide_auth']) {
    $params = array('snmp_community', 'snmp_authlevel', 'snmp_authname', 'snmp_authpass', 'snmp_authalgo', 'snmp_cryptopass', 'snmp_cryptoalgo');
    foreach ($params as $param) {
        if (strlen($export_device[$param])) {
            $export_device[$param] = '***';
        }
    }
}
if ($vars['saveas'] == 'yes' && $vars['filename']) {
    download_as_file(gzencode(_json_encode($export_device)), $vars['filename']);
} else {
    if ($config['snmp']['hide_auth']) {
        print_warning("NOTE, <strong>\$config['snmp']['hide_auth']</strong> is set to <strong>TRUE</strong>, snmp community and snmp v3 auth hidden from output and export.");
    } else {
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:data.inc.php

示例3: intval

<?php

/**
 * Observium
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage webui
 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2016 Observium Limited
 *
 */
# enable/disable ports/interfaces on devices.
$device_id = intval($vars['device']);
if (!device_permitted($device_id)) {
    print_error_permission('You have insufficient permissions to edit settings.');
    return;
}
$rows_updated = 0;
//r($vars);
$ports_attribs = get_device_entities_attribs($device_id, 'port');
// Get all attribs
$where = generate_query_values($vars['port'], 'port_id');
foreach (dbFetchRows("SELECT `port_id`, `ignore`, `disabled` FROM `ports` WHERE `device_id` = ?" . $where, array($device_id)) as $port) {
    $updated = FALSE;
    $port_id = $port['port_id'];
    $update_array = array();
    if (isset($ports_attribs['port'][$port_id])) {
        $port = array_merge($port, $ports_attribs['port'][$port_id]);
    }
    // Check ignored and disabled port
开发者ID:Natolumin,项目名称:observium,代码行数:31,代码来源:port-edit.inc.php


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