[sork] ldap problem

Eric Rostetter eric.rostetter at physics.utexas.edu
Wed Dec 4 16:57:40 2002


Quoting alex <alex@thbuo.gov.tw>:

> question 1: when click "My account" got error:
> ===============================================
> Notice: Undefined index: cn;lang-es
> in /usr/local/apache/horde.beta/accounts/lib/Driver/ldap.php on line 71

You just volunteered to debug/fix this ;)  The comments at the top of the
file read:

 * NOTE: This code is probably terrible.  I don't run ldap. I wrote
 * this simply as a template for others to start with.  If you don't
 * like the code, please fix it!  (however, it does work!)

and around line 71, the error line in question, reads:

        $information = ldap_get_entries($this->_ds, $searchResult);
        // FIXME: Need to check for errors here if nothing is returned above
        if ($information[0]['cn;lang-es'][0] != '') {
            $name = $information[0]['cn;lang-es'][0];
        } else {
            $name = $information[0]['cn'][0];
        }

You might be able to get around the error above by changing:

        if ($information[0]['cn;lang-es'][0] != '') {

to:

        if (isset($information[0]['cn;lang-es'][0])) {
 
or:

        if (!empty($information[0]['cn;lang-es'][0])) {

or, since I'm not sure why it is checking for lang-es anyway, it might be
able to be removed, and just use:

        $information = ldap_get_entries($this->_ds, $searchResult);
        // FIXME: Need to check for errors here if nothing is returned above
        $name = $information[0]['cn'][0];

Let me know if any/all of those work.  Also, anyone else who using ldap,
let me know what you think about the above!

> question 2: Can not change ldap password on openldap 2.x but openldap1.x ok !
> =============================================================================
> Warning: LDAP: modify operation could not be completed.
> in /usr/local/apache/horde.beta/passwd/lib/Driver/ldap.php on line 141
> 
> Failure in changing password: Insufficient access

Well, other than saying "check the archives" for info, I can't help much here.
Maybe some other ldap people can, but I think most are using openldap 1.x
and hence not seeing the problem?  But the error "Insufficient access" is
coming from ldap, and should be a good clue as for what to look for.  Check
your ldap logs and see if anything in there helps...

-- 
Eric Rostetter
The Department of Physics
The University of Texas at Austin

Why get even? Get odd!


More information about the sork mailing list