Menu

#116 Ordinary user can book others?

open
nobody
None
1
2022-11-20
2022-11-19
Anonymous
No

Is it possible to enable normal user (n.1) to enter other people's reservations, as user 2 can do?

Discussion

  • Campbell Morrison

    Do you just want this ability for some or all users?

     
  • Anonymous

    Anonymous - 2022-11-20

    Only for some users, with this situation: superadmin (2) can do everything, some can enter only events (1), others can book groups of participants (...). I work in a school. Thanks for your interest.

     
  • Campbell Morrison

    Assuming you are running MRBS 1.10.0 you should edit the function is_book_admin() in mrbs_auth.inc and replace line 438 which is:

    return (isset($mrbs_user) && ($mrbs_user->level >= $min_booking_admin_level));
    

    by

      if (!isset($mrbs_user)
      {
        return false;
      }
      if ($mrbs_user->level >= $min_booking_admin_level)
      {
        return true;
      }
      // Replace 'tom', 'dick', 'harry' by the usernames of those you want to be able to make bookings for otherrs
      return in_array($mrbs_user->username, array('tom', 'dick', 'harry'));
    
     
  • Anonymous

    Anonymous - 2022-11-20
    Uncaught exception 'ParseError' in /home/mhd-01/www.allegroweb.it/htdocs/mrbs/mrbs_auth.inc at line 439
    syntax error, unexpected '{'
    #0 /home/mhd-01/www.allegroweb.it/htdocs/mrbs/index.php(8): require()
    #1 {main}
    
    MRBS GET: Array
    (
    )
    MRBS POST: Array
    (
    )
    MRBS SESSION: Array
    (
    )
    
     

    Last edit: Campbell Morrison 2022-11-24
  • Anonymous

    Anonymous - 2022-11-20

    $mrbs_version_number = '1.10.0';

     
  • Campbell Morrison

    Can you post your version of mrbs_auth.inc as an attachment here please?
    Edit out any sensitive usernames.

     
  • Anonymous

    Anonymous - 2022-11-20

    there

     
  • Campbell Morrison

    Sorry, it should be

    if (!isset($mrbs_user))
      {
        return false;
      }
      if ($mrbs_user->level >= $min_booking_admin_level)
      {
        return true;
      }
      // Replace 'tom', 'dick', 'harry' by the usernames of those you want to be able to make bookings for otherrs
      return in_array($mrbs_user->username, array('tom', 'dick', 'harry'));
    

    [I was missing a ')' at the end of the first line.]

     
  • Anonymous

    Anonymous - 2022-11-20

    thank you! works great: I needed a user who can only enter groups of students into activities in the calendar