LDAPAccountManager/lam/templates/pdfedit/pdfdelete.php

96 lines
3.2 KiB
PHP
Raw Normal View History

<?php
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
2006-03-03 17:30:35 +00:00
Copyright (C) 2004 - 2006 Michael D<EFBFBD>rgner
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/**
* Manages deletion of pdf structures.
*
* @package PDF
* @author Michael D<EFBFBD>rgner
*/
2006-03-26 17:51:25 +00:00
/** security functions */
include_once("../../lib/security.inc");
/** helper functions for pdf */
include_once('../../lib/pdfstruct.inc');
// start session
2006-03-26 17:51:25 +00:00
startSecureSession();
setlanguage();
// check if user is logged in, if not go to login
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
metaRefresh("../login.php");
exit;
}
// print standard header
echo $_SESSION['header'];
2004-10-23 11:11:31 +00:00
echo ("<title>" . _("Delete PDF structure") . "</title>\n");
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo ("</head>\n<body>\n<p><br></p>\n");
// check if admin has submited delete operation
if ($_POST['submit']) {
// delete user profile
if(!deletePDFStructureDefinition($_POST['type'],$_POST['delete'])) {
2005-07-27 18:05:18 +00:00
StatusMessage('ERROR', '', _('Unable to delete PDF structure!') . ' ' . _('Scope') . ': ' . $_POST['type'] . ' ' . _('Name') . ': ' . $_POST['delete']);
}
else {
2005-07-27 18:05:18 +00:00
StatusMessage('INFO', '', _('Deleted PDF structure:') . ' ' . _('Scope') . ': ' . $_POST['type'] . ' ' . _('Name') . ': ' . $_POST['delete']);
}
echo ("<br><a href=\"pdfmain.php\">" . _("Back to PDF 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=\"pdfmain.php\">" . _("Back to PDF Editor") . "</a>");
echo ("</body></html>\n");
exit;
}
// check if right type was given
$type = $_GET['type'];
2006-01-01 16:30:05 +00:00
echo ("<p align=\"center\"><big>" . _("Do you really want to delete this PDF structure?") . "</big>");
echo "<br>\n";
echo "<br></p>\n";
echo "<table align=\"center\">\n";
echo "<tr><td>\n";
2006-03-04 10:49:55 +00:00
echo "<b>" . _('Account type') . ': </b>' . getTypeAlias($_GET['type']);
2006-01-01 16:30:05 +00:00
echo "</td></tr>\n";
echo "<tr><td>\n";
echo "<b>" . _('Name') . ': </b>' . $_GET['delete'] . "<br>\n";
echo "</td></tr>\n";
echo "</table>\n";
echo "<br>\n";
echo ("<form action=\"pdfdelete.php\" method=\"post\">\n");
echo ("<p align=\"center\">\n");
2006-03-04 10:49:55 +00:00
echo ("<input type=\"submit\" name=\"submit\" value=\"" . _("Delete") . "\">\n");
echo ("<input type=\"submit\" name=\"abort\" value=\"" . _("Cancel") . "\">\n");
2006-01-01 16:30:05 +00:00
echo ("<input type=\"hidden\" name=\"type\" value=\"" . $_GET['type'] . "\">");
echo ("<input type=\"hidden\" name=\"delete\" value=\"" . $_GET['delete'] . "\">");
echo ("</p></form></body></html>\n");