Ejemplo n.º 1
0
$captchaGroup		= $system->config->get( 'show_captcha', '' );

if( !is_array( $captchaGroup ) )
{
	$captchaGroup	= explode( ',', $captchaGroup );
}

$usergids			= $system->my->getUsergroups();
$requiresCaptcha	= false;

foreach( $usergids as $gid )
{
	if( in_array( $gid, $captchaGroup ) )
	{
		$requiresCaptcha = true;
		break;
	}
}

if( $system->config->get( 'antispam_captcha_enable' ) && $requiresCaptcha ) { ?>
	<div class="kmt-form-captcha">
		<?php if( $system->config->get( 'antispam_captcha_type' ) == 0 || ( $system->config->get( 'antispam_captcha_type') == 1 && $system->config->get('antispam_recaptcha_public_key') && $system->config->get('antispam_recaptcha_private_key') ) ) {
			echo Komento::getCaptcha()->getHTML();
		} else {
			if( $system->config->get( 'antispam_captcha_type') == 1 && ( !$system->config->get('antispam_recaptcha_public_key') || !$system->config->get('antispam_recaptcha_private_key') ) ) {
				echo JText::_( 'COM_KOMENTO_RECAPTCHA_MISSING_KEYS' );
			}
		} ?>
	</div>
<?php }
Ejemplo n.º 2
0
	function reloadCaptcha()
	{
		$ajax 	= Komento::getAjax();
		$reload	= Komento::getCaptcha()->getReloadSyntax();
		$ajax->success( $reload );
		$ajax->send();
	}