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


PHP captcha::generate_keys方法代码示例

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


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

示例1: gettext

echo "<form accept-charset=\"utf-8\" name=\"form_register\" action=\"", get_request_uri(), "\" method=\"post\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo "<div class=\"register\">\n";
echo "<h3>", gettext("Register"), "</h3>\n";
echo "<div class=\"register_inner\">\n";
if (isset($user_agree_rules) && $user_agree_rules == 'Y') {
    echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
    echo "  ", form_input_hidden('user_agree_rules', htmlentities_array($user_agree_rules)), "\n";
    echo "  <div class=\"register_username\"><span>", gettext("Username"), ":</span>", light_form_input_text("user_logon", null, 20, 15) . "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Confirm Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_nickname\"><span>", gettext("Nickname"), ":</span>", light_form_input_text("nickname", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_email\"><span>", gettext("Email"), ":</span>", light_form_input_text("email", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_dob\"><span>", gettext("Date of Birth"), ":</span>\n";
    echo "  ", light_form_dob_dropdowns(isset($new_user_prefs['DOB_YEAR']) ? htmlentities_array($new_user_prefs['DOB_YEAR']) : 0, isset($new_user_prefs['DOB_MONTH']) ? htmlentities_array($new_user_prefs['DOB_MONTH']) : 0, isset($new_user_prefs['DOB_DAY']) ? htmlentities_array($new_user_prefs['DOB_DAY']) : 0, true), "</div>\n";
    if (forum_get_setting('text_captcha_enabled', 'Y') && $text_captcha->generate_keys()) {
        if (strlen(trim($text_captcha_private_key)) > 0) {
            echo form_input_hidden("private_key", htmlentities_array($text_captcha_private_key));
            echo form_input_hidden("public_key", htmlentities_array($text_captcha->get_public_key()));
        } else {
            if (($text_captcha_image = $text_captcha->make_image()) !== false) {
                $forum_owner_email = forum_get_setting('forum_email', 'strlen', 'admin@beehiveforum.co.uk');
                $forum_owner_link = sprintf("<a href=\"mailto:%s\">%s</a>", $forum_owner_email, gettext("forum owner"));
                echo "</div>\n";
                echo "</div>\n";
                echo "<div class=\"register\">\n";
                echo "<h3>", gettext("Confirmation"), "</h3>\n";
                echo "<div class=\"register_inner\">\n";
                //echo "  <div class=\"register_confirmation\">\n";
                echo "  <div class=\"register_confirmation\">", sprintf(gettext("To prevent automated registrations this forum requires you enter a confirmation code. The code is displayed in the image below. If you are visually impaired or cannot otherwise read the code please contact the %s."), $forum_owner_link), "</div>\n";
                echo "  <div class=\"register_confirmation_image\">\n";
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:31,代码来源:lregister.php

示例2: gettext

echo "                </tr>\n";
echo "                <tr>\n";
echo "                  <td align=\"center\">\n";
echo "                    <table class=\"posthead\" width=\"95%\">\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" width=\"250\">", gettext("Use text-captcha"), ":</td>\n";
echo "                        <td align=\"left\">", form_radio("text_captcha_enabled", "Y", gettext("Yes"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'Y'), "&nbsp;", form_radio("text_captcha_enabled", "N", gettext("No"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'N' || !isset($forum_global_settings['text_captcha_enabled'])), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" width=\"270\">", gettext("Text-captcha Dir"), ":</td>\n";
echo "                        <td align=\"left\">", form_input_text("text_captcha_dir", isset($forum_global_settings['text_captcha_dir']) ? htmlentities_array($forum_global_settings['text_captcha_dir']) : "text_captcha", 35, 255), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" colspan=\"2\">\n";
if (isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == "Y") {
    if (!$text_captcha->generate_keys() || !$text_captcha->make_image()) {
        if ($errno = $text_captcha->get_error()) {
            switch ($errno) {
                case TEXT_CAPTCHA_NO_FONTS:
                    html_display_error_msg(gettext("Text-captcha has been disabled automatically because there are no true type fonts available for it to use. Please upload some true type fonts to <b>text_captcha/fonts</b> on your server."), '95%', 'center');
                    break;
                case TEXT_CAPTCHA_DIR_ERROR:
                    html_display_error_msg(gettext("Text-captcha has been disabled because the text_captcha directory and it's sub-directories are not writable by the web server / PHP process."), '95%', 'center');
                    break;
                case TEXT_CAPTCHA_GD_ERROR:
                    html_display_error_msg(gettext("Text-captcha has been disabled because your server's PHP setup does not provide support for GD Image manipulation and / or TTF font support. Both are required for text-captcha support."), '95%', 'center');
                    break;
            }
        }
    }
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:admin_default_forum_settings.php

示例3: header

         header_status(500, 'Internal Server Error');
         exit;
     }
     header('Content-Type: application/json');
     $content = json_encode($pm_notification_data);
     break;
 case 'get_forum_stats':
     cache_check_last_modified(time() + 300);
     if (!($content = stats_get_html())) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     break;
 case 'reload_captcha':
     $text_captcha = new captcha(6, 15, 25, 9, 30);
     if (!$text_captcha->generate_keys()) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     if (!($text_captcha_image = $text_captcha->make_image())) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     cache_disable();
     header('Content-Type: application/json');
     $content = json_encode(array('image' => sprintf("data:image/jpeg;base64,%s", base64_encode(file_get_contents($text_captcha_image))), 'chars' => $text_captcha->get_num_chars(), 'key' => $text_captcha->get_public_key()));
     break;
 case 'font_size_larger':
 case 'font_size_smaller':
     if (!session::logged_in()) {
         break;
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:ajax.php


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