Menu

#1121 can I hide types of bookings and colors bottom left?

open
nobody
None
1
2017-01-20
2017-01-14
Anonymous
No

Hi,

All our bookings are public but no access whatsoever for non-logged in user.

We want to switch to private bookings.

When non-logged in user visits, even though s/he sees a booking named "private," s/he can still see whether or not a room is available.

But, we don't want non-logged in visitor to see booking types and colors at bottom left. Is there any way to hide booking types and colors at bottom left when visitor is NOT logged in, but show them when user is logged in?

Thank you,
Meno

Discussion

  • Campbell Morrison

    You could just stop non-logged in users from accessing the system altogether by setting

    $auth['deny_public_access'] = true;
    

    in your config file.

     
  • Anonymous

    Anonymous - 2017-01-14

    Yes, I did that, but now we want users to be able to see if there is availability before they call to make a booking and theres details in the bookjng types that we'd rather them not see

     
  • Campbell Morrison

    There are two ways you could do this.

    The first is to create a custom CSS file (see systemdefaults.inc.php for details of how to do this) and add the rule

    table#colour_key {
      display: none;
    }
    

    However this isn't very secure as the details will still be there in the HTML and visible to anybody who does a View Source. So the second way, which is more secure, is to modify the function show_colour_key() in functions.inc (line 2052 in 1.5.0) and just add the line

      return;
    

    as the first line of the function.

     
  • Anonymous

    Anonymous - 2017-01-15

    we do want the "color_key" to show when users are logged in. We just don't want non-logged in users to see it. any way to achieve that?

    Thanks,
    Meno

     

    Last edit: Anonymous 2017-01-15
  • Campbell Morrison

    I thought you had $auth['deny_public_access'] set? In which case users won't be able to access MRBS unless they are logged in.

     
  • Anonymous

    Anonymous - 2017-01-19

    I apologize for not being clear. You are being very generous with your time.

    Yes, currently we have enabled $auth['deny_public_access']

    BUT: what we want is to disable the above option and make all bookings private to where a visitor that's not logged in can see the room names and times and whether a room is booked, but all s/he sees is "private" instead of the actual booking name. We want to hide the booking types and colors that appear at bottom left when a non-logged in user visits.

    That way the visitor at least knows if a room is available and can call to book.

    Thank you,
    Meno

     
  • Campbell Morrison

    Oh, OK, I understand now. Add the following code to the beginning of show_colour_key() in functions.inc:

      $user = getUserName();
      if (!isset($user))
      {
        return;
      }
    
     
  • Anonymous

    Anonymous - 2017-01-20

    I have the same issue. I do not want to hide the color key, but I want to hide the colors of the booked periods in the generated table. I need only admin can see the background color of the cell non admin users should be e.g. grey only. I set entry.entry_type to PRIVATE, but it has no effect on the background color of the cells in day view.

     
    • Campbell Morrison

      This is a bug. I have raised a separate bug ticket and will fix it over the next few days.

       

      Last edit: Campbell Morrison 2017-01-20
  • Anonymous

    Anonymous - 2017-01-20

    The solution would be somethng like tho change the entry type color to e.g. #888888 when the authentication level is 1. And it suold be placet to the script where the teble cell of the day view is generated. But I cannot find where it is...

    If you have any idea please let me know. Thanks in advance

     
  • Anonymous

    Anonymous - 2017-01-20

    I am close to the solution.

    In FUNCTIONS_TABLE.INC in row 127 current code is:

    $column[$s][$n]["color"] = $row['type']

    this shuold be changed thet it take effect only an ADMIN USER.

    I tried this one but does not work. I have only bank scrren.

    $user = getUserName();
    if (authGetUserLevel($user) = 2)
    {
    $column[$s][$n]["color"] = $row['type'];
    }

     
    • Campbell Morrison

      Please could you post comments about this bug on https://sourceforge.net/p/mrbs/bugs/372/, so that we don't get the two tickets confused.

       
MongoDB Logo MongoDB