當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。