當前位置: 首頁>>代碼示例>>PHP>>正文


PHP entry::check_right方法代碼示例

本文整理匯總了PHP中entry::check_right方法的典型用法代碼示例。如果您正苦於以下問題:PHP entry::check_right方法的具體用法?PHP entry::check_right怎麽用?PHP entry::check_right使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在entry的用法示例。


在下文中一共展示了entry::check_right方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

    for ($i = 0; $i < 8; $i++) {
        $r = $right;
        $r['right_num'] = $i;
        $r['right_checked'] = array();
        if ($right['rights'] & pow(2, $i)) {
            $r['right_checked'][] = array();
        }
        $right['right'][$i] = $r;
    }
    return $right;
}
$output->secure();
$entry = new entry();
$entry->get();
$entry->load();
$entry->check_right('rights');
$changed = false;
if (isset($_POST['rights'])) {
    $entry->update_rights($_POST['rights']);
    $changed = true;
}
if (isset($_POST['new_rights'])) {
    $entry->create_rights($_POST['new_rights']);
    $changed = true;
}
if ($changed) {
    redirect('rights.php?id=' . $entry->data['id']);
}
$v['id'] = $entry->id;
$v['entry'] = $entry->format('entry.html');
$rights = rights_of($entry->data['id']);
開發者ID:BackupTheBerlios,項目名稱:infoschool-svn,代碼行數:31,代碼來源:rights.php

示例2: entry

<?php

/*
 * This file is part of Infoschool - a web based school intranet.
 * Copyright (C) 2006 Maikel Linke
 */
include 'var.php';
$output->secure();
$entry = new entry();
$entry->get();
$entry->load();
$entry->check_right('read');
$entry->load_answers($max_depth, 'read');
$v['entry'] = $entry->format('entry.html');
$v['history'] = $entry->fdata['history'];
$v['answers'] = format_answers($entry);
$content = new tmpl('entry_answers.html', $v);
$output->out($content);
開發者ID:BackupTheBerlios,項目名稱:infoschool-svn,代碼行數:18,代碼來源:entry.php

示例3: entry

<?php

/*
 * This file is part of Infoschool - a web based school intranet.
 * Copyright (C) 2006 Maikel Linke
 */
include 'var.php';
$output->secure();
$entry = new entry();
$entry->get();
$entry->load();
$entry->check_right('edit');
if (!$entry->right_edit()) {
    redirect('./');
}
if (isset($_POST['entry'])) {
    $entry->update($_POST['entry']);
    redirect('entry.php?id=' . $entry->data['id']);
}
$content = $entry->format('edit.html');
$output->out($content);
開發者ID:BackupTheBerlios,項目名稱:infoschool-svn,代碼行數:21,代碼來源:edit.php


注:本文中的entry::check_right方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。