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


PHP checkRights函数代码示例

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


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

示例1: getToiminnot

/**
 * Creates and returns a reference to a subclass of toiminto.
 * @param toiminto String
 * @return A subclass of Toiminto
 */
function &createToiminto($toiminto)
{
    $action = 0;
    $TOIMINNOT =& getToiminnot();
    $_SESSION['onkooikeuksia'] = false;
    // saa katsoa mutta ei muuttaa
    // Haetaan taulukosta luokan nimi ja tiedoston nimi
    // ja luodaan uusi luokka luokan nimellä.
    if (array_key_exists($toiminto, $TOIMINNOT)) {
        require_once $TOIMINNOT[$toiminto][1] . '.php';
        $className = $TOIMINNOT[$toiminto][0];
        $action = new $className();
        $action->asetaNykyinenTila($toiminto);
        // jos ei oikeudet riitä niin palataan pääsivulle
        $onkoOikeuksia = checkRights($action, $TOIMINNOT[$toiminto][2]);
        if ($action->LOGGED_IN == true) {
            if (!$onkoOikeuksia) {
                D("KATSOMIS oikeudeyt");
                $_SESSION['onkooikeuksia'] = false;
                // saa katsoa mutta ei muuttaa
                $onkoOikeuksia = true;
            } else {
                $_SESSION['onkooikeuksia'] = true;
                // saa myös muuttaa
            }
        }
        if (!$onkoOikeuksia) {
            $action = mainPage();
            if (array_key_exists('nimi', $_SESSION)) {
                $action->addError('Sulla ei oo oikeuksia kuules!!');
            } else {
                $action->addError('Loggaa sisälle!!');
            }
        }
    } else {
        // jos tulee virheellinen tilanne
        $action = mainPage();
    }
    $action->toiminnot =& array_keys($TOIMINNOT);
    return $action;
}
开发者ID:kaartine,项目名称:Rysty,代码行数:46,代码来源:toimintofactory.php

示例2: author

