From 9f6abd68fd639d5ba6a0acf2f3b5bce7d619e8a1 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Mon, 14 May 2018 11:09:27 +0300 Subject: [PATCH] - removed password from "Info" modal - add T&C date to modal "Info"; --- includes/core/class-user.php | 14 ++++++++ includes/um-short-functions.php | 60 ++++++++++++++++++++------------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/includes/core/class-user.php b/includes/core/class-user.php index c58f0410..6a0a9aca 100644 --- a/includes/core/class-user.php +++ b/includes/core/class-user.php @@ -890,6 +890,20 @@ if ( ! class_exists( 'um\core\User' ) ) { unset( $submitted['confirm_user_password'] ); } + //remove all password field values from submitted details + $password_fields = array(); + foreach ( $submitted as $k => $v ) { + if ( UM()->fields()->get_field_type( $k ) == 'password' ) { + $password_fields[] = $k; + $password_fields[] = 'confirm_' . $k; + } + } + + foreach ( $password_fields as $pw_field ) { + unset( $submitted[ $pw_field ] ); + } + + /** * UM hook * diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index d15afc67..b0758afa 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -508,10 +508,11 @@ function um_user_submitted_registration( $style = false ) { $data = um_user( 'submitted' ); - if ($style) + if ( $style ) { $output .= '
'; + } - if (isset( $data ) && is_array( $data )) { + if ( isset( $data ) && is_array( $data ) ) { /** * UM hook @@ -535,38 +536,51 @@ function um_user_submitted_registration( $style = false ) { */ $data = apply_filters( 'um_email_registration_data', $data ); - foreach ($data as $k => $v) { + $pw_fields = array(); + foreach ( $data as $k => $v ) { - if (!is_array( $v ) && strstr( $v, 'ultimatemember/temp' )) { + if ( strstr( $k, 'user_pass' ) || in_array( $k, array( 'g-recaptcha-response', 'request', '_wpnonce', '_wp_http_referer' ) ) ) { + continue; + } + + if ( UM()->fields()->get_field_type( $k ) == 'password' ) { + $pw_fields[] = $k; + $pw_fields[] = 'confirm_' . $k; + continue; + } + + if ( ! empty( $pw_fields ) && in_array( $k, $pw_fields ) ) { + continue; + } + + if ( ! is_array( $v ) && strstr( $v, 'ultimatemember/temp' ) ) { $file = basename( $v ); $v = um_user_uploads_uri() . $file; } - if (!strstr( $k, 'user_pass' ) && !in_array( $k, array( 'g-recaptcha-response', 'request', '_wpnonce', '_wp_http_referer' ) )) { - - if (is_array( $v )) { - $v = implode( ',', $v ); - } - - if ($k == 'timestamp') { - $k = __( 'date submitted', 'ultimate-member' ); - $v = date( "d M Y H:i", $v ); - } - - if ($style) { - if (!$v) $v = __( '(empty)', 'ultimate-member' ); - $output .= "

$v

"; - } else { - $output .= "$k: $v" . "
"; - } - + if ( is_array( $v ) ) { + $v = implode( ',', $v ); } + if ( $k == 'timestamp' ) { + $k = __( 'date submitted', 'ultimate-member' ); + $v = date( "d M Y H:i", $v ); + } + + if ( $style ) { + if ( ! $v ) { + $v = __( '(empty)', 'ultimate-member' ); + } + $output .= "

$v

"; + } else { + $output .= "$k: $v" . "
"; + } } } - if ($style) + if ( $style ) { $output .= '
'; + } return $output; }