[imp] ldap undefined offset

Karolis Dautartas list at public.lt
Thu Feb 10 16:21:53 PST 2005


hi,

I am trying to move from IMP3 installation to IMP4.
I have installed IMP4 in a separate folder. When I try to configure
preference backend to LDAP, I get the following error:

Notice: Undefined offset: 0 in /imp4/h/lib/Horde/Prefs/ldap.php on line 453
Warning: ldap_mod_add(): Modify: No such object in /imp4/h/lib/Horde/Prefs/ldap.php on line 463
Warning: ldap_mod_add(): Modify: No such object in /imp4/h/lib/Horde/Prefs/ldap.php on line 467
Warning: ldap_mod_replace(): Modify: No such object in /imp4/h/lib/Horde/Prefs/ldap.php on line 473

The source of the code involved is:

        $search = ldap_search($this->_connection, $this->_params['basedn'],
                              $this->_params['uid'] . '=' . $this->_user,
                              array('objectclass'));
        if ($search) {
            $result = ldap_get_entries($this->_connection, $search);
            if ($result) {
                $top = false;
                $hordeperson = false;

                for ($i = 0; $i < $result[0]['objectclass']['count']; $i++) {
                    if ($result[0]['objectclass'][$i] == 'top') {
                        $top = true;
                    } elseif ($result[0]['objectclass'][$i] == 'hordePerson') {
                        $hordeperson = true;
                    }
                }

                /* Add any missing objectclasses. */
                if (!$top) {
                    ldap_mod_add($this->_connection, $this->_dn, array('objectclass' => 'top'));
                }

                if (!$hordeperson) {
                    ldap_mod_add($this->_connection, $this->_dn, array('objectclass' => 'hordePerson'));
                }
            }
        }

It looks like IMP either can not find the object or can not get the
list of object classes.

Note that I am using the exact same info for LDAP server in IMP4 as I
did in IMP3.

Anyone know what the problem could be?

Karolis



More information about the imp mailing list