Ultimate Member – User Profile & Membership Plugin - Version 1.3.31

Version Description

Download this release

Release Info

Developer ultimatemember
Plugin Icon 128x128 Ultimate Member – User Profile & Membership Plugin
Version 1.3.31
Comparing to
See all releases

Code changes from version 1.3.30 to 1.3.31

admin/core/um-admin-actions.php CHANGED
@@ -240,8 +240,8 @@
240
  $uri = add_query_arg('user[]', $user_id, $uri);
241
  $redirect = add_query_arg('user[]', $user_id, $redirect);
242
  }
243
- $uri = add_query_arg('confirm', 1, $uri);
244
- $redirect = add_query_arg('_refer', urlencode($uri), $redirect);
245
 
246
  exit( wp_redirect($redirect) );
247
 
@@ -270,19 +270,24 @@
270
  }
271
 
272
  /***
273
- *** @secure passwords
 
274
  ***/
275
  add_action('um_admin_do_action__um_passwords_secured', 'um_admin_do_action__um_passwords_secured');
276
  function um_admin_do_action__um_passwords_secured( $action ){
277
- global $ultimatemember;
 
 
 
278
  if ( !is_admin() || !current_user_can('manage_options') ) die();
279
-
280
- $users = get_users();
281
- foreach( $users as $user ) {
282
- delete_user_meta( $user->ID, 'confirm_user_password' );
283
- update_user_meta( $user->ID, 'submitted', '' );
284
- }
285
-
 
286
  update_option( 'um_passwords_secured', 1 );
287
  exit( wp_redirect( admin_url() ) );
288
  }
240
  $uri = add_query_arg('user[]', $user_id, $uri);
241
  $redirect = add_query_arg('user[]', $user_id, $redirect);
242
  }
243
+ $uri = add_query_arg('_refer', $_POST['_wp_http_referer'], $redirect);
244
+ $redirect = add_query_arg('confirm', 1, $uri);
245
 
246
  exit( wp_redirect($redirect) );
247
 
270
  }
271
 
272
  /***
273
+ *** @secure passwords
274
+ *** Updated by Bo Carlson (bo@fictiontribe.com) to clear fields in DB without looping users. Much faster.
275
  ***/
276
  add_action('um_admin_do_action__um_passwords_secured', 'um_admin_do_action__um_passwords_secured');
277
  function um_admin_do_action__um_passwords_secured( $action ){
278
+ global $ultimatemember; //ultimate member global object
279
+ global $wpdb; //Wordpress DB object
280
+
281
+ //die if admin can't manage options
282
  if ( !is_admin() || !current_user_can('manage_options') ) die();
283
+
284
+ //remove all confirm_user_password from DB
285
+ $wpdb->delete($wpdb->usermeta,['meta_key'=>'confirm_user_password']);
286
+
287
+ //then reset submitted
288
+ $wpdb->update($wpdb->usermeta,['meta_value'=>''],['meta_key'=>'submitted']);
289
+
290
+ //then set flag that update is complete and redirect to admin home
291
  update_option( 'um_passwords_secured', 1 );
292
  exit( wp_redirect( admin_url() ) );
293
  }
admin/core/um-admin-notices.php CHANGED
@@ -161,18 +161,20 @@ class UM_Admin_Notices {
161
 
162
  case 'confirm_delete':
163
 
164
- $confirm_uri = urldecode($_REQUEST['_refer']);
165
  $users = '';
166
 
167
- foreach( $_REQUEST['user'] as $user_id ) {
168
- $user = get_userdata( $user_id );
169
- $users .= '#' . $user_id . ': ' . $user->user_login . '<br />';
 
 
170
  }
171
 
172
  $ignore = admin_url('users.php');
173
 
174
  $messages[0]['err_content'] = sprintf(__('Are you sure you want to delete the selected user(s)? The following users will be deleted: <p>%s</p> <strong>This cannot be undone!</strong>','ultimatemember'), $users);
175
- $messages[0]['err_content'] .= '<p><a href="'. esc_attr( $confirm_uri ) .'" class="button-primary">' . __('Remove','ultimatemember') . '</a>&nbsp;&nbsp;<a href="'.$ignore.'" class="button">' . __('Undo','ultimatemember') . '</a></p>';
176
 
177
  break;
178
 
161
 
162
  case 'confirm_delete':
163
 
164
+ $confirm_uri = sanitize_text_field( urldecode($_REQUEST['_wp_http_referer']) );
165
  $users = '';
166
 
167
+ if( isset( $_REQUEST['user'] ) ){
168
+ foreach( $_REQUEST['user'] as $user_id ) {
169
+ $user = get_userdata( $user_id );
170
+ $users .= '#' . $user_id . ': ' . $user->user_login . '<br />';
171
+ }
172
  }
173
 
174
  $ignore = admin_url('users.php');
175
 
176
  $messages[0]['err_content'] = sprintf(__('Are you sure you want to delete the selected user(s)? The following users will be deleted: <p>%s</p> <strong>This cannot be undone!</strong>','ultimatemember'), $users);
177
+ $messages[0]['err_content'] .= '<p><a href="'. esc_html( $confirm_uri ) .'" class="button-primary">' . __('Remove','ultimatemember') . '</a>&nbsp;&nbsp;<a href="'.$ignore.'" class="button">' . __('Undo','ultimatemember') . '</a></p>';
178
 
179
  break;
180
 
admin/core/um-admin-users.php CHANGED
@@ -159,9 +159,9 @@ class UM_Admin_Users {
159
  global $ultimatemember;
160
 
161
  $admin_err = 0;
162
-
163
  if (isset($_REQUEST) && !empty ($_REQUEST) ){
164
-
165
  // bulk change role
166
  if (isset($_REQUEST['users']) && is_array($_REQUEST['users']) && isset($_REQUEST['um_changeit']) && $_REQUEST['um_changeit'] != '' && isset($_REQUEST['um_change_role']) && !empty($_REQUEST['um_change_role']) ){
167
 
@@ -171,7 +171,7 @@ class UM_Admin_Users {
171
  check_admin_referer('bulk-users');
172
 
173
  $users = $_REQUEST['users'];
174
- $new_role = $_REQUEST['um_change_role'];
175
 
176
  foreach($users as $user_id){
177
  $ultimatemember->user->set( $user_id );
@@ -207,9 +207,9 @@ class UM_Admin_Users {
207
  check_admin_referer('bulk-users');
208
 
209
  $users = $_REQUEST['users'];
210
- $bulk_action = $_REQUEST['um_bulk_action'];
211
-
212
- if ( $bulk_action == 'um_delete' ) { // this needs confirmation
213
 
214
  $uri = admin_url('users.php');
215
  $userids = array_map( 'intval', (array) $_REQUEST['users'] );
@@ -254,8 +254,9 @@ class UM_Admin_Users {
254
  }
255
 
256
  // filter by user role
257
- if ( isset($_REQUEST['um_filter_role']) && ! isset( $_REQUEST['new_role'] ) && $_REQUEST['um_filter_role'] ) {
258
- exit( wp_redirect( admin_url('users.php?um_role=' . $_REQUEST['um_filter_role'] ) ) );
 
259
  }
260
 
261
  }
@@ -271,7 +272,7 @@ class UM_Admin_Users {
271
  <div class="actions">
272
 
273
  <label class="screen-reader-text" for="um_filter_role"><?php _e('Filter by','ultimatemember'); ?></label>
274
- <select name="um_filter_role" id="um_filter_role" class="umaf-selectjs" style="width: 120px">
275
  <option value="0"><?php _e('Filter by','ultimatemember'); ?></option>
276
  <?php
277
  $roles = $ultimatemember->query->get_roles();
@@ -287,7 +288,7 @@ class UM_Admin_Users {
287
  <div class="actions">
288
 
289
  <label class="screen-reader-text" for="um_bulk_action"><?php _e('Take Action','ultimatemember'); ?></label>
290
- <select name="um_bulk_action" id="um_bulk_action" class="umaf-selectjs" style="width: 200px">
291
  <option value="0"><?php _e('Take Action','ultimatemember'); ?></option>
292
  <?php echo $ultimatemember->user->get_bulk_admin_actions(); ?>
293
  </select>
@@ -299,7 +300,7 @@ class UM_Admin_Users {
299
  <div class="actions">
300
 
301
  <label class="screen-reader-text" for="um_change_role"><?php _e('Community role&hellip;','ultimatemember'); ?></label>
302
- <select name="um_change_role" id="um_change_role" class="umaf-selectjs" style="width: 160px">
303
  <?php foreach($ultimatemember->query->get_roles( $add_default = 'Community role&hellip;' ) as $key => $value) { ?>
304
  <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
305
  <?php } ?>
159
  global $ultimatemember;
160
 
161
  $admin_err = 0;
162
+
163
  if (isset($_REQUEST) && !empty ($_REQUEST) ){
164
+
165
  // bulk change role
166
  if (isset($_REQUEST['users']) && is_array($_REQUEST['users']) && isset($_REQUEST['um_changeit']) && $_REQUEST['um_changeit'] != '' && isset($_REQUEST['um_change_role']) && !empty($_REQUEST['um_change_role']) ){
167
 
171
  check_admin_referer('bulk-users');
172
 
173
  $users = $_REQUEST['users'];
174
+ $new_role = current( array_filter( $_REQUEST['um_change_role'] ) );
175
 
176
  foreach($users as $user_id){
177
  $ultimatemember->user->set( $user_id );
207
  check_admin_referer('bulk-users');
208
 
209
  $users = $_REQUEST['users'];
210
+ $bulk_action = current( array_filter( $_REQUEST['um_bulk_action']) );
211
+
212
+ if ( in_array('um_delete', $bulk_action ) > -1 ) { // this needs confirmation
213
 
214
  $uri = admin_url('users.php');
215
  $userids = array_map( 'intval', (array) $_REQUEST['users'] );
254
  }
255
 
256
  // filter by user role
257
+ if ( isset($_REQUEST['um_filter_role']) && ( ! isset( $_REQUEST['new_role'] ) || empty( $_REQUEST['new_role'] ) ) && $_REQUEST['um_filter_role'] ) {
258
+ $filter_role = current( array_filter( $_REQUEST['um_filter_role'] ) );
259
+ exit( wp_redirect( admin_url('users.php?um_role=' .$filter_role ) ) );
260
  }
261
 
262
  }
272
  <div class="actions">
273
 
274
  <label class="screen-reader-text" for="um_filter_role"><?php _e('Filter by','ultimatemember'); ?></label>
275
+ <select name="um_filter_role[]" id="um_filter_role" class="umaf-selectjs" style="width: 120px">
276
  <option value="0"><?php _e('Filter by','ultimatemember'); ?></option>
277
  <?php
278
  $roles = $ultimatemember->query->get_roles();
288
  <div class="actions">
289
 
290
  <label class="screen-reader-text" for="um_bulk_action"><?php _e('Take Action','ultimatemember'); ?></label>
291
+ <select name="um_bulk_action[]" id="um_bulk_action" class="umaf-selectjs" style="width: 200px">
292
  <option value="0"><?php _e('Take Action','ultimatemember'); ?></option>
293
  <?php echo $ultimatemember->user->get_bulk_admin_actions(); ?>
294
  </select>
300
  <div class="actions">
301
 
302
  <label class="screen-reader-text" for="um_change_role"><?php _e('Community role&hellip;','ultimatemember'); ?></label>
303
+ <select name="um_change_role[]" id="um_change_role" class="umaf-selectjs" style="width: 160px">
304
  <?php foreach($ultimatemember->query->get_roles( $add_default = 'Community role&hellip;' ) as $key => $value) { ?>
305
  <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
306
  <?php } ?>
core/um-filters-files.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  if ( get_current_blog_id() == '1' ) return $dir;
13
 
14
- $split = explode('sites',$dir);
15
  $um_dir = 'ultimatemember/';
16
  $dir = $split[0] . $um_dir;
17
 
11
 
12
  if ( get_current_blog_id() == '1' ) return $dir;
13
 
14
+ $split = explode('sites/',$dir);
15
  $um_dir = 'ultimatemember/';
16
  $dir = $split[0] . $um_dir;
17
 
core/um-short-functions.php CHANGED
@@ -424,7 +424,10 @@ function um_profile_id() {
424
  $url = add_query_arg( 'updated', esc_attr( $updated ), $url );
425
  }
426
 
427
- if ( function_exists('icl_get_current_language') && icl_get_current_language() != icl_get_default_language() && $slug == 'account' ) {
 
 
 
428
  if ( get_post_meta( get_the_ID() , '_um_wpml_account', true ) == 1 ) {
429
  $url = get_permalink( get_the_ID() );
430
  }
424
  $url = add_query_arg( 'updated', esc_attr( $updated ), $url );
425
  }
426
 
427
+ if ( function_exists('icl_get_current_language') && icl_get_current_language() != icl_get_default_language() ) {
428
+
429
+ $url = um_get_url_for_language( $ultimatemember->permalinks->core[ $slug ], icl_get_current_language() );
430
+
431
  if ( get_post_meta( get_the_ID() , '_um_wpml_account', true ) == 1 ) {
432
  $url = get_permalink( get_the_ID() );
433
  }
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ultimate Member
4
  Plugin URI: http://ultimatemember.com/
5
  Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
- Version: 1.3.30
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  */
3
  Plugin Name: Ultimate Member
4
  Plugin URI: http://ultimatemember.com/
5
  Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
+ Version: 1.3.31
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  */
readme.txt CHANGED
@@ -1,13 +1,13 @@
1
  === Ultimate Member ===
2
  Author URI: https://ultimatemember.com/
3
  Plugin URI: https://ultimatemember.com/
4
- Contributors: ultimatemember
5
  Donate link:
6
  Tags: access control, author, authors, author profile, comments, community, communities, conditional fields, conditional logic, conditional menus, content protection, custom fields, file uploads, form builder, front-end login, front-end registration, gravatar, hide wp-admin, login, login page, logged-in users, mandrill, member, members, membership, member directory, online users, profile, profiles, profile builder, registration, restriction, restrict content, role creation, role menus, search filters, sign in, sign up, social network, star ratings, toolbar, user, users, user fields, user profile, user-profile, user profiles, user roles
7
  Requires at least: 4.1
8
  Tested up to: 4.3
9
 
10
- Stable Tag: 1.3.30
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
@@ -147,6 +147,13 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
 
 
150
  = 1.3.30: December 3, 2015 =
151
 
152
  * New: added Simplified Chinese language support
1
  === Ultimate Member ===
2
  Author URI: https://ultimatemember.com/
3
  Plugin URI: https://ultimatemember.com/
4
+ Contributors: ultimatemember, champsupertramp
5
  Donate link:
6
  Tags: access control, author, authors, author profile, comments, community, communities, conditional fields, conditional logic, conditional menus, content protection, custom fields, file uploads, form builder, front-end login, front-end registration, gravatar, hide wp-admin, login, login page, logged-in users, mandrill, member, members, membership, member directory, online users, profile, profiles, profile builder, registration, restriction, restrict content, role creation, role menus, search filters, sign in, sign up, social network, star ratings, toolbar, user, users, user fields, user profile, user-profile, user profiles, user roles
7
  Requires at least: 4.1
8
  Tested up to: 4.3
9
 
10
+ Stable Tag: 1.3.31
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
147
 
148
  == Changelog ==
149
 
150
+ = 1.3.31: December 9, 2015 =
151
+
152
+ * Fixed: Add slash in base url filter for multisite
153
+ * Fixed: manage user roles, status and filters
154
+ * Fixed: Enable WPML support to all UM url/links
155
+ * Fixed: Sanitize referers and printing notices in admin screens
156
+
157
  = 1.3.30: December 3, 2015 =
158
 
159
  * New: added Simplified Chinese language support