Новости Joomla

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

stardel

  • Завсегдатай
  • 1943
  • 22 / 0
Не отображается CAPTCHA reCapcha
« : 01.12.2013, 19:57:47 »
2.5+Вирт 2.0.Сначала он ругался что нет ключей для CAPTCHA если делать восстановление пароля, включил плагин CAPTCHA, получил два ключика на их сайте, включил отображение в Пользователях и в Общих настройках-почему то отображается тока надпись Capcha....а самого поля с символами нет(( может у кого то такое было?) Или она пока до VirtueMart просто не дошло ?) спс)
*

WorldWildWeb

  • Новичок
  • 8
  • 0 / 0
Re: Не отображается CAPTCHA reCapcha
« Ответ #1 : 02.12.2013, 15:43:36 »
Да было такое, решение не нашел применил дополнительныи плагин вот этот http://joomlaforum.ru/index.php?topic=247216.0
Вот вроде тут качал  http://joomla-extensions.kubik-rubik.de/downloads/ecc-easycalccheck-plus/joomla-25
Если наидется др решение, установить встроенную капчу чтоб она видна была, обошелсяб без этого плагина.
« Последнее редактирование: 02.12.2013, 15:50:44 от WorldWildWeb »
*

stardel

  • Завсегдатай
  • 1943
  • 22 / 0
Re: Не отображается CAPTCHA reCapcha
« Ответ #2 : 03.12.2013, 00:40:30 »
WorldWildWeb спс) с Виртом она  нормально работает?
*

slavikM

  • Захожу иногда
  • 76
  • 3 / 0
Re: Не отображается CAPTCHA reCapcha
« Ответ #3 : 12.12.2013, 11:24:44 »
Уже поднимался вопрос http://joomlaforum.ru/index.php/topic,280360.msg1394501.html#msg1394501, если что вот так должен выглядеть файл recatcha.php:
Код
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Captcha
 *
 * @copyright   Copyright (C) 2005 - 2013 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;
}

JHtml::_('script', $server.'/js/recaptcha_ajax.js');
$document = JFactory::getDocument();
$document->addScriptDeclaration('window.addEvent(\'domready\', function() {
Recaptcha.create("'.$pubkey.'", "dynamic_recaptcha_1", {theme: "'.$theme.'",'.$lang.'tabindex: 0});});'
);

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)
{
return '<div id="dynamic_recaptcha_1"></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('REMOTE_ADDR', '', 'SERVER');
$challenge = JRequest::getString('recaptcha_challenge_field', '');
$response = JRequest::getString('recaptcha_response_field', '');;

// 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 ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0)
{
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_EMPTY_SOLUTION'));
return false;
}

$response = $this->_recaptcha_http_post(self::RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
  array(
  'privatekey' => $privatekey,
  'remoteip' => $remoteip,
'challenge' => $challenge,
'response' => $response
)
  );

$answers = explode("\n", $response[1]);

if (trim($answers[0]) == 'true') {
return true;
}
else
{
//@todo use exceptions here
$this->_subject->setError(JText::_('PLG_RECAPTCHA_ERROR_'.strtoupper(str_replace('-', '_', $answers[1]))));
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;
}

/**
* 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 '';
}
}
*

WorldWildWeb

  • Новичок
  • 8
  • 0 / 0
Re: Не отображается CAPTCHA reCapcha
« Ответ #4 : 12.04.2014, 15:40:35 »
WorldWildWeb спс) с Виртом она  нормально работает?
Не пробовал
*

colibri-th

  • Осваиваюсь на форуме
  • 27
  • 0 / 0
Re: Не отображается CAPTCHA reCapcha
« Ответ #5 : 27.03.2016, 18:08:29 »
Огромное спасибо! Ещё раз убеждаюсь, что этот форум лучший по Joomla.  *DRINK*
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Не отображается баннер на Joomla 2.5

Автор MultiMatrix83

Ответов: 4
Просмотров: 1303
Последний ответ 27.12.2017, 09:45:05
от lexxbry
Не корректно отображается буква "Ы"?!

Автор raynor77

Ответов: 3
Просмотров: 1927
Последний ответ 27.05.2016, 14:58:17
от raynor77
Не отображается главная страница сайта

Автор Dem00n

Ответов: 7
Просмотров: 2008
Последний ответ 14.04.2016, 11:48:15
от vipiusss
Не отображается графика на Mobile Joomla

Автор jess

Ответов: 4
Просмотров: 1272
Последний ответ 15.01.2016, 12:51:49
от jess
Description не отображается

Автор Igooriy

Ответов: 8
Просмотров: 1354
Последний ответ 14.01.2016, 10:30:14
от Igooriy