Skip to content
This repository has been archived by the owner on Sep 18, 2018. It is now read-only.

Commit

Permalink
Inicializado código para implementação de reCaptcha.
Browse files Browse the repository at this point in the history
Issue #1
  • Loading branch information
carloshenrq committed Feb 29, 2016
1 parent d093fa8 commit ba69786
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
templates_c
vendor
/*.lock
4 changes: 4 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
DEFINE('BRACP_RECOVER_RANDOM_STRING', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789');
DEFINE('BRACP_RECOVER_STRING_LENGTH', 8, false);

DEFINE('BRACP_RECAPTCHA_ENABLED', false, false);
DEFINE('BRACP_RECAPTCHA_PUBLIC_KEY', '', false);
DEFINE('BRACP_RECAPTCHA_PRIVATE_KEY', '', false);

// PAGSEGURO- CONFIGURAÇÕES DO PAGSEGURO
DEFINE('PAG_INSTALL', true, false);
if(BRACP_DEVELOP_MODE)
Expand Down
14 changes: 14 additions & 0 deletions js/jquery.bracp.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@
},
'complete' : function (jqXHR, textStatus) {
$('.bracp-ajax-loading').stop(true, true).fadeOut('fast');

// Adicionado renderização para o código re-captcha na página atual.
// Verificações serão adicionadas via servidor.
if($('.g-recaptcha').length > 0)
{
$('.g-recaptcha').each(function(){
if($(this).html().length == 0)
{
grecaptcha.render(this, {
'sitekey' : $(this).data('sitekey')
});
}
});
}
}
});

Expand Down
4 changes: 4 additions & 0 deletions templates/account.login.ajax.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
Lembrar nome de usuário
</label>

{if $smarty.const.BRACP_RECAPTCHA_ENABLED eq true}
<div class="g-recaptcha" data-sitekey="{$smarty.const.BRACP_RECAPTCHA_PUBLIC_KEY}"></div>
{/if}

<div class="bracp-form-submit">
<input class="btn" type="submit" value="Entrar"/>
<input class="btn" type="reset" value="Resetar"/>
Expand Down
4 changes: 4 additions & 0 deletions templates/default.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
<script src="{$smarty.const.PAG_STC_URL}/pagseguro/api/v2/checkout/pagseguro.lightbox.js"></script>
{/if}

{if $smarty.const.BRACP_RECAPTCHA_ENABLED eq true}
<script src="https://www.google.com/recaptcha/api.js"></script>
{/if}

<script>
{if $smarty.const.BRACP_DEVELOP_MODE eq true}
console.info("---------------------------------------\n" +
Expand Down

0 comments on commit ba69786

Please sign in to comment.