You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
postfixadmin/delete.php

52 lines
1.6 KiB
PHTML

<?php
require "config.inc.php";
require "my_lib.php";
$sessid = check_session();
$sessid_domain = $sessid['domain'];
$sessid_username = $sessid['username'];
$table = $_GET['table'];
$where = $_GET['where'];
$delete = $_GET['delete'];
$url = "main.php?" . session_name() . "=" . session_id();
if ($table == "alias") {
$query = "DELETE FROM alias WHERE address='$delete' AND domain='$sessid_domain'";
$result = db_query ("$query");
if ($result['rows'] != 1) {
print_error ("Unable to delete entry <b>$delete</b> from the $table table!", "YES", "MENU");
}
$query = "SELECT * FROM mailbox WHERE username='$delete' AND domain='$sessid_domain'";
$result = db_query ("$query");
if ($result['rows'] == 1) {
$query = "DELETE FROM mailbox WHERE username='$delete' AND domain='$sessid_domain'";
$result = db_query ("$query");
if ($result['rows'] == 1) {
header("Location: $url");
} else {
print_error ("Unable to delete entry <b>$delete</b> from the $table table!", "YES", "MENU");
}
}
header("Location: $url");
}
if ($table == "mailbox") {
$query = "DELETE FROM mailbox WHERE username='$delete' AND domain='$sessid_domain'";
$result = db_query ("$query");
if ($result['rows'] != 1) {
print_error ("Unable to delete entry <b>$delete</b> from the $table table!", "YES", "MENU");
}
$query = "DELETE FROM alias WHERE address='$delete' AND domain='$sessid_domain'";
$result = db_query ("$query");
if ($result['rows'] == 1) {
header("Location: $url");
} else {
print_error ("Unable to delete entry <b>$delete</b> from the $table table!", "YES", "MENU");
}
}
?>