Skip to content

Commit

Permalink
Get user confirmation before deleting Profile
Browse files Browse the repository at this point in the history
Fixes #27259
  • Loading branch information
dregad committed Sep 18, 2020
1 parent ef8640c commit 62d086a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions account_prof_update.php
Expand Up @@ -111,6 +111,13 @@
$t_user_id = auth_get_current_user_id();
}

helper_ensure_confirmed(
sprintf( lang_get( 'delete_profile_confirm_msg' ),
string_attribute( profile_get_name( $f_profile_id ) )
),
lang_get( 'delete_profile' )
);

profile_delete( $t_user_id, $f_profile_id );
break;

Expand Down
1 change: 1 addition & 0 deletions lang/strings_english.txt
Expand Up @@ -433,6 +433,7 @@ $s_additional_description = 'Additional Description';
$s_update_profile_button = 'Update Profile';
$s_global_profile = 'Global Profile';
$s_default_profile = 'Default Profile';
$s_delete_profile_confirm_msg = 'Are you sure you want to delete profile "%1$s"?';

# account_profile_make_default.php
$s_profile_defaulted_msg = 'Default profile updated...';
Expand Down

0 comments on commit 62d086a

Please sign in to comment.