Joomla.it Forum

Joomla! 3 => Joomla! 3 => : ItalPascal 14 Oct 2014, 11:02:43

: RISOLTO : Errore Recaptcha - Joomla 3.3.6
: ItalPascal 14 Oct 2014, 11:02:43

Ho ricaricato un file recaptcha.php che avevo su localhost ;)

_______________
Ho attivato il plugin e inserito i codici Public e Private
Da configurazione Globale è attivo come Predefinito.


Non si vedeva il codice captcha.


Rinominato il file originale e copiato e inserito recaptcha.php


Ho trovato il codice in questo sito:


http://fossies.org/dox/Joomla_3.3.6-Stable-Full_Package/recaptcha_8php_source.html (http://fossies.org/dox/Joomla_3.3.6-Stable-Full_Package/recaptcha_8php_source.html)


Appena attivato mi dava errore in riga 2
 
 defined('_JEXEC') or die;


Ho rimesso lo stesso file originale e ora ho questo errore:


Fatal error: Call to a member function display() on a non-object in /data/vhosts/metamorphosya.com/httpdocs/modules/mod_bt_login/mod_bt_login.php on line 137

Leggendo il file vedo che in riga 137 c'è :


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


-------> RIGA 137 >   'remoteip'   => $remoteip,


            'challenge'  => $challenge,
            'response'   => $response


Controllando con google i codici sono esatti.

Mi sono perso.
: Re:Errore Recaptcha - Joomla 3.3.6
: ItalPascal 14 Oct 2014, 11:08:40
Scusate, ho messo il codice dell'errore riga 137 sbagliato, questo è quello esatto:



//setting for registration
$usersConfig = JComponentHelper::getParams ( 'com_users' );
$enabledRegistration = false;
$viewName = JRequest::getVar ( 'view', 'registry' );
$enabledRecaptcha = 'none';
if ($usersConfig->get ( 'allowUserRegistration' ) && $params->get ( "enabled_registration_tab", 1 ) == 1 && ($viewName != "registration" || $integrated_com !='') ) {
   $enabledRegistration = true;
   $enabledRecaptcha = $params->get('use_captcha', 1) == 1 ?  JFactory::getConfig ()->get ( 'captcha' ) : $params->get('use_captcha', 0);


   if ($enabledRecaptcha == 'recaptcha') {
      //    create instance captcha, get recaptcha
      $recaptchaPlg = JPluginHelper::getPlugin ( 'captcha', 'recaptcha' );
      $recaptchaPlgParams = new JRegistry ( $recaptchaPlg->params );
      $publicKey = $recaptchaPlgParams->get ( 'public_key' );
      $captcha = JCaptcha::getInstance ( 'recaptcha' );


---> RIGA 137      $reCaptcha = $captcha->display ( $publicKey, '' );


   }else if($enabledRecaptcha == 2){
      $reCaptcha = modbt_loginHelper::getBuiltinCaptcha();
   }
}
$language = JFactory::getLanguage ();
require (JModuleHelper::getLayoutPath ( 'mod_bt_login' ));
?>

: Re:Errore Recaptcha - Joomla 3.3.6
: ItalPascal 14 Oct 2014, 17:06:05
Secondo voi questa funzione è corretta così :



public function onDisplay($name, $id = 'dynamic_recaptcha_1', $class = '')
   {
      return '<div id="' . $id . '" ' . $class . '><>';




oppure è corretta in questo modo :



public function onDisplay($name, $id, $class)
{
return '<div id="dynamic_recaptcha_1"><>';
}


Alla fine della funzione tra minore e maggiore c'è comunque "barra div" , non capisco perché non lo posso inserire