*

MB Themes

Re: Error deleting user, please help
« Reply #15 on: February 07, 2022, 10:31:03 AM »
If user is removed in standard way from backoffice, osclass should call bpr_removed_user (business profile) and remove relevant data.
For profile picture, not sure if there is similar function.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vlad7

  • ****
  • 244 posts
Re: Error deleting user, please help
« Reply #16 on: February 08, 2022, 10:46:09 AM »
@Vlad7
Notice you reference to is related to user account removal link, not to listing.
Could be simply fixed by modifying this:
Code: [Select]
      echo '<li class="opt_del_user"><a href="' . osc_base_url(true) . '?page=user&action=delete&id='.$user_id.'&secret='.$user['s_secret'] . '" onclick="return confirm(\''  . osc_esc_js(__('Are you sure you want to delete your account? \nNote that all your listings will be deleted too! \n\nWould you like to continue', 'backoffice_manager')) . '?\')">' . __('Delete account', 'backoffice_manager') . '</a></li>';

Into:
Code: [Select]
    if($user_id > 0 && isset($user['s_secret']) {
      //echo '<li class="opt_del_user"><a href="' . osc_base_url() . 'oc-content/plugins/backoffice_manager/delete_user.php?user_id=' . $user_id . '&secret=' . $user['s_secret'] . '" onclick="return confirm(\''  . osc_esc_js(__('Are you sure you want to delete your account? \nNote that all your listings will be deleted too! \n\nWould you like to continue', 'backoffice_manager')) . '?\')">' . __('Delete account', 'backoffice_manager') . '</a></li>';
      echo '<li class="opt_del_user"><a href="' . osc_base_url(true) . '?page=user&action=delete&id='.$user_id.'&secret='.$user['s_secret'] . '" onclick="return confirm(\''  . osc_esc_js(__('Are you sure you want to delete your account? \nNote that all your listings will be deleted too! \n\nWould you like to continue', 'backoffice_manager')) . '?\')">' . __('Delete account', 'backoffice_manager') . '</a></li>';
    }

in index.php of plugin.

Please tell me how to change here?

function bo_delete_user() {
  $allow_delete = osc_get_preference('bo_mgr_allow_delete_user_account', 'plugin-bo_mgr') <> '' ? osc_get_preference('bo_mgr_allow_delete_user_account', 'plugin-bo_mgr') : 1;

  if($allow_delete == 1) {
    $user_id = osc_logged_user_id();
    $user = User::newInstance()->findByPrimaryKey( $user_id );

    //echo '<li class="opt_del_user"><a href="' . osc_base_url() . 'oc-content/plugins/backoffice_manager/delete_user.php?user_id=' . $user_id . '&secret=' . $user['s_secret'] . '" onclick="return confirm(\''  . osc_esc_js(__('Are you sure you want to delete your account? \nNote that all your listings will be deleted too! \n\nWould you like to continue', 'backoffice_manager')) . '?\')">' . __('Delete account', 'backoffice_manager') . '</a></li>';
    echo '<li class="opt_del_user"><a href="' . osc_base_url(true) . '?page=user&action=delete&id='.osc_user_id().'&secret='.$user['s_secret'] . '" onclick="return confirm(\''  . osc_esc_js(__('Are you sure you want to delete your account? \nNote that all your listings will be deleted too! \n\nWould you like to continue', 'backoffice_manager')) . '?\')">' . __('Delete account', 'backoffice_manager') . '</a></li>';
  }
}

osc_add_hook('user_menu', 'bo_delete_user');

*

MB Themes

Re: Error deleting user, please help
« Reply #17 on: February 08, 2022, 11:19:09 AM »
will be updating plugin later on
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots