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