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


PHP verifyCsrfGetToken函數代碼示例

本文整理匯總了PHP中verifyCsrfGetToken函數的典型用法代碼示例。如果您正苦於以下問題:PHP verifyCsrfGetToken函數的具體用法?PHP verifyCsrfGetToken怎麽用?PHP verifyCsrfGetToken使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: dirname

$GLOBALS['pagestats']['time_start'] = $now['sec'] * 1000000 + $now['usec'];
$GLOBALS['pagestats']['number_of_queries'] = 0;
# load all required files
require_once dirname(__FILE__) . '/init.php';
require_once dirname(__FILE__) . '/' . $GLOBALS['database_module'];
include_once dirname(__FILE__) . '/../texts/english.inc';
include_once dirname(__FILE__) . '/../texts/' . $GLOBALS['language_module'];
include_once dirname(__FILE__) . '/languages.php';
require_once dirname(__FILE__) . '/defaultconfig.php';
require_once dirname(__FILE__) . '/connect.php';
include_once dirname(__FILE__) . '/lib.php';
require_once dirname(__FILE__) . '/inc/netlib.php';
require_once dirname(__FILE__) . '/inc/interfacelib.php';
$systemTimer = new timer();
// do a loose check, if the token is there, it needs to be valid.
verifyCsrfGetToken(false);
if (!empty($_SESSION['hasconf']) || Sql_Table_exists($tables['config'], 1)) {
    $_SESSION['hasconf'] = true;
    ### Activate all plugins
    /* already done in pluginlib */
    //foreach ($GLOBALS['plugins'] as $plugin) {
    //$plugin->activate();
    //}
}
if (!empty($_GET['page']) && $_GET['page'] == 'logout' && empty($_GET['err'])) {
    foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
        $plugin->logout();
    }
    $_SESSION['adminloggedin'] = '';
    $_SESSION['logindetails'] = '';
    session_destroy();
開發者ID:MarcelvC,項目名稱:phplist3,代碼行數:31,代碼來源:index.php

示例2: verifyCsrfGetToken

#0012081: Add new 'Mark as sent' button
if (isset($_GET['markSent'])) {
    verifyCsrfGetToken();
    $markSent = sprintf('%d', $_GET['markSent']);
    $action_result .= $GLOBALS['I18N']->get('Marking as sent ') . " {$markSent} ..";
    $result = Sql_query(sprintf('update %s set status = "sent", repeatinterval = 0,requeueinterval = 0 where id = %d and (status = "suspended") %s', $tables['message'], $markSent, $ownerselect_and));
    $suc6 = Sql_Affected_Rows();
    if ($suc6) {
        $action_result .= '... ' . $GLOBALS['I18N']->get('Done');
    } else {
        $action_result .= '... ' . $GLOBALS['I18N']->get('Failed');
    }
    $action_result .= '<br /><hr /><br />';
}
if (isset($_GET['action'])) {
    verifyCsrfGetToken();
    switch ($_GET['action']) {
        case 'suspall':
            $action_result .= $GLOBALS['I18N']->get('Suspending all') . ' ..';
            $result = Sql_query(sprintf('update %s set status = "suspended" where (status = "inprocess" or status = "submitted") %s', $tables['message'], $ownerselect_and));
            $suc6 = Sql_Affected_Rows();
            if ($suc6) {
                $action_result .= "... {$suc6} " . $GLOBALS['I18N']->get('Done');
            } else {
                $action_result .= '... ' . $GLOBALS['I18N']->get('Failed');
            }
            $action_result .= '<br /><hr /><br />';
            break;
        case 'markallsent':
            $action_result .= $GLOBALS['I18N']->get('Marking all as sent ') . '  ..';
            $result = Sql_query(sprintf('update %s set status = "sent", repeatinterval = 0,requeueinterval = 0 where (status = "suspended") %s', $tables['message'], $markSent, $ownerselect_and));
開發者ID:gillima,項目名稱:phplist3,代碼行數:31,代碼來源:messages.php

示例3: giveAlternative

                return 0;
            }
        }
        print '<br />';
        giveAlternative($table, $delete, $attributeid);
    }
    return 1;
}
if (isset($_GET['delete'])) {
    if (!verifyCsrfGetToken(true)) {
        print Error(s('No Access'));
        return;
    }
    deleteItem($table, $id, sprintf('%d', $_GET['delete']));
} elseif (isset($_GET['deleteall'])) {
    if (!verifyCsrfGetToken(true)) {
        print Error(s('No Access'));
        return;
    }
    $count = 0;
    $errcount = 0;
    $res = Sql_Query("select id from {$table}");
    while ($row = Sql_Fetch_Row($res)) {
        if (deleteItem($table, $id, $row[0])) {
            ++$count;
        } else {
            ++$errcount;
            if ($errcount > 10) {
                print $GLOBALS['I18N']->get('* Too many errors, quitting') . "<br /><br /><br />\n";
                break;
            }
開發者ID:gillima,項目名稱:phplist3,代碼行數:31,代碼來源:editattributes.php


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