show profile list when file was deleted successfully

This commit is contained in:
Roland Gruber 2010-05-26 18:41:00 +00:00
parent 16df1a2a77
commit c4955f49bc
2 changed files with 17 additions and 12 deletions

View File

@ -51,30 +51,29 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
exit;
}
// print standard header
include '../main_header.php';
echo ("<p><br></p>\n");
// check if admin has submited delete operation
if ($_POST['submit']) {
// delete profile
if (!delAccountProfile($_POST['del'], $_POST['type'])) {
StatusMessage("ERROR", _("Unable to delete profile!"), $_POST['del'] . "." . $_POST['type']);
metaRefresh('profilemain.php?deleteScope=' . $_POST['type'] . '&amp;deleteFailed=' . $_POST['del']);
exit();
}
else {
metaRefresh('profilemain.php?deleteScope=' . $_POST['type'] . '&amp;deleteSucceeded=' . $_POST['del']);
exit();
}
else StatusMessage("INFO", _("Deleted profile:"), $_POST['del'] . "." . $_POST['type']);
echo ("<br><a href=\"profilemain.php\">" . _("Back to profile editor") . "</a>");
echo ("</body></html>\n");
exit;
}
// check if admin has aborted delete operation
if ($_POST['abort']) {
StatusMessage("INFO", "", _("Delete operation canceled."));
echo ("<br><a href=\"profilemain.php\">" . _("Back to profile editor") . "</a>");
echo ("</body></html>\n");
metaRefresh('profilemain.php');
exit;
}
// print standard header
include '../main_header.php';
echo ("<p><br></p>\n");
$type = $_GET['type'];
echo ("<p align=\"center\"><big>" . _("Do you really want to delete this profile?") . " <b>");
echo ($_GET['del'] . "</b></big><br></p>\n");

View File

@ -107,6 +107,12 @@ echo "<h1>" . _('Profile editor') . "</h1>\n";
if (isset($_GET['savedSuccessfully'])) {
StatusMessage("INFO", _("Profile was saved."), htmlspecialchars($_GET['savedSuccessfully']));
}
if (isset($_GET['deleteFailed'])) {
StatusMessage('ERROR', _('Unable to delete profile!'), getTypeAlias($_GET['deleteScope']) . ': ' . htmlspecialchars($_GET['deleteFailed']));
}
if (isset($_GET['deleteSucceeded'])) {
StatusMessage('INFO', _('Deleted profile.'), getTypeAlias($_GET['deleteScope']) . ': ' . htmlspecialchars($_GET['deleteSucceeded']));
}
echo "<br>\n";
echo "<form action=\"profilemain.php\" method=\"post\">\n";