Opened 7 years ago
Closed 5 years ago
#1483899 closed Feature Requests (fixed)
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 (2)
Change History (16)
comment:1 Changed 7 years ago by thomasb
- Milestone changed from 0.1-beta2 to later
comment:2 Changed 7 years ago by olo
- Cc olo added
comment:3 Changed 6 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.
comment:4 Changed 6 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 ;)
comment:5 Changed 6 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 ;)
comment:6 Changed 6 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)));
}
comment:7 Changed 6 years ago by thomasb
- Milestone changed from later to 0.1-stable
comment:8 Changed 6 years ago by petrofsk
Does anyone have this working in 0.1-rc2?
Thanks,
Warren
comment:9 follow-up: ↓ 13 Changed 5 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.
comment:10 Changed 5 years ago by till
- Owner set to till
- Status changed from new to assigned
comment:11 Changed 5 years ago by till
- Resolution set to fixed
- Status changed from assigned to closed
Comitted compose.patch, thanks!
comment:12 Changed 5 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.).
comment:13 in reply to: ↑ 9 Changed 5 years ago by hobstah
- Milestone changed from 0.1-stable to 0.4-beta
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 0.1-beta to 0.2-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.
comment:14 Changed 5 years ago by alec
- Milestone changed from 0.4-beta to 0.2-stable
- Resolution set to fixed
- Status changed from reopened to closed
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).

Later...