本文整理汇总了PHP中recaptcha_get_html函数的典型用法代码示例。如果您正苦于以下问题:PHP recaptcha_get_html函数的具体用法?PHP recaptcha_get_html怎么用?PHP recaptcha_get_html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了recaptcha_get_html函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callback
function callback()
{
$this->_Authentication();
$email = $_data['email'] = $this->email;
$userData = $this->User_model->getWhere(array('email' => $email), 1);
//print"<pre>";var_dump($userData);print"</pre>";
//if(empty($this->getUserId())){
if (empty($this->user_id)) {
if (empty($this->subdomain)) {
$notRegisteredOwner = TRUE;
} else {
$notRegisteredMember = TRUE;
}
$_data['ask_name'] = TRUE;
} else {
if (empty($this->subdomain)) {
//checking if user is the owner
$siteData = $this->Site_model->getWhere(array('owner_id' => $this->getUserId()), 1);
if (empty($siteData)) {
$notRegisteredOwner = TRUE;
} else {
$registeredOwner = TRUE;
}
} else {
//checking if user is the member of site
$siteData = $this->Site_model->getWhere(array('subdomain' => $this->subdomain), 1);
$_data['subdomain_id'] = $siteData[0]['id'];
$isMember = $this->User_is_member_of_site_model->getWhere(array('user_id' => $this->getUserId(), 'site_id' => $siteData[0]['id']), 1);
if (empty($isMember)) {
$notRegisteredMember = TRUE;
}
}
}
$_data['site_name'] = $this->site_name;
$_data['firstname'] = '';
$_data['lastname'] = '';
if (!empty($notRegisteredOwner)) {
//not registered owner
$_data['captcha'] = recaptcha_get_html($this->recaptcha_publickey);
$_data['site_url'] = '';
$this->load->view('owner_registration', $_data);
} elseif (!empty($notRegisteredMember)) {
$this->load->view('member_registration', $_data);
} elseif (!empty($this->subdomain)) {
if ($isMember[0]['member_y_n']) {
//member approved
redirect('http://' . $_SERVER['HTTP_HOST'] . '/member/');
} else {
//member not approed
//print "You have not been approved yet.";
$this->load->view('member_not_approved');
}
} elseif (!empty($registeredOwner)) {
// redirecting owner to his subdomain
//redirect( 'http://' . $siteData[0]['subdomain'] . '.'.$this->conf['site_name'].'/member/');
$_data['captcha'] = recaptcha_get_html($this->recaptcha_publickey);
$_data['site_url'] = '';
$this->load->view('owner_registration', $_data);
}
}
示例2: render
/**
* @return string
*/
public function render()
{
global $Campsite;
$publicKey = $this->getPublicKey();
return recaptcha_get_html(htmlspecialchars($publicKey), NULL, $Campsite['SSL_SITE']);
}
示例3: getForm
/**
* Displays the reCAPTCHA widget.
* If $this->recaptcha_error is set, it will display an error in the widget.
*
*/
function getForm()
{
global $wgReCaptchaPublicKey, $wgReCaptchaTheme;
$useHttps = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';
$js = 'var RecaptchaOptions = ' . Xml::encodeJsVar(array('theme' => $wgReCaptchaTheme, 'tabindex' => 1));
return Html::inlineScript($js) . recaptcha_get_html($wgReCaptchaPublicKey, $this->recaptcha_error, $useHttps);
}
示例4: action
protected function action()
{
if (!TAKEDOWN_TOOL) {
throw new Exception(__METHOD__ . ' TAKEDOWN TOOL is not enabled!');
}
$view_data = ['recaptcha' => recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, null, true), 'links' => $this->request->getPostVar('links'), 'reporter_id' => $this->request->getPostVar('reporter_id')];
if (!is_null($this->request->getPostVar('links'))) {
if (recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, $this->request->getServerVar('REMOTE_ADDR'), $this->request->getPostVar('recaptcha_challenge_field'), $this->request->getPostVar('recaptcha_response_field'))->is_valid) {
if ($reporter_data = $this->_isValidReporterId($this->request->getPostVar('reporter_id'))) {
$links_to_be_removed = $this->_genRemoveLinkList($this->request->getPostVar('links'));
if (!empty($links_to_be_removed)) {
$this->_removeLinks($links_to_be_removed, $reporter_data);
$view_data = ['recaptcha' => recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, null, true), 'tot_removed_links' => count($links_to_be_removed)];
} else {
$view_data['error'] = 'No valid URLs to remove!';
}
} else {
$view_data['error'] = 'Your reporter ID is not valid!';
}
} else {
$view_data['error'] = 'Captcha code was not valid!';
}
}
$this->setViewData($view_data);
}
示例5: form
/**
* What to display in form
*
* @access public
* @return String
*/
function form($args, $options)
{
extract($args);
$output = "";
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
$use_ssl = true;
} else {
$use_ssl = false;
}
if (!function_exists('recaptcha_get_html')) {
@(require_once TDOMF_RECAPTCHALIB_PATH);
}
$output .= <<<END
\t\t<script type='text/javascript'>
\t\tvar RecaptchaOptions = { theme : '{$options['theme']}', lang : '{$options['language']}' , tabindex : 30 };
\t\t</script>
END;
$form_data = tdomf_get_form_data($args['tdomf_form_id']);
$error = null;
if (isset($form_data['recaptcha_error'])) {
$error = $form_data['recaptcha_error'];
}
$output .= recaptcha_get_html($options['publickey'], $error, $use_ssl, $options['xhtml']);
return $output;
}
示例6: render
/**
* XoopsCaptchaRecaptcha::render()
*
* @return string
*/
function render()
{
require_once dirname(__FILE__) . '/recaptcha/recaptchalib.php';
$form = "<script type=\"text/javascript\">\n var RecaptchaOptions = {\n theme : '" . $this->config['theme'] . "',\n lang : '" . $this->config['lang'] . "'\n };\n </script>";
$form .= recaptcha_get_html($this->config['public_key']);
return $form;
}
示例7: load
/**
* Load reCAPTCHA
*
* @access private
* @param string $error
* @param bool $ssl
* @param string $theme
* @return string
*/
function load($error, $ssl = FALSE)
{
$recaptcha_public_key = $this->CI->config->item('recaptcha_public_key');
$captcha = '<script type="text/javascript">var RecaptchaOptions = { theme : "' . $this->CI->config->item('recaptcha_theme') . '" };</script>';
$captcha .= recaptcha_get_html($recaptcha_public_key, $error, $ssl);
return $captcha;
}
示例8: signup_user_recaptcha
function signup_user_recaptcha($errors)
{
require WPMU_PLUGIN_DIR . '/wpmu_recaptcha_signup/recaptchalib.php';
$error = $errors->get_error_message('recaptcha');
$publickey = "6LfsGAkAAAAAAAjzKmnvmCMaSlR1aIcQUtK9bA6w";
echo recaptcha_get_html($publickey);
}
示例9: customDisplay
public function customDisplay()
{
// themes : custom <----
$display = "<script type='text/javascript'>\r\n\t\t\t\t\t\t\t\tvar RecaptchaOptions = {\r\n\t\t\t\t\t\t\t\t theme : 'custom',\r\n\t\t\t\t\t\t\t\t\tcustom_theme_widget : 'recaptcha_widget'\r\n\t\t\t\t\t\t\t\t };\r\n\t\t\t\t\t\t\t </script>";
$display .= recaptcha_get_html($this->_publicKey);
return $display;
}
示例10: publicTplFormBottom
/**
* Affichage du captcha côté public
*
* @param object $okt
* @param string $sCaptchaId
*/
public static function publicTplFormBottom($okt, $sCaptchaId)
{
if ($sCaptchaId == 'recaptcha') {
$aAcceptedLanguages = array('en', 'nl', 'fr', 'de', 'pt', 'ru', 'es', 'tr');
if (in_array($okt->user->language, $aAcceptedLanguages)) {
$sLanguage = $okt->user->language;
} elseif (in_array($okt->config->language, $aAcceptedLanguages)) {
$sLanguage = $okt->config->language;
} else {
$sLanguage = 'en';
}
echo '<script type="text/javascript">
//<![CDATA[
var RecaptchaOptions = {
theme: "' . $okt->recaptcha->config->theme . '",
lang: "' . $sLanguage . '"
};
//]]>
</script>';
require_once __DIR__ . '/recaptcha-php-1.11/recaptchalib.php';
echo recaptcha_get_html(html::escapeHTML($okt->recaptcha->config->publickey));
}
}
示例11: contact
private function contact()
{
$isSent = Request::get(0, VAR_URI) == 'send';
$options = array('name' => array(Validator::MESSAGE => 'Der Name muss mindestens 5 und darf maximal 150 Zeichen lang sein.', Validator::MIN_LENGTH => 5, Validator::MAX_LENGTH => 150), 'email' => array(Validator::MESSAGE => 'Die E-Mail-Adresse ist nicht korrekt.', Validator::CALLBACK => Validator::CB_MAIL), 'message' => array(Validator::MESSAGE => 'Die Nachricht entspricht nicht den Vorgaben (mindestens 10 Zeichen, maximal 1000 Zeichen).', Validator::MIN_LENGTH => 10, Validator::MAX_LENGTH => 1000), 'title' => array(Validator::MESSAGE => 'Der Titel entspricht nicht den Vorgaben (mindestens 5 Zeichen, maximal 100 Zeichen).', Validator::MIN_LENGTH => 5, Validator::MAX_LENGTH => 100));
$this->enableClientFormValidation($options);
// Don't validate the captcha via ajax as the session would end
if (Config::get('captcha.enable')) {
Core::loadClass('Core.Security.ReCaptcha');
$options['recaptcha_response_field'] = array(Validator::MESSAGE => 'Der Sicherheitscode wurde nicht korrekt eingegeben.', Validator::CALLBACK => 'cb_captcha_check');
}
$data = array_fill_keys(array_keys($options), '');
$data['name'] = iif(Me::get()->loggedIn(), Me::get()->getName());
$data['email'] = iif(Me::get()->loggedIn(), Me::get()->getEmail());
$this->breadcrumb->add('Kontakt');
$this->header();
if ($isSent) {
extract(Validator::checkRequest($options));
if (count($error) > 0) {
CmsPage::error($error);
} else {
CmsTools::sendMail(Config::get('general.email'), $data['title'], $data['message'], $data['email'], $data['name']);
CmsPage::ok('Die Anfrage wurde erfolgreich verschickt. Vielen Dank!');
$data['title'] = '';
$data['message'] = '';
}
}
$tpl = Response::getObject()->appendTemplate('Cms/contact/contact');
$tpl->assign('data', $data);
if (Config::get('captcha.enable')) {
$tpl->assign('captcha', recaptcha_get_html(Config::get('captcha.public_key')), false);
}
$tpl->output();
$this->footer();
}
示例12: recaptcha
/**
* Creates a reCAPTCHA to combat SPAM as well as the necessary post processing validation rules.
* Additional parameters include "recaptcha_public_key", "recaptcha_private_key" and "<a href="https://developers.google.com/recaptcha/docs/customization" target="_blank">theme</a>":
*
* <a href="https://developers.google.com/recaptcha/" target="_blank">https://developers.google.com/recaptcha/</a>
*
* @access public
* @param array An array of parameters to pass to the field type
* @return string
*/
public function recaptcha($params = array())
{
$form_builder =& $params['instance'];
if (empty($params['recaptcha_public_key'])) {
$params['recaptcha_public_key'] = $this->fuel->forms->config('recaptcha_public_key');
}
if (empty($params['recaptcha_private_key'])) {
$params['recaptcha_private_key'] = $this->fuel->forms->config('recaptcha_private_key');
}
$defaults = array('theme' => 'clean', 'error_message' => 'Please enter in a valid captcha value');
$params = $this->set_defaults($defaults, $params);
if (isset($_POST["recaptcha_response_field"])) {
$_POST[$params['key']] = $_POST["recaptcha_response_field"];
}
$params['type'] = 'none';
$func_str = '$CI =& get_instance();
$validator =& $CI->form_builder->get_validator();
$validator->add_rule("recaptcha_response_field", "required", "' . $params['error_message'] . '", array("' . $this->CI->input->post('recaptcha_response_field') . '"));
$validator->add_rule("recaptcha_response_field", "validate_recaptcha", "' . $params['error_message'] . '", array("' . $params['recaptcha_private_key'] . '"));
';
$func = create_function('$value', $func_str);
$form_builder->set_post_process($params['key'], $func);
$str = '<script>
var RecaptchaOptions = {
theme : \'' . $params['theme'] . '\'
};
</script>
';
$str .= recaptcha_get_html($params['recaptcha_public_key']);
return $str;
}
示例13: reCAPTCHA
function reCAPTCHA($title, $desc)
{
global $key, $FROM1, $mail, $subject, $MESSAGE, $c_pass;
require_once './recaptchalib.php';
$publickey = "";
// you got this from the signup page
$privatekey = "";
// (same as above)
$error = '';
if ($_POST["recaptcha_response_field"]) {
$resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if ($resp->is_valid) {
return true;
} else {
$error = $resp->error;
}
}
echo '<html><head><title>' . $title . '</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body>' . $desc . '
<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
<input type="hidden" name="key" value="' . $key . '"><input type="hidden" name="nick" value="' . $FROM1 . '"><input type="hidden" name="mail" value="' . $mail . '"><br>
<input type="hidden" name="subject" value="' . $subject . '">
<input type="hidden" name="content" value="' . $MESSAGE . '"><input type="hidden" name="url" value="">
<input type="hidden" name="delk" value="' . $c_pass . '">';
echo recaptcha_get_html($publickey, $error);
echo '<input type="submit" value="確認">
</form>
</body></html>';
return false;
}
示例14: GetRecaptchaHTML
public function GetRecaptchaHTML() {
$this->iErrorMessage = "";
require_once(TP_SOURCEPATH . '/recaptcha/recaptchalib.php');
$publickey = RECAPTCHA_PUBLIC; // you got this from the signup page
return recaptcha_get_html($publickey);
}
示例15: view
public function view()
{
// global public key of ThinPHP subscription from reCAPTCHA. You can use this.
$publickey = "6LfUVcISAAAAAKjd1Mf0XiDTGaa2cjd9DT3uur9X";
$customScript = "<script type=\"text/javascript\">var RecaptchaOptions = { theme : 'clean' };</script>";
echo $customScript . recaptcha_get_html($publickey);
}