diff --git a/lam/templates/profedit/profiledelete.php b/lam/templates/profedit/profiledelete.php index f6aff7fd..0d2832d5 100644 --- a/lam/templates/profedit/profiledelete.php +++ b/lam/templates/profedit/profiledelete.php @@ -51,30 +51,29 @@ if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) { exit; } -// print standard header -include '../main_header.php'; -echo ("


\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'] . '&deleteFailed=' . $_POST['del']); + exit(); + } + else { + metaRefresh('profilemain.php?deleteScope=' . $_POST['type'] . '&deleteSucceeded=' . $_POST['del']); + exit(); } - else StatusMessage("INFO", _("Deleted profile:"), $_POST['del'] . "." . $_POST['type']); - echo ("
" . _("Back to profile editor") . ""); - echo ("\n"); - exit; } // check if admin has aborted delete operation if ($_POST['abort']) { - StatusMessage("INFO", "", _("Delete operation canceled.")); - echo ("
" . _("Back to profile editor") . ""); - echo ("\n"); + metaRefresh('profilemain.php'); exit; } +// print standard header +include '../main_header.php'; +echo ("


\n"); + $type = $_GET['type']; echo ("

" . _("Do you really want to delete this profile?") . " "); echo ($_GET['del'] . "

\n"); diff --git a/lam/templates/profedit/profilemain.php b/lam/templates/profedit/profilemain.php index 22fca206..68fb719a 100644 --- a/lam/templates/profedit/profilemain.php +++ b/lam/templates/profedit/profilemain.php @@ -107,6 +107,12 @@ echo "

" . _('Profile editor') . "

\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 "
\n"; echo "
\n";