Making WordPress.org

Changeset 5143


Ignore:
Timestamp:
03/10/2017 05:54:34 PM (8 years ago)
Author:
Otto42
Message:

Login: Switch to Invisible reCAPTCHA

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r4943 r5143  
    77
    88    $verify = array(
    9         'secret'   => RECAPTCHA_PRIVKEY,
     9        'secret'   => RECAPTCHA_INVIS_PRIVKEY,
    1010        'remoteip' => $_SERVER['REMOTE_ADDR'],
    1111        'response' => $_POST['g-recaptcha-response'],
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r4954 r5143  
    7575function wporg_login_register_scripts() {
    7676    wp_register_script( 'recaptcha-api', 'https://www.google.com/recaptcha/api.js', array(), '2' );
     77    wp_add_inline_script( 'recaptcha-api', 'function onSubmit(token) { document.getElementById("registerform").submit(); }' );
    7778
    7879    wp_register_script( 'wporg-registration', get_template_directory_uri() . '/js/registration.js', array( 'recaptcha-api', 'jquery' ), '20170219' );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php

    r4952 r5143  
    8282        </label>
    8383    </p>
    84 
    85     <p class="login-recaptcha">
    86         <div class="g-recaptcha" data-sitekey="<?php echo esc_attr( RECAPTCHA_PUBKEY ); ?>"></div>
    87     </p>
    8884    <?php
    8985        if ( $error_recapcha_status ) {
     
    9389
    9490    <p class="login-submit">
    95         <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary" value="<?php esc_attr_e( 'Create Account', 'wporg-login' ); ?>" />
     91        <input data-sitekey="<?php echo esc_attr( RECAPTCHA_INVIS_PUBKEY  ); ?>" data-callback='onSubmit' type="submit" name="wp-submit" id="wp-submit" class="g-recaptcha button button-primary" value="<?php esc_attr_e( 'Create Account', 'wporg-login' ); ?>" />
    9692    </p>
    9793
Note: See TracChangeset for help on using the changeset viewer.