#288 No deletion for users or no deletion for past bookings

Deletion (1)

Hey there,

I've succesfully installed mrbs-1.4.9. Great tool, with great opportunities!

I'm wondering if it's possible to deny deletion for non-admins. Creation must be feasible.
$auth['only_admin_can_book'] = TRUE; doesn't work for that purpose.

Otherwise I would like to have a deletion prohibition for past dates including 'today'.

Someone have a hint?


  • You can prevent creation, editing and deletion of past events by enabling min_book_ahead. You can also set how far back (or forward) this should apply. Go to the Rooms page and edit the area you are interested in. The default settings for new areas can be set in the config file.



  • Anonymous

    What do you mean with enabling min_book_ahead? Do I have to put in:
    $vocab["min_book_ahead"] = "TRUE"; into config?
    It doesn't work.

    I need to know who booked which room and when at the end of the month. Cancellation can be done by E-Mail. What's the best way?


  • Anonymous

    Log in as an admin. Click the "Rooms" link at the top of the page. Select the area you are interested in, click the pencil icon to edit it. Then check the ckeckbox "Advance booking - minimum" and select one day as the time. This will mean that ordinary users have to book at least one day in advance - and moreover can't edit or delete bookings which are due to start less than one day awat. This isn't quite what you want because the time is 24 hours ahead rather than the rest of the day, but with any luck it's close enough.

    If you want to make sure that new areas automatically have these settings then copy the appropriate settings from areadefaults.inc.php into your config file and edit them there.

    By the way, you should remove the

    $vocab["min_book_ahead"] = "TRUE";

    from your config setting because it will cause problems.


  • Robson

    How can we configure MRBS to prevent non-admin users to delete approved entries? I cannot find any parameter to meet it. We can prevent non-admin users to delete past entries, but approved entries are future events.

  • There isn't a standard way of doing this. However you could try setting

    $page_level['del_entry.php'] = 2;

    in mrbs_auth.inc

    This should stop ordinary users deleting entries (but I haven't tested it) and so will achieve your goal, but it won't be very tidy. If you want to make it a bit tidier you could also modify the code and make the delete entry link on the view_entry page only visible to admins:

    if ($is_admin)
      // Show the delete entry link


  • Robson

    I preferred the second option, and It became cool! Now, just Admins can delete entries.

  • You should implement the first option anyway to prevent users who know what they are doing from calling the del_entry.php directly.



Cancel   Add attachments