当前位置: 首页>>代码示例>>PHP>>正文


PHP Captcha::is_available方法代码示例

本文整理汇总了PHP中Captcha::is_available方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::is_available方法的具体用法?PHP Captcha::is_available怎么用?PHP Captcha::is_available使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Captcha的用法示例。


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

示例1: array

 }
 if (!empty($errstr)) {
     $Errorh->handler($errstr, E_USER_NOTICE);
 }
 if (isset($LANG[$get_erroru])) {
     $Errorh->handler($LANG[$get_erroru], E_USER_WARNING);
 }
 $Template->assign_vars(array('C_REGISTER' => true));
 if ($CONFIG_USER['activ_mbr'] == '1') {
     $Template->assign_block_vars('activ_mbr', array('L_ACTIV_MBR' => $LANG['activ_mbr_mail']));
 } elseif ($CONFIG_USER['activ_mbr'] == '2') {
     $Template->assign_block_vars('activ_mbr', array('L_ACTIV_MBR' => $LANG['activ_mbr_admin']));
 }
 import('util/captcha');
 $Captcha = new Captcha();
 if ($Captcha->is_available() && $CONFIG_USER['verif_code'] == '1') {
     $Captcha->set_difficulty($CONFIG_USER['verif_code_difficulty']);
     $Template->assign_vars(array('C_VERIF_CODE' => true, 'VERIF_CODE' => $Captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $Captcha->js_require()));
 }
 if ($CONFIG_USER['activ_up_avatar'] == 1) {
     $Template->assign_block_vars('upload_avatar', array('WEIGHT_MAX' => $CONFIG_USER['weight_max'], 'HEIGHT_MAX' => $CONFIG_USER['height_max'], 'WIDTH_MAX' => $CONFIG_USER['width_max']));
 }
 $array_identifier = '';
 $lang_identifier = '../images/stats/other.png';
 foreach ($LANGS_CONFIG as $lang => $array_info) {
     if ($array_info['secure'] == -1) {
         $info_lang = load_ini_file('../lang/', $lang);
         $selected = '';
         if ($CONFIG['lang'] == $lang) {
             $selected = ' selected="selected"';
             $lang_identifier = '../images/stats/countries/' . $info_lang['identifier'] . '.png';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:register.php

示例2: display


//.........这里部分代码省略.........
                 $Template->assign_vars(array('COM_LOCK' => true, 'IMG' => $this->lock_com >= 1 ? 'unlock' : 'lock', 'L_LOCK' => $this->lock_com >= 1 ? $LANG['unlock'] : $LANG['lock'], 'U_LOCK' => $this->path . ($this->lock_com >= 1 ? $vars_simple . '&lock=0&token=' . $Session->get_token() : $vars_simple . '&lock=1&token=' . $Session->get_token()) . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '')));
             }
             $get_error = !empty($_GET['errorh']) ? trim($_GET['errorh']) : '';
             $errno = E_USER_NOTICE;
             switch ($get_error) {
                 case 'auth':
                     $errstr = $LANG['e_unauthorized'];
                     $errno = E_USER_WARNING;
                     break;
                 case 'verif':
                     $errstr = $LANG['e_incorrect_verif_code'];
                     $errno = E_USER_WARNING;
                     break;
                 case 'l_flood':
                     $errstr = sprintf($LANG['e_l_flood'], $CONFIG_COM['max_link']);
                     break;
                 case 'l_pseudo':
                     $errstr = $LANG['e_link_pseudo'];
                     break;
                 case 'flood':
                     $errstr = $LANG['e_flood'];
                     break;
                 case 'incomplete':
                     $errstr = $LANG['e_incomplete'];
                     break;
                 default:
                     $errstr = '';
             }
             $Errorh->set_template($Template);
             if (!empty($errstr)) {
                 $Template->assign_vars(array('ERROR_HANDLER' => $Errorh->display($errstr, E_USER_NOTICE)));
             }
             if (!$this->lock_com || $User->check_level(MODO_LEVEL)) {
                 if ($captcha->is_available() && $CONFIG_COM['com_verif_code']) {
                     $Template->assign_vars(array('C_VERIF_CODE' => true, 'VERIF_CODE' => $captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $captcha->js_require()));
                 }
                 if ($User->check_level($CONFIG_COM['com_auth'])) {
                     $Template->assign_vars(array('AUTH_POST_COM' => true));
                 } else {
                     $Template->assign_vars(array('ERROR_HANDLER' => $Errorh->display($LANG['e_unauthorized'], E_USER_NOTICE)));
                 }
                 if ($User->get_attribute('user_id') !== -1) {
                     $Template->assign_vars(array('C_HIDDEN_COM' => true, 'LOGIN' => $User->get_attribute('login')));
                 } else {
                     $Template->assign_vars(array('C_VISIBLE_COM' => true, 'LOGIN' => $LANG['guest']));
                 }
             } else {
                 $Template->assign_vars(array('ERROR_HANDLER' => $Errorh->display($LANG['com_locked'], E_USER_NOTICE)));
             }
             $get_pos = strpos($_SERVER['QUERY_STRING'], '&pc');
             if ($get_pos) {
                 $get_page = substr($_SERVER['QUERY_STRING'], 0, $get_pos) . '&pc';
             } else {
                 $get_page = $_SERVER['QUERY_STRING'] . '&pc';
             }
             $is_modo = $User->check_level(MODO_LEVEL);
             $Template->assign_vars(array('C_COM_DISPLAY' => $this->get_attribute('nbr_com') > 0 ? true : false, 'C_IS_MODERATOR' => $is_modo, 'PAGINATION_COM' => $pagination->display($this->path . $vars_simple . '&pc=%d#anchor_' . $this->script, $this->nbr_com, 'pc', $CONFIG_COM['com_max'], 3), 'LANG' => get_ulang(), 'IDCOM' => '', 'IDPROV' => $this->idprov, 'SCRIPT' => $this->script, 'PATH' => SCRIPT, 'UPDATE' => $integrated_in_environment == true ? SID : '', 'VAR' => $vars_simple, 'KERNEL_EDITOR' => display_editor($this->script . 'contents', $CONFIG_COM['forbidden_tags']), 'C_BBCODE_TINYMCE_MODE' => $User->get_attribute('user_editor') == 'tinymce', 'L_XML_LANGUAGE' => $LANG['xml_lang'], 'L_TITLE' => $CONFIG['com_popup'] == 0 || $integrated_in_environment === true ? $LANG['title_com'] : '', 'THEME' => get_utheme(), 'CONTENTS' => unparse($contents), 'L_REQUIRE_LOGIN' => $LANG['require_pseudo'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_DELETE_MESSAGE' => $LANG['alert_delete_msg'], 'L_ADD_COMMENT' => $LANG['add_comment'], 'L_PUNISHMENT_MANAGEMENT' => $LANG['punishment_management'], 'L_WARNING_MANAGEMENT' => $LANG['warning_management'], 'L_LOGIN' => $LANG['pseudo'], 'L_MESSAGE' => $LANG['message'], 'L_QUOTE' => $LANG['quote'], 'L_RESET' => $LANG['reset'], 'L_PREVIEW' => $LANG['preview'], 'L_SUBMIT' => $LANG['submit'], 'U_ACTION' => $this->path . sprintf($this->vars, $this->idcom) . (!empty($page_path_to_root) && !$integrated_in_environment ? '&path_to_root=' . $page_path_to_root : '') . '&token=' . $Session->get_token()));
             $array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
             $Cache->load('ranks');
             $j = 0;
             $result = $Sql->query_while("SELECT c.idprov, c.idcom, c.login, c.timestamp, m.user_id, m.login as mlogin, m.level, m.user_mail, m.user_show_mail, m.timestamp AS registered, m.user_avatar, m.user_msg, m.user_local, m.user_web, m.user_sex, m.user_msn, m.user_yahoo, m.user_sign, m.user_warning, m.user_ban, m.user_groups, s.user_id AS connect, c.contents\n\t\t\t\tFROM " . DB_TABLE_COM . " c\n\t\t\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = c.user_id\n\t\t\t\tLEFT JOIN " . DB_TABLE_SESSIONS . " s ON s.user_id = c.user_id AND s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n\t\t\t\tWHERE c.script = '" . $this->script . "' AND c.idprov = '" . $this->idprov . "'\n\t\t\t\tGROUP BY c.idcom\n\t\t\t\tORDER BY c.timestamp DESC\n\t\t\t\t" . $Sql->limit($pagination->get_first_msg($CONFIG_COM['com_max'], 'pc'), $CONFIG_COM['com_max']), __LINE__, __FILE__);
             while ($row = $Sql->fetch_assoc($result)) {
                 list($edit, $del) = array(false, false);
                 $is_guest = empty($row['user_id']);
                 if ($is_modo || $row['user_id'] == $User->get_attribute('user_id') && $User->get_attribute('user_id') !== -1) {
                     list($edit, $del) = array(true, true);
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:67,代码来源:comments.class.php

示例3: is_enabled

 private function is_enabled()
 {
     return !AppContext::get_current_user()->check_level(User::MEMBER_LEVEL) && $this->captcha->is_available();
 }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:4,代码来源:FormFieldCaptcha.class.php

示例4: sprintf

     case 'l_flood':
         $errstr = sprintf($LANG['e_l_flood'], $CONFIG_GUESTBOOK['guestbook_max_link']);
         break;
     case 'l_pseudo':
         $errstr = $LANG['e_link_pseudo'];
         break;
     case 'incomplete':
         $errstr = $LANG['e_incomplete'];
         break;
     default:
         $errstr = '';
 }
 if (!empty($errstr)) {
     $Errorh->handler($errstr, E_USER_NOTICE);
 }
 if ($captcha->is_available() && $CONFIG_GUESTBOOK['guestbook_verifcode']) {
     $Template->assign_vars(array('C_VERIF_CODE' => true, 'VERIF_CODE' => $captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $captcha->js_require()));
 }
 $nbr_guestbook = $Sql->count_table('guestbook', __LINE__, __FILE__);
 import('util/pagination');
 $Pagination = new Pagination();
 $Template->assign_vars(array('UPDATE' => url('?token=' . $Session->get_token()), 'PAGINATION' => $Pagination->display('guestbook' . url('.php?p=%d'), $nbr_guestbook, 'p', 10, 3), 'KERNEL_EDITOR' => display_editor('guestbook_contents', $CONFIG_GUESTBOOK['guestbook_forbidden_tags']), 'L_ALERT_TEXT' => $LANG['require_text'], 'L_DELETE_MSG' => $LANG['alert_delete_msg'], 'L_ADD_MSG' => $LANG['add_msg'], 'L_REQUIRE' => $LANG['require'], 'L_MESSAGE' => $LANG['message'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_PSEUDO' => $LANG['pseudo'], 'L_SUBMIT' => $LANG['submit'], 'L_PREVIEW' => $LANG['preview'], 'L_RESET' => $LANG['reset'], 'L_ON' => $LANG['on']));
 $array_ranks = array(-1 => $LANG['guest'], 0 => $LANG['member'], 1 => $LANG['modo'], 2 => $LANG['admin']);
 $Cache->load('ranks');
 $j = 0;
 $result = $Sql->query_while("SELECT g.id, g.login, g.timestamp, m.user_id, m.login as mlogin, m.level, m.user_mail, m.user_show_mail, m.timestamp AS registered, m.user_avatar, m.user_msg, m.user_local, m.user_web, m.user_sex, m.user_msn, m.user_yahoo, m.user_sign, m.user_warning, m.user_ban, m.user_groups, s.user_id AS connect, g.contents\n\tFROM " . PREFIX . "guestbook g\n\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = g.user_id\n\tLEFT JOIN " . DB_TABLE_SESSIONS . " s ON s.user_id = g.user_id AND s.session_time > '" . (time() - $CONFIG['site_session_invit']) . "'\n\tGROUP BY g.id\n\tORDER BY g.timestamp DESC\n\t" . $Sql->limit($Pagination->get_first_msg(10, 'p'), 10), __LINE__, __FILE__);
 while ($row = $Sql->fetch_assoc($result)) {
     $edit = '';
     $del = '';
     $is_guest = empty($row['user_id']);
     $is_modo = $User->check_level(MODO_LEVEL);
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:guestbook.php

示例5: retrieve

<?php

define('NO_SESSION_LOCATION', true);
require_once '../kernel/begin.php';
require_once '../kernel/header_no_display.php';
header('Content-type: image/jpeg');
$instance = retrieve(GET, 'instance', 1);
$width = retrieve(GET, 'width', 160);
$height = retrieve(GET, 'height', 50);
$font = retrieve(GET, 'font', PATH_TO_ROOT . '/kernel/data/fonts/impact.ttf');
$difficulty = retrieve(GET, 'difficulty', 4);
import('util/captcha');
$Captcha = new Captcha();
$Captcha->set_instance($instance);
$Captcha->set_width($width);
$Captcha->set_height($height);
$Captcha->set_font($font);
$Captcha->set_difficulty($difficulty);
if ($Captcha->is_available()) {
    $Captcha->display();
}
require_once '../kernel/footer_no_display.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:22,代码来源:verif_code.php

示例6: import

    if (!$CONFIG_CONTACT['contact_verifcode'] || $captcha->is_valid()) {
        import('io/mail');
        $mail = new Mail();
        if ($mail->send_from_properties($CONFIG['mail'], $mail_object, $mail_contents, $mail_from, '', 'user')) {
            $get_error = 'success';
        } else {
            $get_error = 'error';
        }
    } else {
        $get_error = 'verif';
    }
} elseif (!empty($_POST['mail_valid']) && (empty($mail_email) || empty($mail_contents))) {
    $get_error = 'incomplete';
}
###########################Affichage##############################
$Template->set_filenames(array('contact' => 'contact/contact.tpl'));
if ($get_error == 'incomplete') {
    $Errorh->handler($LANG['e_incomplete'], E_USER_NOTICE);
} elseif ($get_error == 'verif') {
    $Errorh->handler($LANG['e_incorrect_verif_code'], E_USER_WARNING);
} elseif ($get_error == 'success') {
    $Errorh->handler($LANG['success_mail'], E_USER_SUCCESS);
} elseif ($get_error == 'error') {
    $Errorh->handler($LANG['error_mail'], E_USER_WARNING);
}
if ($captcha->is_available() && $CONFIG_CONTACT['contact_verifcode']) {
    $Template->assign_vars(array('C_VERIF_CODE' => true, 'VERIF_CODE' => $captcha->display_form(), 'L_REQUIRE_VERIF_CODE' => $captcha->js_require()));
}
$Template->assign_vars(array('MAIL' => $User->get_attribute('user_mail'), 'CONTACT_OBJECT' => stripslashes(retrieve(POST, 'mail_object', '')), 'CONTACT_CONTENTS' => $mail_contents, 'L_REQUIRE_MAIL' => $LANG['require_mail'], 'L_REQUIRE_TEXT' => $LANG['require_text'], 'L_CONTACT_MAIL' => $LANG['contact_mail'], 'L_MAIL' => $LANG['mail'], 'L_VERIF_CODE' => $LANG['verif_code'], 'L_REQUIRE' => $LANG['require'], 'L_VALID_MAIL' => $LANG['valid_mail'], 'L_OBJET' => $LANG['objet'], 'L_CONTENTS' => $LANG['content'], 'L_SUBMIT' => $LANG['submit'], 'L_RESET' => $LANG['reset'], 'U_ACTION_CONTACT' => url('contact.php?token=' . $Session->get_token())));
$Template->pparse('contact');
require_once '../kernel/footer.php';
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:31,代码来源:contact.php


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