function localdomain_remove() { include_once dirname(__FILE__) . "/ressources/class.ejabberd.inc"; include_once dirname(__FILE__) . "/ressources/class.artica.inc"; $usr = new usersMenus(); $tpl = new templates(); if ($usr->AllowChangeDomains == false) { echo $tpl->_ENGINE_parse_body('{no_privileges}'); exit; } $domain = $_POST["localdomain-remove"]; $ou = $_POST["ou"]; $tpl = new templates(); $artica = new artica_general(); $ldap = new clladp(); if ($artica->RelayType == "single") { $ldap->delete_VirtualDomainsMapsMTA($ou, $domain); } $ldap->DeleteLocadDomain($domain, $ou); $sql = "DELETE FROM postfix_duplicate_maps WHERE pattern='{$domain}'"; $q = new mysql(); $q->QUERY_SQL($sql, "artica_backup"); $jb = new ejabberd($domain); $jb->Delete(); ChockServices(); }
function DeleteInternetDomain() { $usr = new usersMenus(); $tpl = new templates(); if ($usr->AllowChangeDomains == false) { echo $tpl->_ENGINE_parse_body('{no_privileges}'); exit; } $domain = $_GET["DeleteInternetDomain"]; $ou = $_GET["ou"]; $tpl = new templates(); $artica = new artica_general(); $ldap = new clladp(); if ($artica->RelayType == "single") { $ldap->delete_VirtualDomainsMapsMTA($ou, $domain); } $ldap->DeleteLocadDomain($domain, $ou); $sql = "DELETE FROM postfix_duplicate_maps WHERE pattern='{$domain}'"; $q = new mysql(); $q->QUERY_SQL($sql, "artica_backup"); $q->QUERY_SQL("DELETE FROM domains`name`='{$domain}'", "powerdns"); $jb = new ejabberd($domain); $jb->Delete(); }
function DeleteInternetDomain() { $usr = new usersMenus(); if ($usr->AllowChangeDomains == false) { echo $tpl->_ENGINE_parse_body('{no_privileges}'); exit; } $domain = $_GET["DeleteInternetDomain"]; $ou = $_GET["ou"]; $tpl = new templates(); $artica = new artica_general(); $ldap = new clladp(); if ($artica->RelayType == "single") { $ldap->delete_VirtualDomainsMapsMTA($ou, $domain); } $HashDomains = $ldap->Hash_domains_table($ou); $ldap = new clladp(); $h = $ldap->Ldap_search($ldap->suffix, "(associatedDomain={$domain})", array("dn")); if ($h["count"] > 0) { $res["associatedDomain"] = $domain; if ($h["count"] == 1) { $res["objectClass"] = "domainRelatedObject"; } for ($i = 0; $i < $h["count"]; $i++) { $ldap->Ldap_del_mod($h[$i]["dn"], $res); } } writelogs("{$domain} type=" . $HashDomains[$domain], __FUNCTION__, __FILE__); switch ($HashDomains[$domain]) { case "associateddomain": $ldap->delete_associated_domain($ou, $domain); break; case "dn": if ($ldap->ExistsDN("cn={$domain},ou={$ou},{$ldap->suffix}")) { writelogs("cn={$domain},ou={$ou},{$ldap->suffix} exists, delete it...", __FUNCTION__, __FILE__); if (!$ldap->ldap_delete("cn={$domain},ou={$ou},{$ldap->suffix}")) { writelogs("Error line :" . __LINE__ . " " . $ldap->ldap_last_error, __FUNCTION__, __FILE__); } } break; default: return null; break; } if ($ldap->ldap_last_error != null) { echo $ldap->ldap_last_error; } else { echo html_entity_decode($tpl->_ENGINE_parse_body('{success}')); exit; } }