本文整理汇总了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;未经允许,请勿转载。 |
请发表评论