Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 32 Ответов
  • 6964 Просмотров
*

dmitry_stas

  • Легенда
  • 13151
  • 1234 / 8
в тех комментариях используется антибот. потому что CAPTCHA - это прошлый век :) тренде сезона - это чтобы юзеру ничего не надо было делать, но при этом спама не было :)

ссылки никакой нет, название текущего сайта выводится. и то, зависит от плагина самой CAPTCHA. например в рекапче такого вывода нет.
Тут дарят бакс просто за регистрацию! Успей получить!
Все советы на форуме раздаю бесплатно, то есть даром. Индивидуально бесплатно консультирую только по вопросам стоимости индивидуальных консультаций
*

specnazov

  • Осваиваюсь на форуме
  • 25
  • 0 / 0
ссылки никакой нет, название текущего сайта выводится. и то, зависит от плагина самой CAPTCHA. например в рекапче такого вывода нет.

Спасибо успокоили.  ;)
*

Nobillis

  • Осваиваюсь на форуме
  • 43
  • 0 / 0
у меня такая же ерунда...
мол ошибка в recaptcha_ajax.js (строка 103)
адрес скрипта:
http://api.recaptcha.net/js/recaptcha_ajax.js
что делать не знаю... может у кого то есть мысли по этому поводу?


Сегодня столкнулся с такой-же проблемой, старенький сайт на Joomla 2.5 + JoomShopping 3.16.0
Первое что нужно сделать для установки CAPTCHA v2 для JoomShopping - это выкачать у них плагин: https://www.webdesigner-profi.de/joomla-webdesign/shop/plugins/registration-captcha.html?lang=ru
в моем случае это был Registration captcha 1.0.1, устанавливаем и делаем настройки по инструкции на этой же странице..)
Далее меняем содержимое файла plugins\captcha\recaptcha\recaptcha.php на следующее:
Код
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Captcha
 *
 * [member=126442]copyright[/member]   Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

jimport('joomla.environment.browser');

/**
 * Recaptcha Plugin.
 * Based on the official recaptcha library( https://developers.google.com/recaptcha/docs/php )
 *
 * @package     Joomla.Plugin
 * @subpackage  Captcha
 * @since       2.5
 */
class plgCaptchaRecaptcha extends JPlugin {
const RECAPTCHA_API_SERVER = "http://www.google.com/recaptcha/api";
const RECAPTCHA_API_SECURE_SERVER = "https://www.google.com/recaptcha/api";
const RECAPTCHA_VERIFY_SERVER = "www.google.com";

public function __construct($subject, $config) {
parent::__construct($subject, $config);
$this->loadLanguage();
}

/**
* Initialise the captcha
*
* @param string $id The id of the field.
*
* @return Boolean True on success, false otherwise
*
* @since  2.5
*/
public function onInit($id) {
// Initialise variables
$lang = $this->_getLanguage();
$pubkey = $this->params->get('public_key', '');
$theme = $this->params->get('theme', 'clean');

if ($pubkey == null || $pubkey == '') {
throw new Exception(JText::_('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY'));
}

$server = self::RECAPTCHA_API_SERVER;
if (JBrowser::getInstance()->isSSLConnection()) {
$server = self::RECAPTCHA_API_SECURE_SERVER;
}

$language = JFactory::getLanguage();
$tag = explode('-', $language->getTag());
$tag = $tag[0];
JHtml::_('script', $server.'.js?hl='.$tag.'" async defer="defer');
return true;
}

/**
* Gets the challenge HTML
*
* @return  string  The HTML to be embedded in the form.
*
* @since  2.5
*/
public function onDisplay($name, $id, $class) {
$pubkey = $this->params->get('public_key', '');
//return '<div id="dynamic_recaptcha_1" data-sitekey="'.$pubkey.'" class="g-recaptcha"></div>';
return '<div class="g-recaptcha" data-sitekey="'.$pubkey.'"></div>';
}

/**
  * Calls an HTTP POST function to verify if the user's guess was correct
  *
  * @return  True if the answer is correct, false otherwise
  *
  * @since  2.5
  */
public function onCheckAnswer($code) {
// Initialise variables
$privatekey = $this->params->get('private_key');
$remoteip = JRequest::getVar('X_FORWARDED_FOR',$_SERVER["HTTP_X_FORWARDED_FOR"]);
if (empty($remoteip)) {
$remoteip = JRequest::getVar('REMOTE_ADDR', '', 'SERVER');
}
$response = JRequest::getString('g-recaptcha-response');


// Check for Private Key
if (empty($privatekey)) {
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_PRIVATE_KEY'));
return false;
}

// Check for IP
if (empty($remoteip)) {
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_NO_IP'));
return false;
}

// Discard spam submissions
if ($response == null || strlen($response) == 0) {
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_EMPTY_SOLUTION'));
return false;
}

$response = $this->_recaptcha_https_post(
self::RECAPTCHA_VERIFY_SERVER,
"/recaptcha/api/siteverify",
array(
'secret' => $privatekey,
'remoteip' => $remoteip,
'response' => $response
)
);

if ( $response->{'success'} == '1') {
return true;
} else {
//@todo use exceptions here
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_'.strtoupper(str_replace('-', '_', $response->{'error-codes'}[0]))));
return false;
}
}

/**
* Encodes the given data into a query string format.
*
* @param   string  $data  Array of string elements to be encoded
*
* @return  string  Encoded request
*
* @since  2.5
*/
private function _recaptcha_qsencode($data)
{
$req = "";
foreach ($data as $key => $value)
{
$req .= $key . '=' . urlencode(stripslashes($value)). '&';
}

// Cut the last '&'
$req = rtrim($req, '&');
return $req;
}

/**
* Submits an HTTP POST to a reCAPTCHA server.
*
* @param   string  $host
* @param   string  $path
* @param   array   $data
* @param   int     $port
*
* @return  array   Response
*
* @since  2.5
*/
private function _recaptcha_http_post($host, $path, $data, $port = 80)
{
$req = $this->_recaptcha_qsencode($data);

$http_request  = "POST $path HTTP/1.0\r\n";
$http_request .= "Host: $host\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
$http_request .= "Content-Length: " . strlen($req). "\r\n";
$http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
$http_request .= "\r\n";
$http_request .= $req;

$response = '';
if (($fs = @fsockopen($host, $port, $errno, $errstr, 10)) == false )
{
die('Could not open socket');
}

fwrite($fs, $http_request);

while (!feof($fs))
{
// One TCP-IP packet
$response .= fgets($fs, 1160);
}

fclose($fs);
$response = explode("\r\n\r\n", $response, 2);

return $response;
}
/**
* Submits an HTTPS GET to a reCAPTCHA server.
*
* @param   string  $host
* @param   string  $path
* @param   array   $data
* @param   int     $port
*
* @return  array   Response
*
* @since  2.5
*/
private function _recaptcha_https_get($host, $path, $data, $port = 443) {

$req = $this->_recaptcha_qsencode($data);
$url = 'https://' . $host . $path .'?' . $req;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PORT, $port );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response);

