Plugin Directory

Changeset 996179


Ignore:
Timestamp:
09/24/2014 04:22:40 PM (11 years ago)
Author:
buildcreate
Message:

Fixed validation error

Location:
agreeable/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • agreeable/trunk/agreeable.php

    r986028 r996179  
    44Plugin URI: http://wordpress.org/extend/plugins/agreeable
    55Description: Add a required "Agree to terms" checkbox to login and/or register forms.
    6 Version: 1.3.5
     6Version: 1.3.6
    77Author: kraftpress
    88Author URI: http://kraftpress.it
     
    3535
    3636        /* Registration Validation Hooks  */
    37         add_filter('registration_errors', array($this, 'ag_authenticate_user_acc'), 10, 2);
     37        add_filter('registration_errors', array($this, 'registration_validation'), 0, 2);
    3838        add_filter('bp_signup_validate', array($this, 'ag_authenticate_user_acc'), 10, 2);
    3939        add_filter('wpmu_validate_user_signup', array($this, 'ag_authenticate_user_acc'), 10, 3);
     
    115115
    116116        /* Plugin Stylesheet */
    117         wp_enqueue_style( 'agreeable-css', plugins_url('css/admin.css', __FILE__), '', '0.3.4', 'screen');
     117        wp_enqueue_style( 'agreeable-css', plugins_url('css/admin.css', __FILE__), '', '1.3.5', 'screen');
    118118
    119119    }
     
    132132
    133133    }
     134   
     135    function registration_validation() {
     136       
     137        $errors = new WP_error();
     138       
     139        if(isset($_REQUEST['ag_type']) && $_REQUEST['ag_type'] == 'register' && $this->options['register'] == 1) {
     140           
     141            if ( isset( $_REQUEST['ag_login_accept'] ) && $_REQUEST['ag_login_accept'] == 1) {
     142           
     143                return $errors;
     144           
     145            } else {
     146           
     147                $errors->add('ag_login_accept', $this->options['fail_text']);
     148               
     149                return $errors;
     150            }
     151           
     152        } else {
     153       
     154            return $errors;
     155           
     156        }
     157       
     158    }
    134159
    135160    function ag_authenticate_user_acc($user) {
     
    151176
    152177                unset($_SESSION['ag_errors']);
    153 
     178                           
    154179                return $user;
     180       
    155181
    156182            } else {
     
    179205                    $result = $user;
    180206                   
     207                    $result['errors'] = $errors;
     208                   
    181209                    return $result;
    182210
     
    188216
    189217        } else {
    190 
     218               
    191219            return $user;
    192220
     
    244272            if ( isset( $_REQUEST['ag_login_accept'] ) && $_REQUEST['ag_login_accept'] == 'on' ) {
    245273                // Checkbox on, allow comment
     274                do_action('agreeable_validate_user', $user, $_REQUEST['ag_type']);
    246275                return $comment;
    247276            } else {
     
    316345        echo '<div id="terms" class="mfp-hide">'.$terms_content.'</div>';
    317346        echo $type == 'comments' ? '<br>':'';
     347               
    318348    }
    319349
  • agreeable/trunk/readme.txt

    r990250 r996179  
    99
    1010== Description ==
    11 Add an "agree to terms" check box to your login, registration, or comment forms, requiring users to agree. Tested with BuddyPress and Multisite.
     11Add an "agree to terms" check box to your login, registration, or comment forms, requiring users to agree. Tested with BuddyPress and Multisite.  WooCommerce extension available.
    1212
    1313= Features =
     
    1818
    1919= Extensions =
    20 * Agreeable Login Records - Allows you to track user agreement by IP and username each time they log in. Learn more and purchase at: http://kraftpress.it/downloads/agreeable-records/
    21 * WooCommerce Integration - Integrates Agreeable's terms & conditions fields into Woocommerce login, registration, and checkout. Learn more and purchase at: http://kraftpress.it/downloads/agreeable-woocommerce/
     20* Login Records - Allows you to track user agreement by IP and username each time they log in. Learn more and purchase at: http://kraftpress.it/downloads/agreeable-records/
     21* WooCommerce - Integrates Agreeable's terms & conditions fields into Woocommerce login, registration, and checkout. Learn more and purchase at: http://kraftpress.it/downloads/agreeable-woocommerce/
    2222
    2323= Translations =
     
    3737
    3838== Changelog ==
     39
     40= 1.3.6 =
     41* Fixed bug with user registration validation
    3942
    4043= 1.3.5 =
Note: See TracChangeset for help on using the changeset viewer.