本文整理匯總了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.'));