本文整理汇总了PHP中check_tokens函数的典型用法代码示例。如果您正苦于以下问题:PHP check_tokens函数的具体用法?PHP check_tokens怎么用?PHP check_tokens使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_tokens函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_delete_selected
function do_delete_selected($logged_in_user)
{
check_tokens($logged_in_user->authenticator);
$msgs = BoincPrivateMessage::enum("userid={$logged_in_user->id}");
foreach ($msgs as $msg) {
$x = "pm_select_{$msg->id}";
if (post_str($x, true)) {
$msg = BoincPrivateMessage::lookup_id($msg->id);
$msg->delete();
}
}
Header("Location: pm.php?action=inbox&deleted=1");
}
示例2: check_get_args
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
include_once "../inc/util.inc";
include_once "../inc/prefs.inc";
include_once "../inc/prefs_project.inc";
check_get_args(array("subset", "venue", "confirmed", "cols", "tnow", "ttok"));
$user = get_logged_in_user();
check_tokens($user->authenticator);
$subset = get_str("subset");
$venue = get_str("venue");
$confirmed = get_str("confirmed", true);
$columns = get_int("cols", true);
$c = $columns ? "&cols={$columns}" : "";
if ($confirmed) {
if ($subset == "global") {
$main_prefs = prefs_parse_global($user->global_prefs);
$main_prefs->{$venue} = null;
global_prefs_update($user, $main_prefs);
} else {
$main_prefs = prefs_parse_project($user->project_prefs);
$main_prefs->{$venue} = null;
project_prefs_update($user, $main_prefs);
}
示例3: check_reply_access
$filter = false;
}
check_reply_access($logged_in_user, $forum, $thread);
if (!$sort_style) {
$sort_style = $logged_in_user->prefs->thread_sorting;
} else {
$logged_in_user->prefs->update("thread_sorting={$sort_style}");
}
$warning = null;
if ($content && !$preview) {
if (post_str('add_signature', true) == "add_it") {
$add_signature = true;
} else {
$add_signature = false;
}
check_tokens($logged_in_user->authenticator);
if (!akismet_check($logged_in_user, $content)) {
$warning = "Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again.";
$preview = tra("Preview");
} else {
create_post($content, $parent_post_id, $logged_in_user, $forum, $thread, $add_signature);
header('Location: forum_thread.php?id=' . $thread->id);
}
}
page_head(tra("Post to thread"));
show_forum_header($logged_in_user);
switch ($forum->parent_type) {
case 0:
$category = BoincCategory::lookup_id($forum->category);
show_forum_title($category, $forum, $thread);
break;