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


PHP access::need方法代碼示例

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


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

示例1: array

<?php

require "../../base.php";
global $_base;
$_base->page->theme_file = "doc";
access::need("mod");
$_base->page->add_title("Apache status");
echo '
<h1>Apache status</h1>
<p>
	Velg sorteringsrekkefølge:
</p>';
$orders = array("last" => array("Siste visning &raquo;", "Sorterer etter siste visning"), "count" => array("Antall rader oppført &raquo;", "Sorterer etter antall rader oppført"));
foreach ($orders as $order => $info) {
    echo '
<p>
	<a href="?order=' . urlencode($order) . '">' . $info[0] . '</a>
</p>';
}
if (isset($_GET['order']) && array_key_exists($_GET['order'], $orders)) {
    $order = $_GET['order'];
    $_base->page->add_message($orders[$order][1]);
} else {
    if (isset($_GET['order'])) {
        $_base->page->add_message("Ugyldig sorteringsnavn.", "error");
    }
    $_base->page->load();
}
$request = new httpreq();
$data = $request->get("/httpd-status-server", array());
if (!$data) {
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:31,代碼來源:index.php

示例2: empty

<?php

require "../base.php";
global $_base;
// krev admin tilgang
access::need("admin");
$_base->page->add_title("Registrer donasjonsoppføring");
// har vi brukerid?
if (isset($_POST['up_id'])) {
    $up_id = empty($_POST['up_id']) ? false : intval($_POST['up_id']);
    $player = false;
    if ($up_id) {
        // kontroller at brukeren finnes
        $result = \Kofradia\DB::get()->query("SELECT up_id, up_name, u_email, up_access_level FROM users_players, users WHERE up_id = {$up_id} AND up_u_id = u_id");
        if ($result->rowCount() == 0) {
            $_base->page->add_error("Fant ikke brukeren.");
            redirect::handle();
        }
        $player = $result->fetch();
    }
    // registrere donasjon?
    if (isset($_POST['time']) && isset($_POST['amount']) && !isset($_POST['edit'])) {
        // kontroller dato
        $date = check_date($_POST['time']);
        // d.m.y H:i:s
        if ($date) {
            $time = $_base->date->get();
            $time->setDate($date[3], $date[2], $date[1]);
            $time->setTime($date[4], $date[5], $date[6]);
        }
        // kontroller beløp
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:31,代碼來源:registrer_donasjon.php

示例3: isset

<?php

require "../base.php";
access::need("crewet");
$global = isset($_POST['noglobal']) ? "" : " GLOBAL";
$result = \Kofradia\DB::get()->query("SHOW{$global} STATUS");
$result->debug();
//$avg = $variables['Questions'] / $variables['Uptime'];
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:8,代碼來源:mysql_status.php

示例4: error_reporting

<?php

require "../../base.php";
error_reporting(E_ALL & ~E_NOTICE);
global $_game;
// anti-bot
#$antibot_name = "poker";
#$antibot_span = 30;
#$antibot_return = PHP_SELF;
#antibot::require_antibot($antibot_name, $antibot_span, $antibot_return);
ess::$b->page->add_title("Moderator poker");
access::need_nostat();
access::need("forum_mod");
// legg til css
ess::$b->page->add_css("#poker_info { margin: 10px auto 0 auto }\n.kort_wrapper { width: 257px; margin: 0 auto 0 auto; padding: 4px 0 }\n#kort_wrapper { width: 260px; margin: 0 auto 0 auto; padding-bottom: 10px }\n.kort_wrapper .kort, .kort_i {\n\tfont-family: Arial, Verdana, Tahoma;\n\twidth: 45px;\n\ttext-align: center;\n\tborder: 1px solid #000;\n\tbackground: #FFFFFF;\n\theight: 85px;\n\tfont-size: 30px;\n\tpadding: 0 0 5px 0;\n\tmargin: 0 2px 0 2px;\n\tline-height: 50px;\n\tfloat: left;\n}\n.kort_wrapper .kort {\n\tbackground: #488C9F;\n\tcursor: pointer;\n}\n.kg_0, .kg_1 { color: #000000 }\n.kg_2, .kg_3 { color: #FF0000 }\n.kort_submit { clear: left; text-align: center; margin-top: 0 }");
echo '
<h1>Poker</h1>
<p align="center">
	15. april 2007: Da kan moderatorene og nostat ha det morsomt med den gamle pokerversjonen!
</p>
<!--<p>
	<b style="color: #FF0000">Oppdatering 4. mars:</b> Nå er det gjort litt endringer på gevinstene og man vinner kun på 1 par dersom man har 9, 10, J, Q, K eller A. Maksimumsgrensen er også fjernet.
</p>-->';
// 5-korts draw
// innstillinger
$farger = array(array("Kløver", '<img src="' . STATIC_LINK . '/other/poker_clubs.gif" alt="Kløver" />'), array("Spar", '<img src="' . STATIC_LINK . '/other/poker_spades.gif" alt="Spar" />'), array("Hjerter", '<img src="' . STATIC_LINK . '/other/poker_hearts.gif" alt="Hjerter" />'), array("Ruter", '<img src="' . STATIC_LINK . '/other/poker_diams.gif" alt="Ruter" />'));
$tegn = array(1 => 2, 3, 4, 5, 6, 7, 8, 9, 10, "J", "Q", "K", "A");
$gevinster = array(array(9, "royal straight flush", 100), array(8, "straight flush", 12), array(7, "fire like", 4), array(6, "hus", 3), array(5, "flush", 2.4), array(4, "straight", 2.2), array(3, "tre like", 1.9), array(2, "to par", 1.6), array(1, "ett par", 1.2), array(0, "ingenting", 0.2));
$kortstokk = array(1 => 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52);
// oppføring fra databasen?
$result = \Kofradia\DB::get()->query("SELECT id, upoker_up_id, cards, time, cash, finished FROM users_poker WHERE upoker_up_id = " . login::$user->player->id);
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:31,代碼來源:poker.php

示例5: define

<?php

define("ALLOW_GUEST", true);
require "../base.php";
putlog("NOTICE", "%c4%b%u{$_SERVER['REMOTE_ADDR']}%u%b viste {$_SERVER['REQUEST_URI']}");
access::need("sadmin");
$data = array();
foreach ($GLOBALS as $key => $value) {
    if ($key == "GLOBALS" || $key == "data" || $key == "key" || $key == "value") {
        continue;
    }
    $data[$key] = $value;
}
ob_start();
var_dump($data);
$data = ob_get_contents();
ob_clean();
echo 'GLOBALS:
<pre>' . htmlspecialchars($data) . '</pre>';
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:19,代碼來源:debuginfo.php

示例6: action_panel

    /** Vis panelet */
    public static function action_panel()
    {
        access::need("crewet");
        ess::$b->page->add_title("Panelet");
        echo '
<h1>Support panelet</h1>
<p class="h_right"><a href="./">Tilbake</a></p>';
        // vis kategori
        self::show_panel_category();
        // vis oversikt over kategoriene
        self::show_main_panel_info();
    }
開發者ID:Kuzat,項目名稱:kofradia,代碼行數:13,代碼來源:class.support.php


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