Exemple #1
0
function recaptcha_init()
{
    if (!is_recaptcha_enabled()) {
        return;
    }
    elgg_register_js('recaptcha', 'https://www.google.com/recaptcha/api.js?hl=' . get_current_language());
    elgg_register_plugin_hook_handler('actionlist', 'captcha', 'image_captcha_actionlist_hook');
    $actions = array('register', 'user/requestnewpassword');
    foreach ($actions as $action) {
        elgg_register_plugin_hook_handler('action', $action, 'recaptcha_action_hook');
    }
}
Exemple #2
0
<?php

if (is_recaptcha_enabled()) {
    ?>
    <?php 
    elgg_load_js('recaptcha');
    ?>
    <p>
        <div class="g-recaptcha" data-sitekey="<?php 
    echo elgg_get_plugin_setting('site_key', 'recaptcha');
    ?>
"></div>
    </p>
<?php 
}