Ticket #1483899 (closed Feature Requests: fixed)

Opened 4 years ago

Last modified 18 months ago

LDAP address auto-completion

Reported by: jasondixon Owned by: till
Priority: 5 Milestone: 0.2-stable
Component: Core functionality Version: 0.2-beta
Severity: normal Keywords:
Cc: olo

Description

I'd like to request LDAP email address auto-completion for the composition window. This feature already exists for the local addressbook.

Attachments

compose_391.inc.diff (2.0 KB) - added by entropy 3 years ago.
Pierre Mauduit's ldap auto completion patch
compose.patch (1.6 KB) - added by arnested.dk 2 years ago.
LDAP-autocompletion-patch for 0.1-rc2

Change History

  Changed 4 years ago by thomasb

  • milestone changed from 0.1-beta2 to later

Later...

  Changed 4 years ago by olo

  • cc olo added

  Changed 3 years ago by entropy

Just so it doenst get lost in the shuffle. Pierre Mauduit submitted a working patch for this one the dev list a little while ago. I've got it running on production installation of roundcube and it's worked great. Needs eventual refinement, but a great interim solution. Attached the diff.

Changed 3 years ago by entropy

Pierre Mauduit's ldap auto completion patch

  Changed 3 years ago by haralder

There is one bug in this patch. If there are no contacts in the database addressbook, autocompletion does not work.

The reason is that autocompletion code is inside an IF loop: if ($DB->num_rows($sql_result))

{

[...]

/* LDAP autocompletion */ foreach ($CONFIGldap_public? as $ldapserv_config) {

I will try to correct it myself and post the patch to the patch, as soon as I have some time to learn php ;)

  Changed 3 years ago by haralder

Sorry about the format.

There is one bug in this patch. If there are no contacts in the database addressbook, autocompletion does not work.

The reason is that autocompletion code is inside an IF loop:

if ($DB->num_rows($sql_result))
    {
    ...
    /* LDAP autocompletion */
    foreach ($CONFIG['ldap_public'] as $ldapserv_config)
        {

I will try to correct it myself and post the patch to the patch, as soon as I have some time to learn php ;)

  Changed 3 years ago by haralder

Ok, this is the patch for an already patched compose.inc.

--- compose.inc-20070103	2007-01-03 14:15:20.000000000 +0100
+++ compose.inc	2007-01-03 14:28:15.000000000 +0100
@@ -790,6 +790,11 @@ if ($DB->num_rows($sql_result))
   while ($sql_arr = $DB->fetch_assoc($sql_result))
     if ($sql_arr['email'])
       $a_contacts[] = format_email_recipient($sql_arr['email'], rep_specialchars_output($sql_arr['name'], 'js'));
+  }
+
+if (!$a_contacts){
+  $a_contacts=array();
+  }

   /* LDAP autocompletion */
   foreach ($CONFIG['ldap_public'] as $ldapserv_config)
@@ -828,6 +833,7 @@ if ($DB->num_rows($sql_result))
       $cLdap->close ();
   }

+if ($a_contacts){
   $OUTPUT->add_script(sprintf("$JS_OBJECT_NAME.set_env('contacts', %s);", array2js($a_contacts)));
 }

  Changed 2 years ago by thomasb

  • milestone changed from later to 0.1-stable

  Changed 2 years ago by petrofsk

Does anyone have this working in 0.1-rc2?

Thanks,

Warren

follow-up: ↓ 13   Changed 2 years ago by arnested.dk

I rewrote the patch to work with 0.1-rc2.

It guess it can be a bit slow on large or slow LDAP-servers.

So maybe make the use of LDAP-autocompletion so be configurable.

Changed 2 years ago by arnested.dk

LDAP-autocompletion-patch for 0.1-rc2

  Changed 2 years ago by till

  • owner set to till
  • status changed from new to assigned

  Changed 2 years ago by till

  • status changed from assigned to closed
  • resolution set to fixed

Comitted compose.patch, thanks!

  Changed 2 years ago by till

Also introduced an additional check which compose.patch didn't cover. In compose.patch when people don't have ldap, they would still issue a search and this would lead to errors (due to no ldap config, etc.).

in reply to: ↑ 9   Changed 18 months ago by hobstah

  • status changed from closed to reopened
  • version changed from 0.1-beta to 0.2-beta
  • resolution fixed deleted
  • milestone changed from 0.1-stable to 0.4-beta

Replying to arnested.dk:

It guess it can be a bit slow on large or slow LDAP-servers. So maybe make the use of LDAP-autocompletion so be configurable.

I have this issues right now. Bigger public LDAP should be queried for actual search string on keypress. I think it could be resolved with LDAP query limited with sizelimit=15 and run for each keypress.

Also, listing whole public LDAP within addressbook is IMHO "bad idea (tm)". Searching is great, but listing is bad.

I've tryed to resolve this on the other end - limiting results on server, but the way it's implemented right now, the autocomplete won't work or will work only for first N LDAP entries (N=sizelimit on server)

I think it's usable, the way it is now but have room for improvement. Will try to look into if have more time. Hope i'ts okay if i reopen it.

  Changed 18 months ago by alec

  • status changed from reopened to closed
  • resolution set to fixed
  • milestone changed from 0.4-beta to 0.2-stable

It would be better to open a new feature request ticket. (I don't like old tickets and subject issue of this ticket was fixed).

Note: See TracTickets for help on using tickets.