EspoCRM 4.2.0 released

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tarasm
    Super Moderator
    • Mar 2014
    • 573

    #31
    Did you try "OU=Department,OU=Company,DC=xxxx,DC=xx xx"? Yes, this bug fixed and will be add to the new release.
    In my case, I have the following structure:
    Click image for larger version

Name:	ldap-users.png
Views:	0
Size:	14.4 KB
ID:	23283

    My base dn is "cn=users-group,ou=users,dc=espo,dc=local".
    Job Offers and Requests

    Comment

    • Maho
      Junior Member
      • Mar 2016
      • 29

      #32
      Yes I tried this option then the debugger tells me again "user not found"
      The Structure in my case lloks like this
      Click image for larger version

Name:	Unbenannt.PNG
Views:	358
Size:	5.0 KB
ID:	23285

      so all users shall have access. For me it looks like it is not resolving the hirachy.
      I tried to google for some information about the zend adapter. but since i am not a programmer I got stuck.
      I guess there is a parameter in the adapter to tell him serching through the hirachy

      Comment

      • Maho
        Junior Member
        • Mar 2016
        • 29

        #33
        Ahh I figuered it out.
        There is an Option on the Zendadapter as I expected.
        Code:
         protected function findLdapUserDnByUsername($username)
            {
                $ldapClient = $this->getLdapClient();
                $options = $this->getUtils()->getOptions();
        
                $loginFilterString = '';
                if (!empty($options['userLoginFilter'])) {
                    $loginFilterString = $this->convertToFilterFormat($options['userLoginFilter']);
                }
        
                $searchString = '(&(objectClass='.$options['userObjectClass'].')('.$options['userNameAttribute'].'='.$username.')'.$loginFilterString.')';
                $result = $ldapClient->search($searchString, null, LDAP\Client::[COLOR=#FF0000]SEARCH_SCOPE_SUB[/COLOR]);
                $GLOBALS['log']->debug('LDAP: user search string: "' . $searchString . '"');
        
                foreach ($result as $item) {
                    return $item["dn"];
                }
            }
        This one is set to "SEARCH_SCOPE_ONE" by default.
        I suggest to make this available in the UI as well.

        Comment

        • tarasm
          Super Moderator
          • Mar 2014
          • 573

          #34
          I will add this fix. Thanks
          Job Offers and Requests

          Comment

          Working...