Permalink
Browse files

Delete domainaliases with domain, fix Exim4U/src#3

  • Loading branch information...
Udera committed Jun 30, 2017
1 parent 8ec9514 commit a9fe8fedc385a6951951894e4de371004130db13
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 a9fe8fe

Please sign in to comment.