server()) {
metaRefresh("../login.php");
exit;
}
// print standard header
echo $_SESSION['header'];
echo ("
" . _("Delete User Profile") . "\n");
echo "\n";
echo ("\n\n
\n");
// check if admin has submited delete operation
if ($_POST['submit']) {
// delete user profile
if ($_POST['type'] == "user") {
if (!delUserProfile($_POST['del'])) {
StatusMessage("ERROR", "", _("Unable to delete profile!") . " " . $_POST['del']);
}
else StatusMessage("INFO", "", _("Deleted profile:") . " " . $_POST['del']);
}
// delete group profile
elseif ($_POST['type'] == "group") {
if (!delGroupProfile($_POST['del'])) {
StatusMessage("ERROR", "", _("Unable to delete profile!") . " " . $_POST['del']);
}
else StatusMessage("INFO", "", _("Deleted profile:") . " " . $_POST['del']);
}
// delete host profile
elseif ($_POST['type'] == "host") {
if (!delHostProfile($_POST['del'])) {
StatusMessage("ERROR", "", _("Unable to delete profile!") . " " . $_POST['del']);
}
else StatusMessage("INFO", "", _("Deleted profile:") . " " . $_POST['del']);
}
// wrong profile type
else {
StatusMessage("ERROR", "", _("Wrong or missing type!") . " " . $_POST['type']);
}
echo ("
" . _("Back to Profile Editor") . "");
echo ("