+--------------------------------------------------------+
| Author: Domi & fetloser
| www.venue.nu			     	      
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../../../maincore.php";
require_once THEME . "theme.php";
echo "<link rel='stylesheet' href='" . THEME . "styles.css' type='text/css'>";
if (!checkRights("I")) {
    header("Location:../../../index.php");
    exit;
}
if (isset($game) && !isNum($game)) {
    fallback("index.php");
}
if (!defined("LANGUAGE")) {
    // PHPFusion environment
    $this_lang = str_replace("/", "", LOCALESET);
    if (file_exists(INFUSIONS . "varcade/locale/" . $this_lang . ".php")) {
        include INFUSIONS . "varcade/locale/" . $this_lang . ".php";
    } else {
        include INFUSIONS . "varcade/locale/English.php";
    }
} else {
开发者ID:simplyianm,项目名称:clububer,代码行数:31,代码来源:flashdetect.php

示例3: getWebEditorCfg

 * 20110409 - franciscom - BUGID 4368: Provide WYSIWYG Editor
 * 20101101 - franciscom - refactoring to remove event viewer warnings
 *
**/
require_once "../../config.inc.php";
require_once "common.php";
require_once "csv.inc.php";
require_once "xml.inc.php";
require_once "web_editor.php";
$editorCfg = getWebEditorCfg('build');
require_once require_web_editor($editorCfg['type']);
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$default_template = $templateCfg->default_template;
$args = init_args($db);
checkRights($db, $_SESSION['currentUser'], $args);
$gui = init_gui($db, $args);
$smarty = new TLSmarty();
$op = new stdClass();
$op->status = 0;
$of = web_editor('notes', $_SESSION['basehref'], $editorCfg);
$of->Value = getItemTemplateContents('platform_template', $of->InstanceName, $args->notes);
$platform_mgr = new tlPlatform($db, $args->tproject_id);
$action = $args->doAction;
switch ($action) {
    case "do_create":
    case "do_update":
    case "do_delete":
        if (!$gui->canManage) {
            break;
        }
开发者ID:moraesmv,项目名称:testlink-code,代码行数:31,代码来源:platformsEdit.php

示例4: Copyright

  | Copyright (C) PHP-Fusion Inc
  | http://www.php-fusion.co.uk/
  +--------------------------------------------------------+
  | Filename: settings_messages.php
  | Author: Nick Jones (Digitanium)
  +--------------------------------------------------------+
  | This program is released as free software under the
  | Affero GPL license. You can redistribute it and/or
  | modify it under the terms of this license which you
  | can read by viewing the included agpl.txt or online
  | at www.gnu.org/licenses/agpl.html. Removal of this
  | copyright header is strictly prohibited without
  | written permission from the original author(s).
  +--------------------------------------------------------*/
require_once "../maincore.php";
if (!checkRights("S7") || !defined("iAUTH") || !isset($_GET['aid']) || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/settings.php";
$count = 0;
if (isset($_GET['error']) && isnum($_GET['error']) && !isset($message)) {
    if ($_GET['error'] == 0) {
        $message = $locale['900'];
    } elseif ($_GET['error'] == 1) {
        $message = $locale['901'];
    }
    if (isset($message)) {
        echo "<div id='close-message'><div class='admin-message alert alert-info m-t-10'>" . $message . "</div></div>\n";
    }
}
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:settings_messages.php

示例5: restore

 /**
  * Restore the item (previously soft-deleted)
  *(if the model allows soft-deletes)
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function restore($id)
 {
     // check user rights (teachers and leaders can edit items of their own plan)
     $item = Item::onlyTrashed()->find($id);
     $plan_id = $item->plan_id;
     $plan = Plan::find($plan_id);
     if (!checkRights($plan)) {
         return redirect()->back();
     }
     // get item and restore it
     $item = restoreItem($id);
     if ($item) {
         // mark restored item as 'newest item'
         session()->put(['newest_item_id' => $id]);
         // back to full plan view
         return \Redirect::back();
     }
     flashError('Error! Item with ID "' . $id . '" not found! (F:restore)');
     return \Redirect::back();
 }
开发者ID:matthiku,项目名称:cSpot,代码行数:27,代码来源:ItemController.php

示例6: header

if (!isset($_SESSION["uid"])) {
    header("location:miniadm.logon.php");
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.user.inc";
include_once dirname(__FILE__) . 'ressources/class.templates.inc';
include_once dirname(__FILE__) . 'ressources/class.ldap.inc';
include_once dirname(__FILE__) . 'ressources/class.users.menus.inc';
include_once dirname(__FILE__) . 'ressources/class.artica.inc';
include_once dirname(__FILE__) . 'ressources/class.mimedefang.inc';
include_once dirname(__FILE__) . 'ressources/class.apache.inc';
include_once dirname(__FILE__) . 'ressources/class.lvm.org.inc';
include_once dirname(__FILE__) . 'ressources/class.user.inc';
if (!checkRights()) {
    header("location:miniadm.messaging.php");
    die;
}
if (isset($_GET["content"])) {
    content();
    exit;
}
if (isset($_GET["section-search"])) {
    section_search();
    exit;
}
if (isset($_GET["search-users"])) {
    users_search();
    exit;
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:31,代码来源:miniadmin.members.php

示例7: APIupdate

 /**
  * Update a single field in the pivot table of the plan-attached resource
  */
 public function APIupdate(Request $request)
 {
     // check if all necessary elements are given
     if ($request->has('id') && $request->has('value')) {
         $field_name = explode('-', $request->id)[0];
         $item_id = explode('-', $request->id)[3];
     } else {
         return false;
     }
     //we need to find the actual resource as attached to the plan!
     $item = DB::table('plan_resource')->where('id', $item_id)->first();
     if ($item) {
         // check authentication
         $plan = Plan::find($item->plan_id);
         if (!checkRights($plan)) {
             return response()->json(['status' => 401, 'data' => 'Not authorized'], 401);
         }
         // update the given field with the given value
         DB::table('plan_resource')->where('id', $item_id)->update([$field_name => $request->value]);
         // return text to sender
         $result = DB::table('plan_resource')->where('id', $item_id)->first();
         return $result->{$field_name};
     }
     return response()->json(['status' => 404, 'data' => "APIupdate: item with id {$item_id} not found"], 404);
 }
开发者ID:matthiku,项目名称:cSpot,代码行数:28,代码来源:ResourceController.php

示例8: define

 *  autoload
 * ===============================================
 */
require 'app/global.php';
/**
 * ===============================================
 *  set the mode
 * 
 *      prod : caching system enabled
 *      dev : force compile templates
 * ===============================================
 */
define('env', 'dev');
/**
 * ===============================================
 *  check rights for files/folders
 * ===============================================
 */
checkRights();
/**
 * ===============================================
 *  set locale
 * ===============================================
 */
setlocale(LC_ALL, 'en_US.UTF8');
/**
 * ===============================================
 *  start the engine
 * ===============================================
 */
app\Fastdoc::start();
开发者ID:ray0be,项目名称:fastdoc,代码行数:31,代码来源:index.php

示例9: testlinkInitPage

 *
 * @internal revisions
 *       
 *
*/
require '../../config.inc.php';
require_once "common.php";
testlinkInitPage($db);
$templateCfg = templateConfiguration();
$tplan_mgr = new testplan($db);
$build_mgr = new build_mgr($db);
$gui = new StdClass();
$gui->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0;
$gui->tplan_name = ' ';
$gui->tplan_id = isset($_REQUEST['tplan_id']) ? intval($_REQUEST['tplan_id']) : 0;
checkRights($db, $_SESSION['currentUser'], $gui);
if ($gui->tplan_id > 0) {
    $dummy = $tplan_mgr->get_by_id($gui->tplan_id);
    $gui->tplan_name = $dummy['name'];
}
$gui->manageURL = "lib/plan/buildEdit.php?tproject_id={$gui->tproject_id}&tplan_id={$gui->tplan_id}";
$gui->editAction = $gui->manageURL . "&do_action=edit&build_id=";
$gui->deleteAction = $gui->manageURL . "&do_action=do_delete&build_id=";
$gui->createAction = $gui->manageURL . "&do_action=create";
$gui->buildSet = $tplan_mgr->get_builds($gui->tplan_id);
$gui->user_feedback = null;
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
/**
 * checkRights
开发者ID:moraesmv,项目名称:testlink-code,代码行数:31,代码来源:buildView.php

示例10: Jones

+--------------------------------------------------------+
| Filename: news_cats.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once "../maincore.php";
require_once THEMES . "templates/admin_header.php";
include LOCALE . LOCALESET . "admin/news-cats.php";
if (!checkRights("NC") || !defined("iAUTH") || $_GET['aid'] != iAUTH) {
    redirect("../index.php");
}
if (isset($_GET['status']) && !isset($message)) {
    if ($_GET['status'] == "sn") {
        $message = $locale['420'];
    } elseif ($_GET['status'] == "su") {
        $message = $locale['421'];
    } elseif ($_GET['status'] == "dn") {
        $message = $locale['422'] . "<br />\n<span class='small'>" . $locale['423'] . "</span>";
    } elseif ($_GET['status'] == "dy") {
        $message = $locale['424'];
    }
    if ($message) {
        echo "<div class='admin-message'>" . $message . "</div>\n";
    }
开发者ID:roniwahyu,项目名称:AKEUDA,代码行数:31,代码来源:news_cats.php


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