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


PHP Utility::authenticate方法代码示例

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


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

示例1: define

/************************************************************************/
/* AContent                                                             */
/************************************************************************/
/* Copyright (c) 2010                                                   */
/* Inclusive Design Institute                                           */
/*                                                                      */
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
$page = 'form_editor';
define('TR_INCLUDE_PATH', '../include/');
require_once TR_INCLUDE_PATH . 'vitals.inc.php';
require_once TR_INCLUDE_PATH . 'lib/tinymce.inc.php';
require_once TR_INCLUDE_PATH . 'classes/Utility.class.php';
Utility::authenticate(TR_PRIV_ISAUTHOR_OF_CURRENT_COURSE);
$area = $_GET['area'];
$number = null;
$parts = explode('_', $area, 2);
if (is_numeric($parts[1])) {
    $parts[1]++;
    $title = _AT($parts[0]) . ' ' . $parts[1];
} else {
    $title = _AT($area);
}
$onload = 'onload="init();"';
global $myLang;
global $page;
global $savant;
global $errors, $onload;
global $_user_location;
开发者ID:harriswong,项目名称:AContent,代码行数:31,代码来源:form_editor.php

示例2: setTopPages

 /**
  * Set top pages array based on login user's priviledge. If there's no login user, use priviledges that are open to public.
  * @access  private
  * @param   none
  * @return  true
  * @author  Cindy Qi Li
  */
 private function setTopPages()
 {
     global $_base_path, $_course_id, $_content_id;
     $priviledgesDAO = new PrivilegesDAO();
     if (isset($_SESSION['user_id']) && $_SESSION['user_id'] != 0) {
         $rows = $priviledgesDAO->getUserPrivileges($_SESSION['user_id']);
     } else {
         $rows = $priviledgesDAO->getPublicPrivileges();
     }
     if (is_array($rows)) {
         foreach ($rows as $id => $row) {
             // replace the required constants in link
             $row['link'] = Utility::replaceConstants($row['link']);
             list($url, $param) = Utility::separateURLAndParam($row['link']);
             if (Utility::authenticate($row['user_requirement'], false)) {
                 $this->pages[TR_NAV_TOP][] = array('url' => $_base_path . $row['link'], 'title' => _AT($row['title_var']), 'param' => $param);
             }
             // add section pages if it has not been defined in $this->pages
             if (!isset($this->pages[$url])) {
                 $this->pages = array_merge($this->pages, array($url => array('title_var' => $row['title_var'], 'parent' => TR_NAV_TOP, 'param' => $param)));
             } else {
                 $this->pages[$url]['param'] = $param;
             }
         }
     }
     return true;
 }
开发者ID:harriswong,项目名称:AContent,代码行数:34,代码来源:Menu.class.php

示例3: define

/* AContent                                                             */
/************************************************************************/
/* Copyright (c) 2010                                                   */
/* Inclusive Design Institute                                           */
/*                                                                      */
/* This program is free software. You can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License          */
/* as published by the Free Software Foundation.                        */
/************************************************************************/
define('TR_INCLUDE_PATH', '../../include/');
require_once TR_INCLUDE_PATH . 'vitals.inc.php';
require_once TR_INCLUDE_PATH . '../home/editor/editor_tab_functions.inc.php';
require_once TR_INCLUDE_PATH . '../home/classes/ContentUtility.class.php';
global $_content_id, $_content_id, $contentManager, $_course_id;
$cid = $_content_id;
Utility::authenticate(TR_PRIV_ISAUTHOR);
if (isset($_GET['pid'])) {
    $pid = intval($_GET['pid']);
}
if (defined('TR_FORCE_GET_FILE') && TR_FORCE_GET_FILE) {
    $course_base_href = 'get.php/';
} else {
    $course_base_href = 'content/' . $_course_id . '/';
}
if ($cid > 0 && isset($contentManager)) {
    $content_row = $contentManager->getContentPage($cid);
}
// save changes
if ($_POST['submit']) {
    if ($_POST['title'] == '') {
        $msg->addError(array('EMPTY_FIELDS', _AT('title')));
开发者ID:harriswong,项目名称:AContent,代码行数:31,代码来源:edit_content_folder.php

示例4: array

    $_pages['tests/edit_question_multianswer.php']['parent'] = 'tests/question_db.php';
    $_pages['tests/edit_question_long.php']['title_var'] = 'edit_question';
    $_pages['tests/edit_question_long.php']['parent'] = 'tests/question_db.php';
    $_pages['tests/edit_question_likert.php']['title_var'] = 'edit_question';
    $_pages['tests/edit_question_likert.php']['parent'] = 'tests/question_db.php';
    $_pages['tests/edit_question_matching.php']['title_var'] = 'edit_question';
    $_pages['tests/edit_question_matching.php']['parent'] = 'tests/question_db.php';
    $_pages['tests/edit_question_matchingdd.php']['title_var'] = 'edit_question';
    $_pages['tests/edit_question_matchingdd.php']['parent'] = 'tests/question_db.php';
    $_pages['tests/edit_question_ordering.php']['title_var'] = 'edit_question';
    $_pages['tests/edit_question_ordering.php']['parent'] = 'tests/question_db.php';
    $_pages['tests/delete_question.php']['title_var'] = 'delete';
    $_pages['tests/delete_question.php']['parent'] = 'tests/question_db.php';
}
// file manager
if (array_key_exists(TR_PRIV_FILE_MANAGER, $privs) && Utility::authenticate($privs[TR_PRIV_FILE_MANAGER], false)) {
    $_pages['file_manager/index.php']['title_var'] = 'file_manager';
    $_pages['file_manager/index.php']['parent'] = TR_NAV_TOP;
    $_pages['file_manager/index.php']['guide'] = 'instructor/?p=file_manager.php';
    $_pages['file_manager/index.php']['children'] = array('file_manager/new.php');
    $_pages['file_manager/new.php']['title_var'] = 'create_new_file';
    $_pages['file_manager/new.php']['parent'] = 'file_manager/index.php';
    $_pages['file_manager/zip.php']['title_var'] = 'zip_file_manager';
    $_pages['file_manager/zip.php']['parent'] = 'file_manager/index.php';
    $_pages['file_manager/rename.php']['title_var'] = 'rename';
    $_pages['file_manager/rename.php']['parent'] = 'file_manager/index.php';
    $_pages['file_manager/move.php']['title_var'] = 'move';
    $_pages['file_manager/move.php']['parent'] = 'file_manager/index.php';
    $_pages['file_manager/edit.php']['title_var'] = 'edit';
    $_pages['file_manager/edit.php']['parent'] = 'file_manager/index.php';
    $_pages['file_manager/delete.php']['title_var'] = 'delete';
开发者ID:harriswong,项目名称:AContent,代码行数:31,代码来源:page_constants.inc.php


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