summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/js/app.js5
-rw-r--r--program/steps/addressbook/func.inc7
2 files changed, 10 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 6d76d04e2..650dbaaf7 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -177,7 +177,10 @@ function rcube_webmail()
if ((this.env.action=='add' || this.env.action=='edit') && this.gui_objects.editform)
this.enable_command('save', true);
- this.enable_command('list', 'add', 'ldappublicsearch', true);
+ this.enable_command('list', 'add', true);
+
+ this.enable_command('ldappublicsearch', this.env.ldappublicsearch);
+
break;
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index ee3b8804a..f7993c9bc 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -30,7 +30,12 @@ if (strlen($_GET['_page']))
else
$CONTACTS_LIST['page'] = $_SESSION['page'] ? $_SESSION['page'] : 1;
-
+// disable the ldap public search button if there's no servers configured
+$enable_ldap = 'true';
+if (!$CONFIG['ldap_public'])
+ $enable_ldap = 'false';
+
+$OUTPUT->add_script("$JS_OBJECT_NAME.set_env('ldappublicsearch', $enable_ldap);");
// return the message list as HTML table
function rcmail_contacts_list($attrib)