Menu

#2200 Ldap configured I can't find user in "Created by"

open
nobody
None
1
2021-01-14
2020-10-14
No

Hello!

First of all I have to say this is a great tool and I like it very much

We are testing this application and we configured to login using ldap. Login is working fine using our AD, but when I create a new booking and try to change or search users in "Created by" (I have admin role), form is Loading and nothing it appears (No Results found).

Anyone else has had the same problem?

Thanks in advance

Discussion

  • Campbell Morrison

    If you're using MRBS 1.9.0 then there's a known bug with a simple fix. See https://sourceforge.net/p/mrbs/bugs/475/

     
    • Anonymous

      Anonymous - 2020-10-15

      Hello.

      I think this is not our problem, We had this fix at the beginning when login didn't works, and now we have not problem to login, the only problem is when an admin wants to assign a "Created by" users in a booking form. We can't find users.

      Thanks

       
  • Albert Esquis

    Albert Esquis - 2020-10-15

    Hello.
    I think this is not our problem, We had this fix at the beginning when login didn't works, and now we have not problem to login, the only problem is when an admin wants to assign a "Created by" users in a booking form. We can't find users.
    Thanks

     
  • Campbell Morrison

    Other symptom is when I start session using fully email and try to book a room My name disapers from created by and I have no option to make a booking. All is related with the same field

    I'll take a look at this problem.

    Thanks for the ldap debug output. The ldap search seems to be working OK as it's finding 5391 entries, so there must be something else going wrong. Can you set

    $ldap_debug = false;
    $debug = true;
    

    and then look at the Ajax response from usernames.php in your browser's developers tools?

    By the way, you can always disable that Created By field by setting

    $auth['admin_can_only_book_for_self'] = true;
    

    but it would be nice to find out what the problem is.

     
  • Campbell Morrison

    Thanks. There don't seem to be any problems in the JavaScript console. What is the Ajax response from usernames.php?

     
    • Albert Esquis

      Albert Esquis - 2020-10-15

      This is an exmple of response

      [{"username":null,"display_name":null},{"username":null,"display_name":null},{"username":"jdoe","display_name":"John Doe"},{"username":"jdoe@domain.com","display_name":"John Doe"},{"username":"jdoe2","display_name":"John Doe 2"},{"username":"jdoe2@domain.com","display_name":"John Doe 2"},{"username":"jdoe3","display_name":"John Doe 3"},{"username":"jdoe@domain.com","display_name":"John Doe 3"}]

       

      Last edit: Albert Esquis 2020-10-15
  • Campbell Morrison

    Thanks, that's useful. It looks like the problem may be that the first two users have username null for some reason. I'll see if I can come up with a fix.

     
    • Anonymous

      Anonymous - 2020-10-15

      Thanks!

      Yes, but take in mind that when I add entery OU or domain, there are much more empty users at the beginning

      We really appreciate your help and interest in this case.

       
  • Campbell Morrison

    Can you try the attached version of lib/MRBS/Auth/AuthLdap.php and see if it fixes the problem?

     
    👍
    1
    • Albert Esquis

      Albert Esquis - 2020-10-15

      Great!

      It seems it work's

      Now I can search in Active directory Users, and I think it's solved, the only thing is that I found every user twice but I supose is for my ldap config in config.inc.php.

      Thanks a lot for your help, was a pleasure

       
  • Campbell Morrison

    Good, glad it's fixed. I've now (e724fd) committed the fix to the default branch.

    Yes, I suspect the duplicate names are due to your config. But if you can't solve it let me know and MRBS could always remove the duplicates.

     
  • Campbell Morrison

    I've added a further change in bc5b63 which improves the resiience of the code. (It's not necessary to install this patch if you've already got the patch to AuthLdap.php above).

     
    👍
    1
  • Anonymous

    Anonymous - 2021-01-14

    One issue now is that for a big user ldap database the page freezes after loading.
    One option is to $auth['admin_can_only_book_for_self'] = true; of course but a more elegant solution would be to not search unless the field value is changed. Also some caching from time to time or on request.

     
  • Campbell Morrison

    Yes, a big user database will cause a long load time. However the list of users is loaded asynchronously via an Ajax request, so I am surprised the page is freezing. Are you getting any errors in your PHP error log?

    The Ajax request was intended to be an alternative to delaying the search until the field value was changed.

    An additional measure might be to use a paginated LDAP search.

     
MongoDB Logo MongoDB