From 0852eb8678c8afb23d76e70c575cba791cb77156 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sat, 24 Mar 2001 07:46:31 +0000 Subject: [PATCH] Add not-for-release delete_all() and commented call to it in index.php --- addressbook/inc/class.contacts_ldap.inc.php | 11 +++++++++++ addressbook/index.php | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.contacts_ldap.inc.php b/addressbook/inc/class.contacts_ldap.inc.php index ebc89c6315..eb7e1b0d3d 100644 --- a/addressbook/inc/class.contacts_ldap.inc.php +++ b/addressbook/inc/class.contacts_ldap.inc.php @@ -638,6 +638,17 @@ } } + function delete_all() + { + global $phpgw_info; + $sri = ldap_search($this->ldap, $phpgw_info["server"]["ldap_contact_context"], "uidnumber=*"); + $ldap_fields = ldap_get_entries($this->ldap, $sri); + + $entry = ""; + while (list($null,$entry) = each($ldap_fields)) { + $err = ldap_delete($this->ldap,$entry['dn']); + } + } } ?> diff --git a/addressbook/index.php b/addressbook/index.php index 5ea9d1bd4b..d2808ce8ed 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -28,7 +28,8 @@ "addressbook_footer" => "footer.tpl" )); $this = CreateObject("phpgwapi.contacts"); - + //$this->delete_all(); + //exit; // Read in user custom fields, if any $phpgw->preferences->read_repository(); $customfields = array();