[dev] Empty Prefs in LDAP

Edwin Culp eculp@encontacto.net
Thu, 11 Apr 2002 17:35:08 -0700


Quoting Edwin Culp <eculp@encontacto.net>:

| Jon,
| 
<SNIP> 
| Fatal error: Undefined class name 'pref' in /usr/src/horde/lib/Prefs/ldap.php
| on line 312
| 

I fixed the above error. It was a missing "s" in Prefs:   The change
I sent earlier works but still doesn't cause the attribute with an 
empty value to be deleted.  I just doesn't change it.  That made me 
remember that maybe we should be using ldap_mod_del for dirty, empty, 
prefs.  That would solve the problem

In simplified form i think something like the following needs to be 
done somewhere in the line 300 area of ldap.php but I am not sure where.

foreach ($prefs in $pref) {
    if (empty($pref)) {
        ldap_mod_del($ds, $dn, $pref);
    } else {
        ldapmodify($ds,$dn,$pref);
    }
}

Does that make any sense at all or am I completely confused/lost?
I've tried a couple of times and have gotten errors with registry.php.

ed

P.S.  I added the missing "s" to your patch and got:
        Fatal error: Call to a member function on a non-object in
        /usr/src/horde/lib/Registry.php on line 590
      I haven't really looked for the problem yet, because
      I would prefer to see empty attributes deleted.

<SNIP>


-------------------------------------------------------------
 http://insourcery.com - Mergence of Business and Technology  
          a "Griffin Plaza Partners, LLC" Company