summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-08-15 20:28:01 +0000
committerthomascube <thomas@roundcube.net>2007-08-15 20:28:01 +0000
commit6b603da6f16591b63f809ef967554d260bd0d891 (patch)
treeb941a1e65acd1f9b49e5a34ea277c4b6a388d765 /program
parent88f66ec89cf87328536757ac33e508a9614bdc09 (diff)
LDAP improvements
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc5
-rw-r--r--program/include/rcube_contacts.inc7
-rw-r--r--program/include/rcube_ldap.inc13
-rw-r--r--program/js/app.js1
-rw-r--r--program/steps/addressbook/copy.inc5
5 files changed, 27 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index f938174d6..bd4ebd0ef 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -299,7 +299,7 @@ function rcmail_set_imap_prop()
*/
function rcmail_shutdown()
{
- global $IMAP;
+ global $IMAP, $CONTACTS;
if (is_object($IMAP))
{
@@ -307,6 +307,9 @@ function rcmail_shutdown()
$IMAP->write_cache();
}
+ if (is_object($CONTACTS))
+ $CONTACTS->close();
+
// before closing the database connection, write session data
session_write_close();
}
diff --git a/program/include/rcube_contacts.inc b/program/include/rcube_contacts.inc
index 9ba965e2f..f01d22279 100644
--- a/program/include/rcube_contacts.inc
+++ b/program/include/rcube_contacts.inc
@@ -128,6 +128,13 @@ class rcube_contacts
/**
+ * Close connection to source
+ * Called on script shutdown
+ */
+ function close(){}
+
+
+ /**
* List the current set of contact records
*
* @param array List of cols to show
diff --git a/program/include/rcube_ldap.inc b/program/include/rcube_ldap.inc
index 976b73d2b..e6a15d9dc 100644
--- a/program/include/rcube_ldap.inc
+++ b/program/include/rcube_ldap.inc
@@ -58,7 +58,6 @@ class rcube_ldap
if (preg_match('/^(.+)_field$/', $prop, $matches))
$this->fieldmap[$matches[1]] = $value;
- // $this->filter = "(dn=*)";
$this->connect();
}
@@ -142,7 +141,10 @@ class rcube_ldap
function close()
{
if ($this->conn)
+ {
@ldap_unbind($this->conn);
+ $this->conn = null;
+ }
}
@@ -212,6 +214,13 @@ class rcube_ldap
*/
function list_records($cols=null, $subset=0)
{
+ // add general filter to query
+ if (!empty($this->prop['filter']))
+ {
+ $filter = $this->prop['filter'];
+ $this->set_search_set($filter);
+ }
+
// exec LDAP search if no result resource is stored
if ($this->conn && !$this->ldap_result)
$this->_exec_search();
@@ -442,4 +451,4 @@ class rcube_ldap
}
-?> \ No newline at end of file
+?>
diff --git a/program/js/app.js b/program/js/app.js
index 48597c57d..1d09fe901 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2253,6 +2253,7 @@ function rcube_webmail()
{
page = 1;
this.env.current_page = page;
+ this.reset_qsearch();
}
this.select_folder(src, this.env.source);
diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc
index e6d917e92..af8b87c40 100644
--- a/program/steps/addressbook/copy.inc
+++ b/program/steps/addressbook/copy.inc
@@ -36,8 +36,11 @@ if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && strlen($t
$OUTPUT->show_message('copyerror', 'error');
else
$OUTPUT->show_message('copysuccess', 'notice', array('nr' => count($success)));
+
+ // close connection to second address directory
+ $TARGET->close();
}
-
+
// send response
$OUTPUT->send();