• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP enforce_authentication函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中enforce_authentication函数的典型用法代码示例。如果您正苦于以下问题:PHP enforce_authentication函数的具体用法?PHP enforce_authentication怎么用?PHP enforce_authentication使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了enforce_authentication函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: enforce_authentication

<?php

require '../../include/mellivora.inc.php';
enforce_authentication(CONFIG_UC_MODERATOR);
$rule = db_select_one('instances', array('*'), array('id' => $_SESSION['IID']));
head('Site management');
menu_management();
section_subhead('Edit Instance Settings');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/edit_settings');
echo '<div class="form-group">
      <label class="col-sm-2 control-label" for="rule">Registration Token</label>
      <div class="col-sm-10">
          <input id="rule" readonly name="rule" class="form-control" placeholder="Registration Token" value="', $rule['registrationToken'] != 0 ? $rule['registrationToken'] : 'Registration Tokens are not enabled.', '" type="text">
      </div>
    </div>';
form_hidden('action', 'edit');
echo $rule['registrationToken'] == 0 ? form_button_submit('Enable Registration Token') : form_button_submit('Disable Registration Token');
form_end();
foot();
开发者ID:ZlhlmChZ,项目名称:source-code-mell,代码行数:19,代码来源:edit_settings.php


示例2: enforce_authentication

<?php

require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
section_subhead('New hint');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_hint');
form_textarea('Body');
$opts = db_query_fetch_all('
    SELECT
       ch.id,
       ch.title,
       ca.title AS category
    FROM challenges AS ch
    LEFT JOIN categories AS ca ON ca.id = ch.category
    ORDER BY ca.title, ch.title');
form_select($opts, 'Challenge', 'id', array_get($_GET, 'id', 0), 'title', 'category');
form_input_checkbox('Visible');
form_hidden('action', 'new');
form_button_submit('Create hint');
form_end();
foot();
开发者ID:azizjonm,项目名称:ctf-engine,代码行数:23,代码来源:new_hint.php


示例3: enforce_authentication

<?php

require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_USER, true);
$time = time();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    validate_xsrf_token($_POST[CONST_XSRF_TOKEN_KEY]);
    if (CONFIG_RECAPTCHA_ENABLE_PRIVATE) {
        validate_captcha();
    }
    if ($_POST['action'] == 'submit_flag') {
        validate_id($_POST['challenge']);
        if (empty($_POST['flag'])) {
            message_error('Did you really mean to submit an empty flag?');
        }
        $submissions = db_select_all('submissions', array('correct', 'added'), array('user_id' => $_SESSION['id'], 'challenge' => $_POST['challenge']));
        // make sure user isn't "accidentally" submitting a correct flag twice
        $latest_submission_attempt = 0;
        $num_attempts = 0;
        foreach ($submissions as $submission) {
            $latest_submission_attempt = max($submission['added'], $latest_submission_attempt);
            if ($submission['correct']) {
                message_error('You may only submit a correct flag once.');
            }
            $num_attempts++;
        }
        // get challenge information
        $challenge = db_select_one('challenges', array('flag', 'category', 'case_insensitive', 'automark', 'available_from', 'available_until', 'num_attempts_allowed', 'min_seconds_between_submissions'), array('id' => $_POST['challenge']));
        $seconds_since_submission = $time - $latest_submission_attempt;
        if ($seconds_since_submission < $challenge['min_seconds_between_submissions']) {
            message_generic('Sorry', 'You may not submit another solution for this challenge for another ' . seconds_to_pretty_time($challenge['min_seconds_between_submissions'] - $seconds_since_submission));
开发者ID:azizjonm,项目名称:ctf-engine,代码行数:31,代码来源:challenges.php


示例4: enforce_authentication

<?php

require '../include/mellivora.inc.php';
require CONST_PATH_THIRDPARTY . 'nbbc/nbbc.php';
enforce_authentication();
$time = time();
$bbc = new BBCode();
$bbc->SetEnableSmileys(false);
head('Challenges');
if (isset($_GET['status'])) {
    if ($_GET['status'] == 'correct') {
        message_dialog('Congratulations! You got the flag!', 'Correct flag', 'Yay!', 'challenge-attempt correct on-page-load');
    } else {
        if ($_GET['status'] == 'incorrect') {
            message_dialog('Sorry! That wasn\'t correct', 'Incorrect flag', 'Ok', 'challenge-attempt incorrect on-page-load');
        } else {
            if ($_GET['status'] == 'manual') {
                message_inline_blue('<h1>Your submission is awaiting manual marking.</h1>', false);
            }
        }
    }
}
$categories = db_select_all('categories', array('id', 'title', 'description', 'available_from', 'available_until'), array('exposed' => 1), 'title ASC');
// determine which category to display
if (isset($_GET['category'])) {
    validate_id($_GET['category']);
    $current_category = array_search_matching_key($_GET['category'], $categories, 'id');
    if (!$current_category) {
        message_error(lang_get('no_category_for_id'), false);
    }
} else {
开发者ID:dirvuk,项目名称:mellivora,代码行数:31,代码来源:challenges.php


示例5: login_session_refresh

<?php

require '../include/mellivora.inc.php';
login_session_refresh();
if (!isset($_GET['show'])) {
    message_error(lang_get('please_request_page'));
}
$menu_data = db_select_one('dynamic_menu', array('internal_page'), array('permalink' => $_GET['show']));
if (!is_valid_id($menu_data['internal_page'])) {
    message_error(lang_get('not_a_valid_link'));
}
$content = db_select_one('dynamic_pages', array('id', 'title', 'body', 'visibility', 'min_user_class'), array('id' => $menu_data['internal_page']));
if ($content['visibility'] == 'private') {
    enforce_authentication($content['min_user_class']);
}
head($content['title']);
if (cache_start($content['id'], CONFIG_CACHE_TIME_DYNAMIC, CONST_CACHE_DYNAMIC_PAGES_GROUP)) {
    section_head($content['title']);
    require CONST_PATH_THIRDPARTY . 'nbbc/nbbc.php';
    $bbc = new BBCode();
    $bbc->SetEnableSmileys(false);
    echo $bbc->parse($content['body']);
    cache_end($content['id'], CONST_CACHE_DYNAMIC_PAGES_GROUP);
}
foot();
开发者ID:dirvuk,项目名称:mellivora,代码行数:25,代码来源:content.php



注:本文中的enforce_authentication函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP engelsystem_error函数代码示例发布时间:2022-05-15
下一篇:
PHP endtable函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap