mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-17 21:53:43 +09:00
fix 'um_resize_image' action at registration form
This commit is contained in:
@@ -102,6 +102,14 @@ jQuery(document).ready(function() {
|
||||
user_id = jQuery(this).parents('#um_upload_single').data('user_id');
|
||||
}
|
||||
|
||||
var form_id = 0;
|
||||
var mode = '';
|
||||
if ( jQuery('div.um-field-image[data-key="' + key + '"]').length === 1 ) {
|
||||
var $formWrapper = jQuery('div.um-field-image[data-key="' + key + '"]').closest('.um-form');
|
||||
form_id = $formWrapper.find('input[name="form_id"]').val();
|
||||
mode = $formWrapper.attr('data-mode');
|
||||
}
|
||||
|
||||
if ( coord ) {
|
||||
|
||||
jQuery(this).html( jQuery(this).attr('data-processing') ).addClass('disabled');
|
||||
@@ -116,6 +124,8 @@ jQuery(document).ready(function() {
|
||||
coord : coord,
|
||||
user_id : user_id,
|
||||
key: key,
|
||||
set_id: form_id,
|
||||
set_mode: mode,
|
||||
nonce: um_scripts.nonce
|
||||
},
|
||||
success: function( response ) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -326,7 +326,10 @@ if ( ! class_exists( 'um\core\Files' ) ) {
|
||||
|
||||
$user_id = empty( $_REQUEST['user_id'] ) ? get_current_user_id() : $_REQUEST['user_id'];
|
||||
|
||||
if ( ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
UM()->fields()->set_id = filter_input( INPUT_POST, 'set_id', FILTER_SANITIZE_NUMBER_INT );
|
||||
UM()->fields()->set_mode = filter_input( INPUT_POST, 'set_mode', FILTER_SANITIZE_STRING );
|
||||
|
||||
if ( UM()->fields()->set_mode != 'register' && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
$ret['error'] = esc_js( __( 'You haven\'t ability to edit this user', 'ultimate-member' ) );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user