return $response;
}
/**
* Submits an HTTPS POST to a reCAPTCHA server.
*
* @param   string  $host
* @param   string  $path
* @param   array   $data
* @param   int     $port
*
* @return  array   Response
*
* @since  2.5
*/
private function _recaptcha_https_post($host, $path, $data, $port = 443) {

$url = 'https://' . $host . $path;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_PORT, $port );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
   
// Get the response and close the channel.
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response);

return $response;
}

/**
* Get the language tag or a custom translation
*
* @return string
*
* @since  2.5
*/
private function _getLanguage()
{
// Initialise variables
$language = JFactory::getLanguage();

$tag = explode('-', $language->getTag());
$tag = $tag[0];
$available = array('en', 'pt', 'fr', 'de', 'nl', 'ru', 'es', 'tr');

if (in_array($tag, $available))
{
return "lang : '" . $tag . "',";
}

// If the default language is not available, let's search for a custom translation
if ($language->hasKey('PLG_RECAPTCHA_CUSTOM_LANG'))
{
$custom[] ='custom_translations : {';
$custom[] ="\t".'instructions_visual : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_VISUAL'). '",';
$custom[] ="\t".'instructions_audio : "' . JText::_('PLG_RECAPTCHA_INSTRUCTIONS_AUDIO'). '",';
$custom[] ="\t".'play_again : "' . JText::_('PLG_RECAPTCHA_PLAY_AGAIN'). '",';
$custom[] ="\t".'cant_hear_this : "' . JText::_('PLG_RECAPTCHA_CANT_HEAR_THIS'). '",';
$custom[] ="\t".'visual_challenge : "' . JText::_('PLG_RECAPTCHA_VISUAL_CHALLENGE'). '",';
$custom[] ="\t".'audio_challenge : "' . JText::_('PLG_RECAPTCHA_AUDIO_CHALLENGE'). '",';
$custom[] ="\t".'refresh_btn : "' . JText::_('PLG_RECAPTCHA_REFRESH_BTN'). '",';
$custom[] ="\t".'help_btn : "' . JText::_('PLG_RECAPTCHA_HELP_BTN'). '",';
$custom[] ="\t".'incorrect_try_again : "' . JText::_('PLG_RECAPTCHA_INCORRECT_TRY_AGAIN'). '",';
$custom[] ='},';
$custom[] ="lang : '" . $tag . "',";

return implode("\n", $custom);
}

// If nothing helps fall back to english
return '';
}
}
Все содержимое написал тут так как файлы вложений оч. часто теряются)
и последнее что нужно сделать так это заменить старые файлы мутулз на новые:
1) Меняем файлик /media/system/js/mootools-core.js на свеженький отсюда https://mootools.net/core
2) Меняем файлик /media/system/js/mootools-more.js на свеженький отсюда https://mootools.net/more
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Плагин - Вывод значения поля из таблицы продуктов в корзине JoomShopping

Автор draff

Ответов: 3
Просмотров: 752
Последний ответ 26.02.2024, 07:00:01
от kit2m2
Плагин - Товар на складе или Товар под заказ для JoomShopping [Скачать]

Автор kit2m2

Ответов: 58
Просмотров: 9203
Последний ответ 18.05.2023, 12:59:00
от Akeksandr
[Решено] Комплект товаров JoomShopping - конструктор

Автор vgromov

Ответов: 96
Просмотров: 28087
Последний ответ 14.12.2022, 15:21:24
от kit2m2
Функционал сравнение товаров в JoomShopping

Автор falur

Ответов: 53
Просмотров: 13397
Последний ответ 22.08.2022, 09:54:16
от kit2m2
[скачать] Выбор отделения Новой Почты для JoomShopping 4+

Автор v42bis

Ответов: 18
Просмотров: 3570
Последний ответ 06.07.2022, 07:17:06
от denxio