Permalink
Browse files

Merge pull request #243 from Udera/fix_alias_delete

Delete domainaliases with domain, fix https://github.com/Exim4U/src/i…
  • Loading branch information...
Udera committed Sep 21, 2017
2 parents 8ec9514 + a9fe8fe commit 2f5149260f2176af5303772a688bddbbf43687aa
Showing with 13 additions and 7 deletions.
  1. +13 −7 vexim/sitedelete.php
View
@@ -24,17 +24,23 @@
$usrdelquery = "DELETE FROM blocklists WHERE domain_id=:domain_id";
$usrdelsth = $dbh->prepare($usrdelquery);
$usrdelsuccess = $usrdelsth->execute(array(':domain_id'=>$_POST['domain_id']));
// if we were successful, delete the domain itself
if ($usrdelsuccess) {
$domdelquery = "DELETE FROM domains WHERE domain_id=:domain_id";
$domdelsth = $dbh->prepare($domdelquery);
$domdelsuccess = $domdelsth->execute(array(':domain_id'=>$_POST['domain_id']));
// If everything went well, redirect to a success page.
// if we were successful, delete the domain's aliases
if($usrdelsuccess) {
$aliasdelquery = "DELETE FROM domainalias WHERE domain_id=:domain_id";
$aliasdelsth = $dbh->prepare($aliasdelquery);
$aliasdelsuccess = $aliasdelsth->execute(array(':domain_id'=>$_POST['domain_id']));
// if we were successful, delete the domain itself
if ($aliasdelsuccess) {
$domdelquery = "DELETE FROM domains WHERE domain_id=:domain_id";
$domdelsth = $dbh->prepare($domdelquery);
$domdelsuccess = $domdelsth->execute(array(':domain_id'=>$_POST['domain_id']));
// If everything went well, redirect to a success page.
if ($domdelsuccess) {
header ("Location: site.php?deleted={$_POST['domain']}");
die;
}
}
}
}
} else {
header ("Location: site.php?faildeleted={$_POST['domain']}");
die;

0 comments on commit 2f51492

Please sign in to comment.