*

morfik

  • ****
  • 169 posts
Is there a way to prevent a listing from being removed?
« on: March 05, 2023, 05:16:03 PM »
Is there a way to prevent a listing from being removed by the user? I mean, is there an option to allow only admins to remove listings?

*

MB Themes

Re: Is there a way to prevent a listing from being removed?
« Reply #1 on: March 07, 2023, 01:19:31 PM »
@morfik
Well you can try to hide all remove buttons but still not supergood.

You could go to model/Item.php in core, find this line:
Code: [Select]
  public function deleteByPrimaryKey($id) {
and after it put:
Code: [Select]
if(!osc_is_admin_user_logged_in()) { return false; }
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
Re: Is there a way to prevent a listing from being removed?
« Reply #2 on: March 07, 2023, 01:58:18 PM »
Hmm, I thought maybe there's some option I couldn't fine in the Osclass settings, similar to disabling a listing (allow user to disable their listings).

*

MB Themes

Re: Is there a way to prevent a listing from being removed?
« Reply #3 on: March 07, 2023, 08:19:28 PM »
No no such ootion exists.
You may use history logger plugin if you need to keep historical data - what listings you had
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots