diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php
index ce698225..a26b409d 100644
--- a/includes/admin/core/class-admin-notices.php
+++ b/includes/admin/core/class-admin-notices.php
@@ -38,7 +38,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
$this->localize_note();
$this->show_update_messages();
$this->check_wrong_install_folder();
- $this->admin_notice_tracking();
+ //$this->admin_notice_tracking();
$this->need_upgrade();
$this->check_wrong_licenses();
@@ -225,9 +225,32 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
function old_extensions_notice() {
$show = false;
+ $old_extensions = array(
+ 'bbpress',
+ 'followers',
+ 'friends',
+ 'instagram',
+ 'mailchimp',
+ 'messaging',
+ 'mycred',
+ 'notices',
+ 'notifications',
+ 'online',
+ 'private-content',
+ 'profile-completeness',
+ 'recaptcha',
+ 'reviews',
+ 'social-activity',
+ 'social-login',
+ 'terms-conditions',
+ 'user-tags',
+ 'verified-users',
+ 'woocommerce',
+ );
+
$slugs = array_map( function( $item ) {
return 'um-' . $item . '/um-' . $item . '.php';
- }, array_keys( UM()->dependencies()->ext_required_version ) );
+ }, $old_extensions );
$active_plugins = UM()->dependencies()->get_active_plugins();
foreach ( $slugs as $slug ) {
diff --git a/includes/class-dependencies.php b/includes/class-dependencies.php
index d25f1f9a..b0fe53b9 100644
--- a/includes/class-dependencies.php
+++ b/includes/class-dependencies.php
@@ -57,6 +57,7 @@ if ( ! class_exists( 'um\Dependencies' ) ) {
'woocommerce' => '2.0.1',
'restrict-content' => '2.0',
'beaver-builder' => '2.0',
+ 'gdpr' => '1.0.0',
);
diff --git a/includes/class-init.php b/includes/class-init.php
index 249a103e..10112ed0 100644
--- a/includes/class-init.php
+++ b/includes/class-init.php
@@ -30,6 +30,7 @@ if ( ! class_exists( 'UM' ) ) {
* @method UM_Terms_Conditions_API Terms_Conditions_API()
* @method UM_Private_Content_API Private_Content_API()
* @method UM_User_Location_API User_Location_API()
+ * @method UM_GDPR_API GDPR_API()
*
*/
final class UM extends UM_Functions {
@@ -385,47 +386,6 @@ if ( ! class_exists( 'UM' ) ) {
}
- /**
- * Show notice for customers with old extension's versions
- */
- /*function old_extensions_notice() {
- if ( ! is_admin() ) {
- return;
- }
-
- if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
- return;
- }
-
- $show = false;
-
- $slugs = array_map( function( $item ) {
- return 'um-' . $item . '/um-' . $item . '.php';
- }, array_keys( $this->dependencies()->ext_required_version ) );
-
- $active_plugins = $this->dependencies()->get_active_plugins();
- foreach ( $slugs as $slug ) {
- if ( in_array( $slug, $active_plugins ) ) {
- $plugin_data = get_plugin_data( um_path . '..' . DIRECTORY_SEPARATOR . $slug );
- if ( version_compare( '2.0', $plugin_data['Version'], '>' ) ) {
- $show = true;
- break;
- }
- }
- }
-
- if ( ! $show ) {
- return;
- }
-
- /*global $um_woocommerce;
- remove_action( 'init', array( $um_woocommerce, 'plugin_check' ), 1 );
- $um_woocommerce->plugin_inactive = true;*
-
- echo '
' . sprintf( __( '%s %s requires 2.0 extensions. You have pre 2.0 extensions installed on your site.
Please update %s extensions to latest versions. For more info see this doc.', 'ultimate-member' ), ultimatemember_plugin_name, ultimatemember_version, ultimatemember_plugin_name, 'http://docs.ultimatemember.com/article/266-updating-to-2-0-versions-of-extensions' ) . '
';
- }*/
-
-
/**
* Autoload UM classes handler
*
@@ -562,7 +522,7 @@ if ( ! class_exists( 'UM' ) ) {
$this->permalinks();
$this->modal();
$this->cron();
- $this->tracking();
+ //$this->tracking();
$this->mobile();
$this->external_integrations();
}
diff --git a/includes/core/class-access.php b/includes/core/class-access.php
index c0d601ac..7f1c1fc5 100644
--- a/includes/core/class-access.php
+++ b/includes/core/class-access.php
@@ -532,7 +532,7 @@ if ( ! class_exists( 'um\core\Access' ) ) {
if ( ! empty( $post->post_type ) && $post->post_type == 'page' ) {
if ( um_is_core_post( $post, 'login' ) || um_is_core_post( $post, 'register' ) ||
um_is_core_post( $post, 'account' ) || um_is_core_post( $post, 'logout' ) ||
- um_is_core_post( $post, 'password-reset' ) )
+ um_is_core_post( $post, 'password-reset' ) || um_is_core_post( $post, 'user' ) )
return false;
}
diff --git a/includes/core/class-fields.php b/includes/core/class-fields.php
index 9cab1a87..2dc39756 100644
--- a/includes/core/class-fields.php
+++ b/includes/core/class-fields.php
@@ -798,6 +798,11 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
return true;
}
+ $stripslashed = array_map( 'stripslashes', UM()->form()->post_form[ $key ] );
+ if ( in_array( $value, $stripslashed ) ) {
+ return true;
+ }
+
if ( in_array( html_entity_decode( $value ), UM()->form()->post_form[ $key ] ) ) {
return true;
}
@@ -1578,7 +1583,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
if ($visibility == 'view' && $this->set_mode != 'register') return;
- if (( $visibility == 'view' && $this->set_mode == 'register' ) ||
+ if ( ( $visibility == 'view' && $this->set_mode == 'register' ) ||
( isset( $data['editable'] ) && $data['editable'] == 0 && $this->set_mode == 'profile' )
) {
diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php
index 803a3e88..912be967 100644
--- a/includes/core/um-actions-profile.php
+++ b/includes/core/um-actions-profile.php
@@ -220,6 +220,9 @@ function um_user_edit_profile( $args ) {
if ( ! empty( $fields ) ) {
foreach ( $fields as $key => $array ) {
+ /*if ( ! um_can_edit_field( $fields[ $key ] ) )
+ continue;*/
+
if ( ! um_can_edit_field( $fields[ $key ] ) && isset( $fields[ $key ]['editable'] ) && ! $fields[ $key ]['editable'] )
continue;
diff --git a/includes/core/um-actions-register.php b/includes/core/um-actions-register.php
index b086bb03..3abc44ed 100644
--- a/includes/core/um-actions-register.php
+++ b/includes/core/um-actions-register.php
@@ -54,8 +54,9 @@ function um_after_insert_user( $user_id, $args ) {
//clear Users cached queue
UM()->user()->remove_cached_queue();
+ um_fetch_user( $user_id );
+ UM()->user()->set_status( um_user('status') );
if ( ! empty( $args['submitted'] ) ) {
- um_fetch_user( $user_id );
UM()->user()->set_registration_details( $args['submitted'] );
}
@@ -103,7 +104,7 @@ function um_after_insert_user( $user_id, $args ) {
*/
do_action( 'um_registration_complete', $user_id, $args );
}
-add_action( 'um_user_register', 'um_after_insert_user', 10, 2 );
+add_action( 'um_user_register', 'um_after_insert_user', 1, 2 );
/**
diff --git a/includes/core/um-filters-fields.php b/includes/core/um-filters-fields.php
index e68498ce..7f55479e 100644
--- a/includes/core/um-filters-fields.php
+++ b/includes/core/um-filters-fields.php
@@ -367,18 +367,70 @@ add_filter( 'um_get_form_fields', 'um_get_form_fields', 99 );
*/
function um_get_custom_field_array( $array, $fields ) {
- if ( isset( $array['conditions'] ) ) {
- for ( $a = 0; $a < count( $array['conditions'] ); $a++ ) {
- if ( isset( $array['conditional_value'] ) || isset( $array['conditional_value' . $a] ) ) {
- foreach ( $array['conditions'] as $key => $value ) {
- $condition_metakey = $fields[ $value[1] ]['metakey'];
+ if ( ! empty( $array['conditions'] ) ) {
+ foreach ( $array['conditions'] as $key => $value ) {
+ $condition_metakey = $fields[ $value[1] ]['metakey'];
+ if ( isset( $_POST[ $condition_metakey ] ) ) {
+ $cond_value = ( $fields[ $value[1] ]['type'] == 'radio' ) ? $_POST[ $condition_metakey ][0] : $_POST[ $condition_metakey ];
+ list( $visibility, $parent_key, $op, $parent_value ) = $value;
- if ( isset( $_POST[ $condition_metakey ] ) ) {
- $cond_value = ( $fields[ $value[1] ]['type'] == 'radio' ) ? $_POST[ $condition_metakey ][0] : $_POST[ $condition_metakey ];
-
- if ( isset( $array['conditional_value'] ) && $cond_value !== $array['conditional_value'] ) {
+ if ( $visibility == 'hide' ) {
+ if ( $op == 'empty' ) {
+ if ( empty( $cond_value ) ) {
$array['required'] = 0;
- } elseif ( isset( $array['conditional_value'.$a] ) && $cond_value !== $array['conditional_value'.$a] ) {
+ }
+ } elseif ( $op == 'not empty' ) {
+ if ( ! empty( $cond_value ) ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'equals to' ) {
+ if ( $cond_value == $parent_value ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'not equals' ) {
+ if ( $cond_value != $parent_value ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'greater than' ) {
+ if ( $cond_value > $op ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'less than' ) {
+ if ( $cond_value < $op ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'contains' ) {
+ if ( strstr( $cond_value, $parent_value ) ) {
+ $array['required'] = 0;
+ }
+ }
+ } elseif ( $visibility == 'show' ) {
+ if ( $op == 'empty' ) {
+ if ( ! empty( $cond_value ) ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'not empty' ) {
+ if ( empty( $cond_value ) ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'equals to' ) {
+ if ( $cond_value != $parent_value ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'not equals' ) {
+ if ( $cond_value == $parent_value ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'greater than' ) {
+ if ( $cond_value <= $op ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'less than' ) {
+ if ( $cond_value >= $op ) {
+ $array['required'] = 0;
+ }
+ } elseif ( $op == 'contains' ) {
+ if ( ! strstr( $cond_value, $parent_value ) ) {
$array['required'] = 0;
}
}