AAAA.htaccess000066600000000177151374655570006375 0ustar00 Order allow,deny Deny from all cfaction_load_recaptcha.php000066600000000600151374655570012076 0ustar00load_recaptcha.php000066600000007121151374655570010235 0ustar00 'anti_spam', 'title' => 'Anti SPAM'); var $details = array('title' => 'Load Recaptcha', 'tooltip' => 'Renders the ReCaptcha display, you need the "{ReCaptcha}" string in your form code, possibly using a "Custom Element".'); function run($form, $actiondata) { $mainframe = JFactory::getApplication(); $params = new JParameter($actiondata->params); if(!defined('RECAPTCHA_API_SERVER')){ define('RECAPTCHA_API_SERVER', $params->get('api_server')); } if(!defined('RECAPTCHA_API_SECURE_SERVER')){ define('RECAPTCHA_API_SECURE_SERVER', $params->get('api_secure_server')); } $recaptcha_load = "
".$this->recaptcha_get_html($params->get('public_key'))."
"; $script = " var RecaptchaOptions = { theme : '".$params->get('theme', 'red')."', lang : '".$params->get('lang', 'en')."' }; "; $doc = JFactory::getDocument(); $doc->addScriptDeclaration($script); //add CSS fix to the recaptcha input field $doc->addStyleDeclaration('label.recaptcha_input_area_text{line-height: 12px !important;}'); //replace the string $form->form_details->content = str_replace('{ReCaptcha}', $recaptcha_load, $form->form_details->content); } /** * Gets the challenge HTML (javascript and non-javascript version). * This is called from the browser, and the resulting reCAPTCHA HTML widget * is embedded within the HTML form it was called from. * @param string $pubkey A public key for reCAPTCHA * @param string $error The error given by reCAPTCHA (optional, default is null) * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false) * @return string - The HTML to be embedded in the user's form. */ function recaptcha_get_html($pubkey, $error = null, $use_ssl = false) { if ( $pubkey == null || $pubkey == '' ) { die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); } if ( $use_ssl ) { $server = RECAPTCHA_API_SECURE_SERVER; } else { $server = RECAPTCHA_API_SERVER; } $errorpart = ""; if ( $error ) { $errorpart = "&error=" . $error; } return ' '; } function load($clear) { if ( $clear ) { $action_params = array( 'public_key' => '6LfNoAUAAAAAAKi8QZmjv-QHOvlGtyh509SG3FzG', 'ssl_server' => '0', 'theme' => 'red', 'lang' => 'en', 'api_server' => 'http://www.google.com/recaptcha/api', 'api_secure_server' => 'https://www.google.com/recaptcha/api' ); } return array('action_params' => $action_params); } } ?>index.html000066600000000035151374655570006565 0ustar00 load_recaptcha.ctp000066600000005672151374655570010245 0ustar00
Load ReCaptcha
Header(array('settings' => 'Settings', 'advanced' => 'Advanced'), 'load_recaptcha_config_{n}'); ?> tabStart('settings'); ?> input('action_load_recaptcha_{n}_theme_config', array( 'type' => 'select', 'label' => 'Theme', 'options' => array( 'clean' => 'Clean', 'red' => 'Red', 'white' => 'White', 'blackglass' => 'Blackglass', 'custom' => 'Custom' ) ) ); ?> input('action_load_recaptcha_{n}_lang_config', array( 'type' => 'select', 'label' => 'Language', 'options' => array( 'en' => 'English', 'nt' => 'Dutch', 'fr' => 'French', 'de' => 'German', 'pt' => 'Portuguese', 'ru' => 'Russian', 'es' => 'Spanish', 'tr' => 'Turkish' ) ) ); ?> input('action_load_recaptcha_{n}_public_key_config', array('type' => 'text', 'label' => "ReCaptcha public key", 'class' => 'big_input', 'value' => '')); ?> tabEnd(); ?> tabStart('advanced'); ?> input('action_load_recaptcha_{n}_api_server_config', array('type' => 'text', 'label' => "ReCaptcha server", 'class' => 'big_input', 'value' => '')); ?> input('action_load_recaptcha_{n}_api_secure_server_config', array('type' => 'text', 'label' => "ReCaptcha secure server", 'class' => 'big_input', 'value' => '')); ?> tabEnd(); ?>