diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2015-09-22 16:16:58 +0200 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2015-09-22 16:16:58 +0200 |
commit | 7af384d1ab11d773ecabf9f71c21f2fcfe758e07 (patch) | |
tree | 708d0ca7d78820091d0dcc570bd2638cab283d77 | |
parent | 81681b2072d6939d79e5032dc0ace8ea85cf2bba (diff) | |
download | webadmin-7af384d1ab11d773ecabf9f71c21f2fcfe758e07.tar.gz |
Rename bin/domain_delete.php to a script bin/purge-deleted-domains
-rwxr-xr-x[-rw-r--r--] | bin/purge-deleted-domains (renamed from bin/domain_delete.php) | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/domain_delete.php b/bin/purge-deleted-domains index 4dbe729..d5cb215 100644..100755 --- a/bin/domain_delete.php +++ b/bin/purge-deleted-domains @@ -1,3 +1,4 @@ +#!/usr/bin/php <?php /* +--------------------------------------------------------------------------+ @@ -115,10 +116,14 @@ function delete_domain($domain_dn, $domain) $entries[] = $inetdomainbasedn; $cn = str_replace('.', '_', $domain_name); - $entries[] = "cn={$cn},cn=ldbm database,cn=plugins,cn=config"; + if ($LDAP->get_entry_attribute("cn={$cn},cn=ldbm database,cn=plugins,cn=config", 'nsuniqueid')) { + $entries[] = "cn={$cn},cn=ldbm database,cn=plugins,cn=config"; + } $cn = str_replace(array(',', '='), array('\2C', '\3D'), $inetdomainbasedn); - $entries[] = "cn={$cn},cn=mapping tree,cn=config"; + if ($LDAP->get_entry_attribute("cn={$cn},cn=mapping tree,cn=config", 'nsuniqueid')) { + $entries[] = "cn={$cn},cn=mapping tree,cn=config"; + } foreach ($entries as $dn) { if (!$LDAP->delete_entry_recursive($dn)) { |