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();