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


PHP Authentication::checkRights方法代码示例

本文整理汇总了PHP中Authentication::checkRights方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::checkRights方法的具体用法?PHP Authentication::checkRights怎么用?PHP Authentication::checkRights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authentication的用法示例。


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

示例1: checkPermission

function checkPermission($permission)
{
    global $getSiteURI;
    global $cid;
    global $uid;
    $URL = $getSiteURI . "/index/user/{$uid}";
    $data = http_get($URL, true);
    $data = json_decode($data, true);
    $found = false;
    foreach ($data['courses'] as $key => $course) {
        if ($course['course']['id'] == $cid) {
            $data['courses'] = array($course);
            $found = true;
            break;
        }
    }
    if (!$found) {
        $data['courses'] = array();
    }
    $user_course_data = $data;
    Authentication::checkRights($permission, $cid, $uid, $user_course_data);
}
开发者ID:sawh,项目名称:ostepu-system,代码行数:22,代码来源:Download.php

示例2: dirname

<?php

/**
 * @file Condition.php
 * Constructs the page that is displayed when managing exam conditions.
 *
 * @author Felix Schmidt
 * @author Florian Lücke
 * @author Ralf Busch
 */
include_once dirname(__FILE__) . '/include/Boilerplate.php';
include_once dirname(__FILE__) . '/../Assistants/Structures.php';
global $globalUserData;
Authentication::checkRights(PRIVILEGE_LEVEL::ADMIN, $cid, $uid, $globalUserData);
$langTemplate = 'Condition_Controller';
Language::loadLanguageFile('de', $langTemplate, 'json', dirname(__FILE__) . '/');
$notifications = array();
if (isset($_POST['action'])) {
    // creates a new course
    if ($_POST['action'] == "SetCondition") {
        // bool which is true if any error occured
        $RequestError = false;
        foreach ($_POST as $key => $value) {
            // skips the first POST which includes the 'action' type
            if ($key == "action") {
                continue;
            }
            // changes the percentage for each exercise type
            $approvalConditionId = $key;
            $percentage = cleanInput($value);
            if (is_numeric($percentage) && $percentage >= 0 && $percentage <= 100) {
开发者ID:sawh,项目名称:ostepu-system,代码行数:31,代码来源:Condition.php

示例3: dirname

<?php

/**
 * @file Lecturer.php
 * Constructs the page that is displayed to a lecturer.
 *
 * @author Felix Schmidt
 * @author Florian Lücke
 * @author Ralf Busch
 */
include_once dirname(__FILE__) . '/include/Boilerplate.php';
include_once dirname(__FILE__) . '/../Assistants/Structures.php';
include_once dirname(__FILE__) . '/../Assistants/LArraySorter.php';
global $globalUserData;
Authentication::checkRights(PRIVILEGE_LEVEL::LECTURER, $cid, $uid, $globalUserData);
$langTemplate = 'Lecturer_Controller';
Language::loadLanguageFile('de', $langTemplate, 'json', dirname(__FILE__) . '/');
$sheetNotifications = array();
if (isset($_POST['action'])) {
    if ($_POST['action'] == "ExerciseSheetLecturer" && isset($_POST['deleteSheetWarning'])) {
        $sheetNotifications[$_POST['deleteSheetWarning']][] = MakeNotification("warning", Language::Get('main', 'askDeleteSheet', $langTemplate));
    } elseif ($_POST['action'] == "ExerciseSheetLecturer" && isset($_POST['deleteSheet'])) {
        $URL = $logicURI . "/exercisesheet/exercisesheet/{$_POST['deleteSheet']}";
        $result = http_delete($URL, true, $message);
        if ($message == 201) {
            $sheetNotifications[$_POST['deleteSheet']][] = MakeNotification('success', Language::Get('main', 'successDeleteSheet', $langTemplate));
        } else {
            $sheetNotifications[$_POST['deleteSheet']][] = MakeNotification('error', Language::Get('main', 'errorDeleteSheet', $langTemplate));
        }
    }
}
开发者ID:sawh,项目名称:ostepu-system,代码行数:31,代码来源:Lecturer.php

示例4: dirname

 * to create new courses.
 *
 * @author Felix Schmidt
 * @author Florian Lücke
 * @author Ralf Busch
 *
 * @todo POST Request to logic instead of DB
 * @todo check rights for whole page
 * @todo create a navigation bar for super admins
 * @todo unset $_POST on success
 */
include_once dirname(__FILE__) . '/include/Boilerplate.php';
include_once dirname(__FILE__) . '/../Assistants/Structures.php';
include_once dirname(__FILE__) . '/include/FormEvaluator.php';
global $globalUserData;
Authentication::checkRights(PRIVILEGE_LEVEL::SUPER_ADMIN, null, $uid, $globalUserData);
$langTemplate = 'MainSettings_Controller';
Language::loadLanguageFile('de', $langTemplate, 'json', dirname(__FILE__) . '/');
// load Plugins data from LogicController
$URI = $serverURI . "/logic/LExtension/link/extension";
$temp = http_get($URI, true);
$plugins_data = json_decode($temp, true);
if (isset($_POST['action'])) {
    // creates a new course
    if ($_POST['action'] == "CreateCourse") {
        $f = new FormEvaluator($_POST);
        $f->checkStringForKey('courseName', FormEvaluator::REQUIRED, 'warning', Language::Get('main', 'invalidCourseName', $langTemplate), array('min' => 1));
        $f->checkStringForKey('semester', FormEvaluator::REQUIRED, array('min' => 1), 'warning', Language::Get('main', 'invalidSemester', $langTemplate));
        $f->checkIntegerForKey('defaultGroupSize', FormEvaluator::REQUIRED, 'warning', Language::Get('main', 'invalidGroupSize', $langTemplate), array('min' => 0));
        $f->checkArrayOfIntegersForKey('exerciseTypes', FormEvaluator::OPTIONAL, 'warning', Language::Get('main', 'invalidExerciseType', $langTemplate));
        $f->checkArrayOfIntegersForKey('plugins', FormEvaluator::OPTIONAL, 'warning', Language::Get('main', 'noSelectedExtensions', $langTemplate));
开发者ID:sawh,项目名称:ostepu-system,代码行数:31,代码来源:MainSettings.php


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