Skip to content

Commit

Permalink
Merge pull request vexim#243 from Udera/fix_alias_delete
Browse files Browse the repository at this point in the history
Delete domainaliases with domain, fix https://github.com/Exim4U/src/i…
  • Loading branch information
Udera authored Sep 21, 2017
2 parents 8ec9514 + a9fe8fe commit 2f51492
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions vexim/sitedelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f51492

Please sign in to comment.