Autor Tópico: reCAPTCHA (verificação visual avançado)  (Lida 4656 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
reCAPTCHA (verificação visual avançado)
« em: 12 de Dezembro de 2010, 07:12 »
/Sources/ModSettings.php

Código: [Seleccione]
// Reporting of personal messages?
array('check', 'enableReportPM'),

Código: [Seleccione]
// Reporting of personal messages?
array('check', 'enableReportPM'),
array('check', 'recaptcha_enabled'),
array('select', 'recaptcha_theme', array('Clean' => 'Clean', 'Black Glass' => 'Black Glass', 'Red' => 'Red', 'White' => 'White')),
array('text', 'recaptcha_public_key','40'),
array('text', 'recaptcha_private_key','40'),



Sources/PersonalMessage.php

Código: [Seleccione]
$_SESSION['visual_verification_code'] .= $character_range[array_rand($character_range)];
}

Código: [Seleccione]
$_SESSION['visual_verification_code'] .= $character_range[array_rand($character_range)];
}
$context['use_recaptcha'] = !empty($modSettings['recaptcha_enabled']) && ($modSettings['recaptcha_enabled'] == 1 && !empty($modSettings['recaptcha_public_key']) && !empty($modSettings['recaptcha_private_key'])) && $user_info['posts'] < $modSettings['pm_posts_verification'] ;
if ($context['use_recaptcha'])
{
// Disable the built-in visual verification if we are using reCAPTCHA
$context['visual_verification'] = FALSE;
}


Themes/default/PersonalMessage.template.php

Código: [Seleccione]
if ($context['visual_verification'])
{
echo '
<tr>
<td align="right" valign="top">
<b>', $txt['pm_visual_verification_label'], ':</b>
</td>
<td>';
if ($context['use_graphic_library'])
echo '
<img src="', $context['verificiation_image_href'], '" alt="', $txt['pm_visual_verification_desc'], '" /><br />';
else
echo '
<img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['pm_visual_verification_desc'], '" /><br />';
echo '
<a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['pm_visual_verification_listen'], '</a><br /><br />
<input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" />
<div class="smalltext">', $txt['pm_visual_verification_desc'], '</div>
</td>
</tr>';
}


Código: [Seleccione]
if ($context['visual_verification'] || $context['use_recaptcha'])
{
echo '
<tr>
<td align="right" valign="top">
<b>', $txt['pm_visual_verification_label'], ':</b>
</td>
<td>';

if ($context['use_recaptcha'])
{
echo '
<script>
var RecaptchaOptions = {
   theme : \'', empty($modSettings['recaptcha_theme']) ? 'clean' : $modSettings['recaptcha_theme'] , '\',
};
</script>
<script type="text/javascript"
src="http://api.recaptcha.net/challenge?k=', $modSettings['recaptcha_public_key'], '">
</script>

<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=', $modSettings['recaptcha_public_key'], '"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>';
}
else
{
if ($context['use_graphic_library'])
echo '
<img src="', $context['verificiation_image_href'], '" alt="', $txt['pm_visual_verification_desc'], '" /><br />';
else
echo '
<img src="', $context['verificiation_image_href'], ';letter=1" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=2" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=3" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=4" alt="', $txt['pm_visual_verification_desc'], '" />
<img src="', $context['verificiation_image_href'], ';letter=5" alt="', $txt['pm_visual_verification_desc'], '" /><br />';
echo '
<a href="', $context['verificiation_image_href'], ';sound" onclick="return reqWin(this.href, 400, 120);">', $txt['pm_visual_verification_listen'], '</a><br /><br />
<input type="text" name="visual_verification_code" size="30" tabindex="', $context['tabindex']++, '" />
<div class="smalltext">', $txt['pm_visual_verification_desc'], '</div>
</td>
</tr>';
}
}