Community
    • Categories
    • Recent
    • Popular
    • Users
    • Search
    • Register
    • Login

    0.9.9-5 LDAP Fehler mit zwei LDAP-Server-Konfigurationen

    Scheduled Pinned Locked Moved Entwicklung
    2 Posts 2 Posters 1.6k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mknab
      last edited by

      Hallo zusammen,

      die automatische "Personengruppenmitgliedschaft" funktioniert nicht, wenn mehrere LDAP-Server-Konfigurationen vorhanden sind und sich der Benutzer in der zweiten Konfiguration befindet.

      Ich habe meine LDAP-Konfiguration (AD) erfolgreich erstellt.
      Die erste Anmeldung eines Users wird aufgrund seiner AD-Gruppenzugehörigkeit erkannt und durch die LDAP-Gruppen (mapping) auch der richtigen i-doIT-Gruppe zugeordnet und nach dem Anmelden und "Next" erscheint das Dashboard.
      config.inc.php ist gesetzt: define("C__LDAP__GROUP_IDS", "10,11,12,13,14"); (10=reader, …, 14=admin).

      Das ganze funktioniert aber nicht, wenn sich der User in der zweiten LDAP-Server-Konfiguration befindet.

      Der TestUser "Horst Jedermann" wird nach jedem Test archiviert, gelöscht und gepurged.

      Erste Anmeldung:

      ldap_debug.txt
      2011-06-03 15:19:07 ldap: LDAP Module launched for mandator: firma_data
      2011-06-03 15:19:07 ldap: Found 3 configured LDAP Servers.
      2011-06-03 15:19:07 ldap: 1: srv-dom1 (OU=Mitarbeiter,OU=Berlin,OU=firma,DC=firma,DC=de)
      2011-06-03 15:19:07 ldap: –--------------------------------------------------------------------------------------------
      2011-06-03 15:19:07 ldap: Creating new ldap-library connection to: srv-dom1:389, user: CN=firma-LDAP,OU=Berlin,OU=firma,DC=firma,DC=de
      2011-06-03 15:19:07 ldap: Connected to srv-dom1
      2011-06-03 15:19:07 ldap: Searching for username: hjedermann
      2011-06-03 15:19:07 ldap: Getting user(s) using filter: (&(objectClass=user)(sAMAccountName=hjedermann)) in search-path: OU=Mitarbeiter,OU=Berlin,OU=firma,DC=firma,DC=de
      2011-06-03 15:19:07 ldap: ** No user found.
      2011-06-03 15:19:07 ldap: User not found. Check if hjedermann exist in your configured search-path: OU=Mitarbeiter,OU=Berlin,OU=firma,DC=firma,DC=de
      2011-06-03 15:19:07 ldap: ----------------------------------------------------------------------------------------------
      2011-06-03 15:19:07 ldap: 2: eit-bln-svdom1 (OU=Mitarbeiter,OU=Bonn,OU=firma,DC=firma,DC=de)
      2011-06-03 15:19:07 ldap: ----------------------------------------------------------------------------------------------
      2011-06-03 15:19:07 ldap: Creating new ldap-library connection to: srv-dom1:389, user: CN=firma-LDAP,OU=Berlin,OU=firma,DC=firma,DC=de
      2011-06-03 15:19:07 ldap: Connected to srv-dom1
      2011-06-03 15:19:07 ldap: Searching for username: hjedermann
      2011-06-03 15:19:07 ldap: Getting user(s) using filter: (&(objectClass=user)(sAMAccountName=hjedermann)) in search-path: OU=Mitarbeiter,OU=Bonn,OU=firma,DC=firma,DC=de
      2011-06-03 15:19:07 ldap: Found DN: CN=Jedermann, Horst,OU=Mitarbeiter,OU=Bonn,OU=firma,DC=firma,DC=de. Trying to login with it.
      2011-06-03 15:19:07 ldap: Auth successfull (CN=Jedermann, Horst,OU=Mitarbeiter,OU=Bonn,OU=firma,DC=firma,DC=de).
      2011-06-03 15:19:07 ldap: User account created. User-ID: 29
      2011-06-03 15:19:07 ldap: Getting groups of CN=Jedermann, Horst,OU=Mitarbeiter,OU=Bonn,OU=firma,DC=firma,DC=de (Servertype: )
      2011-06-03 15:19:07 ldap:  Found CN=firma-Z-idoIT-Reader,OU=Mitarbeiter,OU=Berlin,OU=firma,DC=firma,DC=de (Filter: (objectclass=*)): 1
      2011-06-03 15:19:07 ldap:  ** i-doit group pendant for "firma-Z-idoIT-Reader" found: Reader
      2011-06-03 15:19:07 ldap: Syncing groups..
      2011-06-03 15:19:07 ldap:  Attached user(29) to group: Reader

      Bisher richtiges Verhalten: Suche erste LDAP-Server-Konfuiguration=nicht gefunden, suche bei der zweiten LDAP-Konfiguration=erfolgreich.
      Im LDAP-Logfile steht auch, dass der user der group "Reader" zugeordner wurde, stimmt aber nicht mit i-doIT überein.

      Jetzt klick auf "Next" ergibt eine Seite mit folgender Fehlermeldung:
      You need at least reading rights to login to i-doit.
      Currently you are not assigned to any right-group.
      Back (Logs out and clears activated session)

      manuelle Lösung:
      Gehe ich nun mit einem Admin rein, sehe ich dass der User angelegt wurde, aber seine "Personengruppenmitgliedschaft" wurde nicht richtig gesetzt wie beim ersten Test.
      Setze ich diese per Hand auf "reader" geht es wieder.

      Abschließender logischer Test:
      Der Testuser "Horst Jedermann" wird archiviert, gelöscht und gepurged.
      Verschieben im AD von der zweiten LDAP-Server-Konfiguration zur Ersten und schon funktioniert es.

      Freue mich schon auf einen Bugfix 😉

      Gruß Martin

      1 Reply Last reply Reply Quote 0
      • R Offline
        rotyx
        last edited by

        I had the same issue here and fixed it.
        The problem is, that the user created by the ldap module gets an id as a person and as an object.
        The grouping done by the ldap script uses the person id when it should have used the object id. this is the issue.

        As I have said I fixed this.

        You need to edit the file src/classes/modules/isys_module_ldap.class.php

        in line 219 right before the line saying
        if (is_numeric($l_user_id) && $l_user_id > 0) {

        you have to add these three lines of code
        $matches = array();
        preg_match('/isys_cats_person_list__isys_obj__id = '(\d+)'/', print_r($l_user_dao,true), $matches);
        $l_user_id = intval($matches[1]);

        okay, it might not be the nicest solution, but it works. The cleanest way would be to get the object id out of the database, found in table "isys_cats_person_list"
        but I didn't have time for searching whether such a function exists or how to write that.

        Hope it helps anybody and maybe some of the developers that are deeper involved in this project can improve this bugfix.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post