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


PHP checkAuthorised函数代码示例

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


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

示例1: get_form_var

<?php

// $Id$
require "defaultincludes.inc";
require_once "mrbs_sql.inc";
// Get non-standard form variables
$name = get_form_var('name', 'string');
$description = get_form_var('description', 'string');
$capacity = get_form_var('capacity', 'int');
$type = get_form_var('type', 'string');
// Check the user is authorised for this page
checkAuthorised();
// This file is for adding new areas/rooms
$error = '';
// First of all check that we've got an area or room name
if (!isset($name) || $name === '') {
    $error = "empty_name";
} elseif ($type == "area") {
    $area = mrbsAddArea($name, $error);
} elseif ($type == "room") {
    $room = mrbsAddRoom($name, $area, $error, $description, $capacity);
}
$returl = "admin.php?area={$area}" . (!empty($error) ? "&error={$error}" : "");
header("Location: {$returl}");
开发者ID:ailurus1991,项目名称:MRBS,代码行数:24,代码来源:add.php

示例2: invalid_booking

// $Id$
require "defaultincludes.inc";
require_once "mrbs_sql.inc";
require_once "functions_ical.inc";
function invalid_booking($message)
{
    global $day, $month, $year, $area, $room;
    print_header($day, $month, $year, $area, isset($room) ? $room : "");
    echo "<h1>" . get_vocab('invalid_booking') . "</h1>\n";
    echo "<p>{$message}</p>\n";
    // Print footer and exit
    print_footer(TRUE);
}
$ajax = get_form_var('ajax', 'int');
if ($ajax && !checkAuthorised(TRUE)) {
    exit;
}
// (1) Check the user is authorised for this page
//  ---------------------------------------------
//checkAuthorised();
// Also need to know whether they have admin rights
//$user = getUserName();
//$is_admin = (authGetUserLevel($user) >= 2);
// (2) Get the form variables
// --------------------------
// NOTE:  the code on this page assumes that array form variables are passed
// as an array of values, rather than an array indexed by value.   This is
// particularly important for checkbox arrays whicgh should be formed like this:
//
//    <input type="checkbox" name="foo[]" value="n">
开发者ID:cvelayo,项目名称:worklog,代码行数:30,代码来源:edit_entry_handler2.php


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