#1488254 closed Feature Patches (fixed)

Bugfix : LDAP issues

Reported by: nerbrume Owned by:
Priority: 5 Milestone: 0.8-rc
Component: LDAP connection Version: 0.6
Severity: normal Keywords:
Cc:

Description

I've fixed some bad behaviors of the LDAP backend, concerning requested fields. Rather than telling the user that fields are missing, my patch fills those fields with 'name' value (with a warning). This fixes the bug where one could not add contacts by clicking on their icons, as well as simplifying the user's life.

I also discarded the warning when creating users with no group. I'm not sure as to why it was here in the first place, I may have missed something.

Please bear in mind that I don't know php, I hence may have made mistakes. A review of this patch seems necessary to me before using it.

Attachments (1)

rcube_ldap.php.diff (1.5 KB) - added by nerbrume 18 months ago.

Download all attachments as: .zip

Change History (6)

Changed 18 months ago by nerbrume

comment:1 Changed 18 months ago by nerbrume

  • Type changed from Bugs to Feature Patches

comment:2 Changed 18 months ago by thomasb

Please test with the latest version. We recently added a similar functionality which automatically guesses the values of mandatory fields, although it doesn't yet fill the LDAP_rdn automatically. See rcube_ldap.php:L934

comment:3 Changed 18 months ago by nerbrume

Oh, my. Sorry for the noise, I didn't saw this issue being fixed in the trac.

Everything seems to be ok now, with a minor bug. When registering only a name and an incomplete e-mail address, the error issued to the user is 'formincomplete', while it should be 'emailformaterror', the 'formincomplete' error being taken care of later, duplicating fields as needed. This might depends on one's LDAP config, thought.

Using a intermediate variable (like in rcube_contacts.php) seems to fix this behavior. Here is a relevant diff :

936d935
< 
940c939
<             $valid = false;
---
>             return false;
965c964
<                 $valid = $this->validate($save_data, false);
---
>                 return $this->validate($save_data, false);
970c969
<             $valid = false;
---
>             return false;
974,976c973
<         $valid = parent::validate($save_data, $autofix);
< 
<               return $valid;
---
>         return parent::validate($save_data, $autofix);

As for the LDAP_rdn point, I'm not sure this should be adressed by rcube_ldap.php. However, a relevant comment in config/main.inc.php to indicate to an administrator that the rdn should be included in the required_fields would be a good idea.

Last edited 18 months ago by nerbrume (previous) (diff)

comment:4 Changed 15 months ago by alec

  • Milestone changed from later to 0.8-rc

comment:5 Changed 14 months ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [19fccd8b].

Note: See TracTickets for help on using tickets.