function getHtmlByName($captcha) { if ($captcha == 'sweet') { //sweet-captcha //$sweetcaptcha = new $sweetcaptcha(237528,'1bdea965d3b5c76f8e181497c7f13a42','22e2f639510c142c5217bc7324fb0ba2','sweetcaptcha.php'); //require_once('sweetcaptcha.php'); return $sweetcaptcha->get_html(); } elseif ($captcha == 're') { //recaptcha $publickey = "6Lf3kAYTAAAAAGJpD5oRTiwMHDF2Enp5jjDCxOAh"; $privatekey = "6Lf3kAYTAAAAAEMVCybX4IDJtl_uEpJKuQsPc8Q5"; return recaptcha_get_html($publickey, null); } elseif ($captcha == 'playtrue') { ////playtruecaptcha stuff $ayah = new AYAH(); return $ayah->getPublisherHTML(); } elseif ($captcha == 'secureimage') { ///secure image suff $options = array(); $options['input_name'] = 'ct_captcha'; return Securimage::getCaptchaHtml($options); } }
</p> <div> <?php // show captcha HTML using Securimage::getCaptchaHtml() require_once 'securimage.php'; $options = array(); $options['input_name'] = 'ct_captcha'; // change name of input element for form post $options['disable_flash_fallback'] = false; // allow flash fallback if (!empty($_SESSION['ctform']['captcha_error'])) { // error html to show in captcha output $options['error_html'] = $_SESSION['ctform']['captcha_error']; } echo Securimage::getCaptchaHtml($options); ?> </div> <p> <br> <input type="submit" value="Submit Message"> </p> </form> </fieldset> </body> </html> <?php
$query = "SELECT title, category FROM " . $DBPrefix . "auctions WHERE id = :auc_id"; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); if ($db->numrows() > 0) { $TPL_item_title = $db->result('title'); } else { $_SESSION['msg_title'] = $ERR_622; $_SESSION['msg_body'] = $ERR_623; header('location: message.php'); exit; } $spam_html = ''; if ($system->SETTINGS['spam_reportitem'] == 1) { $resp = new Securimage(); $spam_html = $resp->getCaptchaHtml(); } if (isset($_POST['action']) && $_POST['action'] == 'reportitem') { // check errors if (empty($_POST['reason']) || isset($_POST['reason']) && $_POST['reason'] == '0') { $TPL_error_text = $ERR_INVALID_REPORT_REASON; } $auction_id = intval($_POST['id']); if ($system->SETTINGS['spam_reportitem'] == 2) { $resp = recaptcha_check_answer($system->SETTINGS['recaptcha_private'], $_POST['g-recaptcha-response']); if (!$resp) { $TPL_error_text = $MSG['752']; } } elseif ($system->SETTINGS['spam_reportitem'] == 1) { if (!$resp->check($_POST['captcha_code'])) { $TPL_error_text = $MSG['752'];
<textarea class="form-control" rows="3" id="communicationaddress" name="communicationaddress" required></textarea> </div> <div class="form-group"> <label for="permanentaddress">Permanent Address:</label> <textarea class="form-control" rows="3" id="permanentaddress" name="permanentaddress" required></textarea> </div> <div class="form-group"> <label for="numberofpropertiesholding">Number of Properties Holding:</label> <input type="text" class="form-control" allow="number" id="numberofpropertiesholding" name="numberofpropertiesholding" required> </div> <div class="form-group"> <?php echo Securimage::getCaptchaHtml(); ?> </div> <div class="form-group"> <button type="submit" class="btn btn-success m0"> Submit </button> </div> <p class="display" id="amey">Thank You Guest. Your form has been submitted.</p> </form>
function cimy_registration_form($errors = null, $show_type = 0) { global $wpdb, $start_cimy_uef_comment, $end_cimy_uef_comment, $rule_maxlen_needed, $fields_name_prefix, $wp_fields_name_prefix, $cuef_plugin_dir, $cimy_uef_file_types, $cimy_uef_textarea_types, $user_level, $cimy_uef_domain, $cimy_uef_file_images_types, $cimy_uef_text_types; if (cimy_is_at_least_wordpress35()) { cimy_switch_to_blog(); } $my_user_level = $user_level; // -1 == anonymous if (!is_user_logged_in()) { $my_user_level = -1; } $extra_fields = get_cimyFields(false, true); $wp_fields = get_cimyFields(true); if (is_multisite()) { $input_class = "cimy_uef_input_mu"; } else { $input_class = "cimy_uef_input_27"; } $options = cimy_get_options(); $tabindex = 21; echo $start_cimy_uef_comment; // needed to apply default values only first time and not in case of errors echo "\t<input type=\"hidden\" name=\"cimy_post\" value=\"1\" />\n"; if ($options['confirm_form']) { if ($show_type == 0) { echo "\t<input type=\"hidden\" name=\"register_confirmation\" value=\"1\" />\n"; } else { if ($show_type == 2) { echo "\t<input type=\"hidden\" name=\"register_confirmation\" value=\"2\" />\n"; } } } $radio_checked = array(); $i = 1; // confirmation page, all fields are plain text + hidden fields to carry over values if ($show_type == 2) { $user_email = $_POST["user_email"]; if (in_array("username", $options["wp_hidden_fields"])) { $username = $_POST["user_login"]; ?> <p id="user_login_p"> <label for="user_login"><?php _e("Username"); ?> </label><?php echo esc_html($username); ?> </p> <?php } else { $username = $user_email; } $upload_dir = cimy_uef_get_dir_or_filename(""); $dirs = glob($upload_dir . ".cimytemp_*.tmp"); if (is_array($dirs)) { foreach ($dirs as $dir) { $diff = current_time('timestamp', true) - filemtime($dir); // If older than two days delete! if ($diff > 172800) { cimy_rfr($dir . "/", "*"); if (is_dir($dir)) { rmdir($dir); } } } } $temp_user_login = "******" . sanitize_user($username) . '_' . rand() . '.tmp'; ?> <input type="hidden" name="temp_user_login" value="<?php echo esc_attr($temp_user_login); ?> " /> <input type="hidden" name="user_login" id="user_login" value="<?php echo esc_attr($username); ?> " /> <p id="user_email_p"> <label for="user_email"><?php _e("E-mail"); ?> </label><input type="hidden" name="user_email" id="user_email" value="<?php echo esc_attr($user_email); ?> " /><?php echo esc_html($user_email); ?> </p> <br /> <?php } // do first the WP fields then the EXTRA fields while ($i <= 2) { if ($i == 1) { $fields = $wp_fields; $prefix = $wp_fields_name_prefix; } else { $fields = $extra_fields; $prefix = $fields_name_prefix; $current_fieldset = -1; if (!empty($options['fieldset_title'])) { $fieldset_titles = explode(',', $options['fieldset_title']); } else { $fieldset_titles = array(); } } $tiny_mce_objects = ""; foreach ($fields as $thisField) { $field_id = $thisField['ID']; $name = $thisField['NAME']; $rules = $thisField['RULES']; $type = $thisField['TYPE']; $old_type = $type; $label = cimy_wpml_translate_string($name . "_label", $thisField["LABEL"]); $description = cimy_uef_sanitize_content(cimy_wpml_translate_string($name . "_desc", $thisField["DESCRIPTION"])); $fieldset = empty($thisField['FIELDSET']) ? 0 : $thisField['FIELDSET']; $maxlen = 0; $unique_id = $prefix . $field_id; $input_name = $prefix . esc_attr($name); $field_id_data = $input_name . "_" . $field_id . "_data"; $advanced_options = cimy_uef_parse_advanced_options($rules["advanced_options"]); // do not dupe username if ($i == 1 && $name == "USERNAME") { continue; } // showing the search then there is no need for upload buttons if ($show_type == 1) { if ($type == "password") { continue; } if (in_array($type, $cimy_uef_file_types)) { $type = "text"; } } else { if ($show_type == 2) { $type = "hidden"; } } // if the current user LOGGED IN has not enough permissions to see the field, skip it if ($rules['show_level'] == 'view_cimy_extra_fields') { if (!current_user_can($rules['show_level'])) { continue; } } else { if ($my_user_level < $rules['show_level']) { continue; } } // if show_level == anonymous then do NOT ovverride other show_xyz rules if ($rules['show_level'] == -1) { if ($show_type == 0 || $show_type == 2) { // if flag to show the field in the registration is NOT activated, skip it if (!$rules['show_in_reg']) { continue; } } else { if ($show_type == 1) { // if flag to show the field in the blog is NOT activated, skip it if (!$rules['show_in_search']) { continue; } } } } // uploading a file is not supported when confirmation email is enabled (on MS is turned on by default yes) if ((is_multisite() || $options["confirm_email"]) && in_array($type, $cimy_uef_file_types)) { continue; } if (isset($_POST[$input_name])) { if ($type == "dropdown-multi" || $old_type == "dropdown-multi") { $value = stripslashes(implode(",", $_POST[$input_name])); } else { $value = stripslashes($_POST[$input_name]); } } else { if (isset($_GET[$name])) { if ($type == "dropdown-multi" || $old_type == "dropdown-multi") { $value = stripslashes(implode(",", $_GET[$name])); } else { $value = stripslashes($_GET[$name]); } } else { if (!isset($_POST["cimy_post"])) { $value = $thisField['VALUE']; switch ($type) { case "radio": if ($value == "YES") { $value = $field_id; } else { $value = ""; } break; case "checkbox": if ($value == "YES") { $value = "1"; } else { $value = ""; } break; } } else { $value = ""; } } } if ($i != 1 && $fieldset > $current_fieldset && isset($fieldset_titles[$fieldset])) { $current_fieldset = $fieldset; if (isset($fieldset_titles[$current_fieldset])) { echo "\n\t<h2>" . esc_html(cimy_wpml_translate_string("a_opt_fieldset_title_" . $current_fieldset, $fieldset_titles[$current_fieldset])) . "</h2>\n"; } } if (!empty($description) && $type != "registration-date") { echo "\t"; echo '<p id="' . $prefix . 'p_desc_' . $field_id . '" class="description"><br />' . $description . '</p>'; echo "\n"; } echo "\t"; echo '<p id="' . $prefix . 'p_field_' . $field_id . '">'; echo "\n\t"; $obj_class = ""; switch ($type) { case "date": $obj_class = " datepicker"; case "picture-url": case "password": case "text": $obj_label = '<label for="' . $unique_id . '">' . cimy_uef_sanitize_content($label) . '</label>'; $obj_class = ' class="' . $input_class . $obj_class . '"'; $obj_name = ' name="' . $input_name . '"'; if (in_array($type, $cimy_uef_text_types)) { $obj_type = ' type="text"'; } else { $obj_type = ' type="' . $type . '"'; } $obj_value = ' value="' . esc_attr($value) . '"'; $obj_value2 = ""; $obj_checked = ""; $obj_tag = "input"; $obj_closing_tag = false; break; case "dropdown": case "dropdown-multi": // cimy_dropDownOptions uses cimy_uef_sanitize_content and esc_attr by itself $ret = cimy_dropDownOptions($label, $value); $label = $ret['label']; $html = $ret['html']; if ($type == "dropdown-multi") { $obj_name = ' name="' . $input_name . '[]" multiple="multiple" size="6"'; } else { $obj_name = ' name="' . $input_name . '"'; } $obj_label = '<label for="' . $unique_id . '">' . $label . '</label>'; $obj_class = ' class="' . $input_class . '"'; $obj_type = ''; $obj_value = ''; $obj_value2 = $html; $obj_checked = ""; $obj_tag = "select"; $obj_closing_tag = true; break; case "textarea": $obj_label = '<label for="' . $unique_id . '">' . cimy_uef_sanitize_content($label) . '</label>'; $obj_class = ' class="' . $input_class . '"'; $obj_name = ' name="' . $input_name . '"'; $obj_type = ""; $obj_value = ""; $obj_value2 = esc_html($value); $obj_checked = ""; $obj_tag = "textarea"; $obj_closing_tag = true; break; case "textarea-rich": if (empty($tiny_mce_objects)) { $tiny_mce_objects = $fields_name_prefix . $field_id; } else { $tiny_mce_objects .= "," . $fields_name_prefix . $field_id; } $obj_label = '<label for="' . $unique_id . '">' . cimy_uef_sanitize_content($label) . '</label>'; $obj_class = ' class="' . $input_class . '"'; $obj_name = ' name="' . $input_name . '"'; $obj_type = ""; $obj_value = ""; $obj_value2 = esc_html($value); $obj_checked = ""; $obj_tag = "textarea"; $obj_closing_tag = true; break; case "checkbox": $obj_label = '<label class="cimy_uef_label_checkbox" for="' . $unique_id . '"> ' . cimy_uef_sanitize_content($label) . '</label><br />'; $obj_class = ' class="cimy_uef_checkbox"'; $obj_name = ' name="' . $input_name . '"'; $obj_type = ' type="' . $type . '"'; $obj_value = ' value="1"'; $obj_value2 = ""; $value == "1" ? $obj_checked = ' checked="checked"' : ($obj_checked = ''); $obj_tag = "input"; $obj_closing_tag = false; break; case "radio": $obj_label = '<label class="cimy_uef_label_radio" for="' . $unique_id . '"> ' . cimy_uef_sanitize_content($label) . '</label>'; $obj_class = ' class="cimy_uef_radio"'; $obj_name = ' name="' . $input_name . '"'; $obj_type = ' type="' . $type . '"'; $obj_value = ' value="' . $field_id . '"'; $obj_value2 = ""; $obj_tag = "input"; $obj_closing_tag = false; // do not check if another check was done if (intval($value) == intval($field_id) && !in_array($name, $radio_checked)) { $obj_checked = ' checked="checked"'; $radio_checked += array($name => true); } else { $obj_checked = ''; } break; case "avatar": case "picture": case "file": $allowed_exts = ''; if (isset($rules['equal_to'])) { if ($rules['equal_to'] != "") { $allowed_exts = "'" . implode("', '", explode(",", $rules['equal_to'])) . "'"; } } if ($type == "file") { // if we do not escape then some translations can break $warning_msg = esc_js(__("Please upload a file with one of the following extensions", $cimy_uef_domain)); $obj_checked = ' onchange="uploadFile(\'registerform\', \'' . $unique_id . '\', \'' . $warning_msg . '\', Array(' . $allowed_exts . '));"'; } else { // if we do not escape then some translations can break $warning_msg = esc_js(__("Please upload an image with one of the following extensions", $cimy_uef_domain)); $allowed_exts = "'" . implode("','", cimy_uef_get_allowed_image_extensions()) . "'"; $obj_checked = ' onchange="uploadFile(\'registerform\', \'' . $unique_id . '\', \'' . $warning_msg . '\', Array(' . $allowed_exts . '));"'; } $obj_label = '<label for="' . $unique_id . '">' . cimy_uef_sanitize_content($label) . ' </label>'; $obj_class = ' class="cimy_uef_picture"'; $obj_name = ' name="' . $input_name . '"'; $obj_type = ' type="file"'; $obj_value = ' value="' . esc_attr($value) . '"'; $obj_value2 = ""; $obj_tag = "input"; $obj_closing_tag = false; break; case "hidden": $obj_label = ""; $obj_value2 = ""; switch ($old_type) { case 'checkbox': $value == 1 ? $obj_value2 = __("YES", $cimy_uef_domain) : ($obj_value2 = __("NO", $cimy_uef_domain)); break; case 'radio': intval($value) == intval($field_id) ? $obj_value2 = __("YES", $cimy_uef_domain) : ($obj_value2 = __("NO", $cimy_uef_domain)); break; case 'dropdown': case 'dropdown-multi': $ret = cimy_dropDownOptions($label, $value); $label = $ret['label']; break; case 'picture': case 'avatar': case 'file': if ($old_type == "avatar") { // since avatars are drawn max to 512px then we can save bandwith resizing, do it! $rules['equal_to'] = 512; } $value = cimy_manage_upload($input_name, $temp_user_login, $rules, false, false, $old_type, !empty($advanced_options["filename"]) ? $advanced_options["filename"] : ""); $file_on_server = cimy_uef_get_dir_or_filename($temp_user_login, $value, false); $file_thumb = cimy_uef_get_dir_or_filename($temp_user_login, $value, true); if (!empty($advanced_options["no-thumb"]) && is_file($file_thumb)) { rename($file_thumb, $file_on_server); } // yea little trick empty($value) ? $obj_value2 = " " : ($obj_value2 = esc_html(basename($value))); break; } if ($old_type != "password") { $obj_label = '<label for="' . $unique_id . '">' . cimy_uef_sanitize_content($label) . ' </label>'; if (empty($obj_value2)) { $obj_value2 = cimy_uef_sanitize_content($value); } } $obj_class = ''; $obj_name = ' name="' . $input_name . '"'; $obj_type = ' type="hidden"'; $obj_value = ' value="' . esc_attr($value) . '"'; $obj_checked = ""; $obj_tag = "input"; $obj_closing_tag = false; break; case "registration-date": $obj_label = ''; $obj_class = ''; $obj_name = ' name="' . $input_name . '"'; $obj_type = ' type="hidden"'; $obj_value = ' value="' . esc_attr($value) . '"'; $obj_value2 = ""; $obj_checked = ""; $obj_tag = "input"; $obj_closing_tag = false; break; } $obj_id = ' id="' . $unique_id . '"'; // tabindex not used in MU, WordPress 3.5+ and Theme My Login dropping... if (is_multisite() || cimy_is_at_least_wordpress35() || cimy_uef_is_theme_my_login_register_page()) { $obj_tabindex = ""; } else { $obj_tabindex = ' tabindex="' . strval($tabindex) . '"'; $tabindex++; } $obj_maxlen = ""; if (in_array($type, $rule_maxlen_needed) && !in_array($type, $cimy_uef_file_types)) { if (isset($rules['max_length'])) { $obj_maxlen = ' maxlength="' . $rules['max_length'] . '"'; } else { if (isset($rules['exact_length'])) { $obj_maxlen = ' maxlength="' . $rules['exact_length'] . '"'; } } } if (in_array($type, $cimy_uef_textarea_types)) { $obj_rowscols = ' rows="3" cols="25"'; } else { $obj_rowscols = ''; } echo "\t"; $form_object = '<' . $obj_tag . $obj_type . $obj_name . $obj_id . $obj_class . $obj_value . $obj_checked . $obj_maxlen . $obj_rowscols . $obj_tabindex; if ($obj_closing_tag) { $form_object .= ">" . $obj_value2 . "</" . $obj_tag . ">"; } else { if ($type == "hidden") { $form_object .= " />" . $obj_value2; if (in_array($old_type, $cimy_uef_file_types)) { $f_size = empty($_FILES[$input_name]['size']) ? 0 : $_FILES[$input_name]['size']; $f_type = empty($_FILES[$input_name]['type']) ? "" : $_FILES[$input_name]['type']; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_size\" id=\"" . esc_attr($field_id_data) . "_size\" value=\"" . esc_attr(strval($f_size / 1024)) . "\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_type\" id=\"" . esc_attr($field_id_data) . "_type\" value=\"" . esc_attr(strval($f_type)) . "\" />"; } if (in_array($old_type, $cimy_uef_file_images_types) && is_file($file_on_server)) { echo '<img id="' . esc_attr($field_id_data) . '" src="' . esc_attr($value) . '" alt="picture" /><br />'; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_button\" id=\"" . esc_attr($field_id_data) . "_button\" value=\"1\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_x1\" id=\"" . esc_attr($field_id_data) . "_x1\" value=\"\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_y1\" id=\"" . esc_attr($field_id_data) . "_y1\" value=\"\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_x2\" id=\"" . esc_attr($field_id_data) . "_x2\" value=\"\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_y2\" id=\"" . esc_attr($field_id_data) . "_y2\" value=\"\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_w\" id=\"" . esc_attr($field_id_data) . "_w\" value=\"\" />"; echo "<input type=\"hidden\" name=\"" . esc_attr($field_id_data) . "_h\" id=\"" . esc_attr($field_id_data) . "_h\" value=\"\" />"; $imgarea_options = "handles: true, fadeSpeed: 200, onSelectChange: preview"; if (isset($advanced_options["crop_x1"]) && isset($advanced_options["crop_y1"]) && isset($advanced_options["crop_x2"]) && isset($advanced_options["crop_y2"])) { $imgarea_options .= ", x1: " . intval($advanced_options["crop_x1"]); $imgarea_options .= ", y1: " . intval($advanced_options["crop_y1"]); $imgarea_options .= ", x2: " . intval($advanced_options["crop_x2"]); $imgarea_options .= ", y2: " . intval($advanced_options["crop_y2"]); } if (!empty($advanced_options["crop_ratio"])) { $imgarea_options .= ", aspectRatio: '" . esc_js($advanced_options["crop_ratio"]) . "'"; } else { if ($type == "avatar") { $imgarea_options .= ", aspectRatio: '1:1'"; } } echo "<script type='text/javascript'>jQuery(document).ready(function () { jQuery('#" . esc_js($field_id_data) . "').imgAreaSelect({ " . $imgarea_options . " }); });</script>"; } } else { $form_object .= " />"; } } if ($type != "radio" && $type != "checkbox") { echo $obj_label; } if (is_multisite() && is_wp_error($errors)) { if ($errmsg = $errors->get_error_message($unique_id)) { echo '<p class="error">' . $errmsg . '</p>'; } } // TinceMCE needed and we have WordPress >= 3.3 yummy! if ($type == "textarea-rich" && function_exists("wp_editor")) { ?> <script type='text/javascript'> var login_div = document.getElementById("login"); login_div.style.width = "535px"; </script> <?php $quicktags_settings = array('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close'); $editor_settings = array('textarea_name' => $input_name, 'teeny' => false, 'textarea_rows' => '10', 'dfw' => false, 'media_buttons' => true, 'tinymce' => true, 'quicktags' => $quicktags_settings); if (!empty($obj_tabindex)) { $editor_settings['tabindex'] = $tabindex; } wp_editor($value, $unique_id, $editor_settings); } else { echo $form_object; } if ($type == "date") { echo cimy_uef_date_picker_options($unique_id, $rules); } if ($show_type == 0 && $i == 1 && $options['password_meter']) { if ($input_name == $prefix . "PASSWORD") { $pass1_id = $unique_id; } if ($input_name == $prefix . "PASSWORD2") { echo "\n\t\t<div id=\"pass-strength-result\" class=\"hide-if-no-js\" aria-live=\"polite\">" . __('Strength indicator') . "</div>"; echo "\n\t\t<p class=\"description indicator-hint\">" . __('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).') . "</p><br />"; $pass2_id = $unique_id; } } if (!($type != "radio" && $type != "checkbox")) { echo $obj_label; } echo "\n\t</p>\n"; if ($type == "textarea-rich" || in_array($type, $cimy_uef_file_types)) { echo "\t<br />\n"; } } $i++; } echo "\t<br />"; if ($show_type != 2 && $options['captcha'] == "securimage") { global $cuef_securimage_webpath; if (is_multisite()) { if (is_wp_error($errors) && ($errmsg = $errors->get_error_message("securimage_code"))) { echo '<p class="error">' . $errmsg . '</p>'; } } require_once $cuef_plugin_dir . '/securimage/securimage.php'; $captcha_options = array(); $captcha_options['image_id'] = 'captcha'; $captcha_options['input_name'] = 'securimage_response_field'; $captcha_options['input_text'] = __("Insert the code:", $cimy_uef_domain); $captcha_options['refresh_alt_text'] = __("Change image", $cimy_uef_domain); $captcha_options['refresh_title_text'] = __("Change image", $cimy_uef_domain); $captcha_options['show_audio_button'] = true; $captcha_options['show_refresh_button'] = true; echo Securimage::getCaptchaHtml($captcha_options); } if ($show_type != 2) { if (is_multisite() && is_wp_error($errors) && ($errmsg = $errors->get_error_message("recaptcha_code"))) { echo '<p class="error">' . $errmsg . '</p>'; } if ($options['captcha'] == "recaptcha2" && !empty($options['recaptcha2_site_key']) && !empty($options['recaptcha2_secret_key'])) { ?> <div class="g-recaptcha" data-sitekey="<?php echo esc_attr($options['recaptcha2_site_key']); ?> " <?php if (!empty($obj_tabindex)) { echo "data-tabindex=" . $tabindex; } $tabindex++; ?> data-size="compact" > </div> <?php } if ($options['captcha'] == "recaptcha" && !empty($options['recaptcha_public_key']) && !empty($options['recaptcha_private_key'])) { require_once $cuef_plugin_dir . '/recaptcha/recaptchalib.php'; ?> <script type='text/javascript'> var RecaptchaOptions = { lang: '<?php echo substr(get_locale(), 0, 2); ?> ' <?php if (!empty($obj_tabindex)) { echo ", tabindex: " . $tabindex; } $tabindex++; ?> }; </script> <?php // no need if Tiny MCE is present already if (empty($tiny_mce_objects)) { ?> <script type='text/javascript'> var login_div = document.getElementById("login"); login_div.style.width = "375px"; </script> <?php } echo recaptcha_get_html($options['recaptcha_public_key'], null, is_ssl()); } } cimy_switch_current_blog(true); echo $end_cimy_uef_comment; }
public static function outputCaptchaForm() { if (!class_exists("Securimage", FALSE)) { include PATH_SECURIMAGE . "/securimage.php"; } // -------------------------------------- // COLLECT DATA // -------------------------------------- $input_id = CAPTCHA_ID; if (function_exists("Securimage::getCaptchaHtml")) { // -- For Securimage 3.5.x $rand = md5(uniqid($_SERVER['REMOTE_PORT'], true)); } else { // -- For Securimage 2.0 beta $rand = "sid=" . md5(time()); } $captcha_image = PATH_SECURIMAGE . "/securimage_show.php?" . $rand; /* -- Use data-formatted image rather than binary stream: [keep for reference] $image_url = URL_PREFIX."/".PATH_SECURIMAGE."/securimage_show.php?".$rand; $image_bin = functions::acurl($image_url); $mime = "image/png"; $base64 = base64_encode($image_bin); $captcha_image = "data:".$mime.";base64,".$base64; */ // -------------------------------------- // OUTPUT DATA // -------------------------------------- // -- Alt 1: Use own html-code for captcha form $stdout = "\n <form method='POST' class='box warning background padding'>\n\n <p>This page is <a href='http://en.wikipedia.org/wiki/Captcha' style='font-weight:bold'>CAPTCHA</a>-protected to try to prevent machines from accessing the content.</p>\n\n <div style='width: 430px; margin-bottom: 2em;'>\n\n <p><img id='siimage' style='float:left; padding-right: 5px; border: 1px solid black; margin-right:10px;' src='" . $captcha_image . "'></p>\n\n <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='19' height='19' id='SecurImage_as3' align='middle'>\n <param name='allowScriptAccess' value='sameDomain'>\n <param name='allowFullScreen' value='false'>\n <param name='movie' value='" . PATH_SECURIMAGE . "/securimage_play.swf?audio=" . PATH_SECURIMAGE . "/securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5'>\n <param name='quality' value='high'>\n <param name='bgcolor' value='#ffffff'>\n <embed src='" . PATH_SECURIMAGE . "/securimage_play.swf?audio=" . PATH_SECURIMAGE . "/securimage_play.php&bgColor1=#777&bgColor2=#fff&iconColor=#000&roundedCorner=5' quality='high' bgcolor='#ffffff' width='19' height='19' name='SecurImage_as3' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>\n </object>\n\n <!-- pass a session id to the query string of the script to prevent ie caching -->\n <br><a tabindex='-1' style='border-style: none' href='" . $_SERVER["PHP_SELF"] . "' title='Refresh Image' onclick='document.getElementById(\"siimage\").src = \"" . PATH_SECURIMAGE . "/securimage_show.php?sid=\" + Math.random(); return false'><img src='" . PATH_SECURIMAGE . "/images/refresh.gif' alt='Reload Image' border='0' onclick='this.blur()' align='bottom' rel='nofollow'></a>\n\n </div>\n\n <p style='clear:both'>Please type the characters you see in the image above<br>(You can <a href='" . $_SERVER["PHP_SELF"] . "' rel='nofollow'>load a new image</a> if you cannot see the characters clearly.)</p>\n <p><input type='text' id='" . $input_id . "' name='" . $input_id . "' size='12'>\n <input type='submit' value='Submit'></p>\n\n </form>\r\n" . "\r\n"; if (isInPath("_admin") && function_exists("Securimage::getCaptchaHtml")) { // -- Alt 2: Use the bundled html-generating method for captcha form (NOP) $options = array("securimage_path" => PATH_SECURIMAGE, "image_id" => "captcha_image", "image_alt_text" => "CAPTCHA Image", "show_audio_button" => true, "show_refresh_button" => true, "show_text_input" => true, "refresh_alt_text" => "Refresh Image", "refresh_title_text" => "Refresh Image", "input_id" => CAPTCHA_ID, "input_name" => CAPTCHA_ID, "input_text" => "Type the text:", "input_attributes" => array(), "image_attributes" => array(), "audio_button_bgcol" => "#ff0", "audio_icon_url" => null, "audio_play_url" => null, "audio_swf_url" => null, "error_html" => null, "namespace" => ""); $stdout = Securimage::getCaptchaHtml($options); } // end if (isInPath("_admin")) return $stdout; }
$q = "select username, real_name, email from user where id=" . $_SESSION['id']; $res =& $db->query($q); if (!PEAR::isError($res)) { if ($row = $res->fetchRow()) { if (isset($row['real_name'])) { $t->assign('name', $row['real_name']); } else { if (isset($row['username'])) { $t->assign('name', $row['username']); } } if (isset($row['email'])) { $t->assign('email', $row['email']); } } // Free the result $res->free(); } } if (isset($_GET['objNum'])) { $t->assign('subject', 'Feedback on Object: ' . $_GET['objNum']); } else { $t->assign('subject', 'Feedback on Delphi'); } if (isset($_GET['objId'])) { $t->assign('objId', $_GET['objId']); } else { $t->assign('objId', -1); } $t->assign('captchaHtml', Securimage::getCaptchaHtml()); $t->display('contact.tpl');
function checkSubmitValues() { // Errors to show if we find any $msg = array(); global $t; // reassign vars to user input in case we need to send them back to fix something. $t->assign('email', cleanFormData($_POST['email'])); $t->assign('user', cleanFormData($_POST['user'])); if (strlen($_POST['pass']) < 6) { array_push($msg, "Your password must be at least 6 characters."); } if (strlen($_POST['pass']) > 25) { array_push($msg, "Your password cannot be more than 25 characters."); } if ($_POST['pass'] != $_POST['pass2']) { array_push($msg, "Your retyped password did not match the first typed password."); } /* Spruce up username, check length */ if (strlen(stripslashes($_POST['user'])) > 40 || strlen(stripslashes($_POST['user'])) < 3) { array_push($msg, "Username must be between 3 and 40 characters."); } elseif (!preg_match('|^[a-zA-Z0-9-_]+$|i', $_POST['user'])) { array_push($msg, "Username can only contain letters, numbers, hyphens, and underscores"); } elseif (usernameTaken($_POST['user'])) { array_push($msg, "The username \"" . cleanFormData($_POST['user']) . "\"is already taken. Please pick another one."); } /* Check if email is valid */ if (!emailValid($_POST['email'])) { array_push($msg, "Email address is not valid."); } if (count($msg) <= 0) { /* Verify the captcha, but only if everything else is good */ $securimage = new Securimage(); if ($securimage->check($_POST['captcha_code']) == false) { array_push($msg, "The \"captcha\" text entered was incorrect.<br />Please try again."); } } if (count($msg) > 0) { $t->assign('messages', $msg); $t->assign('captchaHtml', Securimage::getCaptchaHtml()); $t->display('register.tpl'); die; } else { return true; } }
function lwiki_auth_securimage_generate() { require_once 'securimage.php'; $opts = array('securimage_path' => '/~murase/php/', 'image_id' => 'lwiki_simg', 'image_alt_text' => 'letters', 'input_id' => 'lwiki_simi', 'show_audio_button' => false, 'refresh_alt_text' => '別画像', 'refresh_title_text' => '別画像', 'input_text' => '上の文字:'); return '<div class="securimage-captcha">' . Securimage::getCaptchaHtml($opts) . '</div>'; }
</p> <p> <strong>URL:</strong><br /> <input type="text" name="ct_URL" size="35" value="" /> </p> <p> <strong>Message*:</strong><br /> <textarea name="ct_message" rows="12" cols="60"></textarea> </p> <p> <?php require_once 'securimage.php'; echo Securimage::getCaptchaHtml(array('input_name' => 'ct_captcha')); ?> </p> <p> <br /> <input type="submit" value="Submit Message" /> </p> </form> </fieldset> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script type="text/javascript"> $.noConflict();
/** * getCaptchaHtml */ function getCaptchaHtml($is_show_register) { // if( !$is_show_register ) return ""; $options = array('input_text' => "画像と同じ文字を入力してください:"); return Securimage::getCaptchaHtml($options); }