本文整理汇总了PHP中Surfer::reset方法的典型用法代码示例。如果您正苦于以下问题:PHP Surfer::reset方法的具体用法?PHP Surfer::reset怎么用?PHP Surfer::reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Surfer
的用法示例。
在下文中一共展示了Surfer::reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
// not found
if (!isset($item['id'])) {
include '../error.php';
// permission denied
} elseif (!$permitted) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation.'));
// no deletion in demo mode
} elseif (isset($_REQUEST['confirm']) && $_REQUEST['confirm'] == 'yes' && file_exists($context['path_to_root'] . 'parameters/demo.flag')) {
Safe::header('Status: 401 Unauthorized', TRUE, 401);
Logger::error(i18n::s('You are not allowed to perform this operation in demonstration mode.'));
// deletion is confirmed
} elseif (isset($_REQUEST['confirm']) && $_REQUEST['confirm'] == 'yes') {
// close the session on self-deletion
if (Surfer::get_id() == $item['id']) {
Surfer::reset();
}
// attempt to delete
if (Users::delete($item['id'])) {
// log item deletion
$label = sprintf(i18n::c('Deletion: %s'), strip_tags($item['nick_name']));
$description = Users::get_permalink($item);
Logger::remember('users/delete.php: ' . $label, $description);
// this can appear anywhere
Cache::clear();
// back to the index page
Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/');
}
// deletion has to be confirmed
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
Logger::error(i18n::s('The action has not been confirmed.'));