2004-05-30 13:43:42 +00:00
|
|
|
|
<?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) 2003 - 2006 Michael D<EFBFBD>rgner
|
2004-05-30 13:43:42 +00:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2005-07-27 17:43:57 +00:00
|
|
|
|
*/
|
2004-05-30 13:43:42 +00:00
|
|
|
|
|
2005-07-27 17:43:57 +00:00
|
|
|
|
/**
|
|
|
|
|
* This is the main window of the pdf structure editor.
|
|
|
|
|
*
|
|
|
|
|
* @author Michael D<EFBFBD>rgner
|
|
|
|
|
* @package PDF
|
2004-05-30 13:43:42 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2005-07-27 17:43:57 +00:00
|
|
|
|
/** access to PDF configuration files */
|
2004-05-30 13:43:42 +00:00
|
|
|
|
include_once("../../lib/pdfstruct.inc");
|
2005-07-27 17:43:57 +00:00
|
|
|
|
/** LDAP object */
|
2004-05-30 13:43:42 +00:00
|
|
|
|
include_once("../../lib/ldap.inc");
|
2005-07-27 17:43:57 +00:00
|
|
|
|
/** for language settings */
|
2004-05-30 13:43:42 +00:00
|
|
|
|
include_once("../../lib/config.inc");
|
2005-07-27 17:43:57 +00:00
|
|
|
|
/** module functions */
|
2004-07-16 06:33:37 +00:00
|
|
|
|
include_once("../../lib/modules.inc");
|
2004-05-30 13:43:42 +00:00
|
|
|
|
|
|
|
|
|
// start session
|
|
|
|
|
session_save_path("../../sess");
|
|
|
|
|
@session_start();
|
|
|
|
|
|
|
|
|
|
setlanguage();
|
|
|
|
|
|
2004-06-03 14:26:48 +00:00
|
|
|
|
// Unset pdf structure definitions in session if set
|
|
|
|
|
if(isset($_SESSION['currentPDFStructure'])) {
|
|
|
|
|
session_unregister('currentPDFStructure');
|
|
|
|
|
session_unregister('availablePDFFields');
|
2004-08-03 19:07:31 +00:00
|
|
|
|
session_unregister('currentPageDefinitions');
|
2004-09-08 14:40:25 +00:00
|
|
|
|
unset($_SESSION['currentPDFStructure']);
|
|
|
|
|
unset($_SESSION['availablePDFFields']);
|
|
|
|
|
unset($_SESSION['currentPageDefinitions']);
|
2004-06-03 14:26:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-05-30 13:43:42 +00:00
|
|
|
|
// check if user is logged in, if not go to login
|
|
|
|
|
if (!$_SESSION['ldap'] || !$_SESSION['ldap']->server()) {
|
|
|
|
|
metaRefresh("../login.php");
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check if user has pressed submit or abort button
|
|
|
|
|
if ($_POST['forward'] == "yes") {
|
|
|
|
|
// on abort go back to main page
|
|
|
|
|
if ($_POST['abort']) {
|
2006-01-06 10:49:06 +00:00
|
|
|
|
metaRefresh("../tools.php");
|
2004-05-30 13:43:42 +00:00
|
|
|
|
}
|
|
|
|
|
// on submit forward to other pdf structure pages
|
|
|
|
|
else if($_POST['submit']) {
|
2004-07-16 06:33:37 +00:00
|
|
|
|
if($_POST['pdf'] == 'new') {
|
|
|
|
|
metaRefresh('pdfpage.php?type=' . $_POST['scope']);
|
2004-05-30 13:43:42 +00:00
|
|
|
|
}
|
2004-07-16 06:33:37 +00:00
|
|
|
|
else if($_POST['pdf'] == 'edit') {
|
|
|
|
|
$edit = split(':',$_POST['edit']);
|
|
|
|
|
metaRefresh('pdfpage.php?type=' . $edit[0] . '&edit=' . $edit[1]);
|
2004-05-30 13:43:42 +00:00
|
|
|
|
}
|
2004-07-16 06:33:37 +00:00
|
|
|
|
else if($_POST['pdf'] == 'delete') {
|
|
|
|
|
$delete = split(':',$_POST['delete']);
|
|
|
|
|
metaRefresh('pdfdelete.php?type=' . $delete[0] . '&delete=' . $delete[1]);
|
2004-05-30 13:43:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2006-01-01 16:30:05 +00:00
|
|
|
|
$scopes = $_SESSION['config']->get_ActiveTypes();
|
2004-05-30 13:43:42 +00:00
|
|
|
|
|
2004-07-16 06:33:37 +00:00
|
|
|
|
$availableStructureDefinitions = '';
|
|
|
|
|
$availableScopes = '';
|
2004-05-30 13:43:42 +00:00
|
|
|
|
|
2004-07-16 06:33:37 +00:00
|
|
|
|
foreach($scopes as $scope) {
|
|
|
|
|
$pdfStructDefs = getPDFStructureDefinitions($scope);
|
2006-02-05 18:06:49 +00:00
|
|
|
|
$availableScopes .= '<option value="' . $scope . '">' . getTypeAlias($scope) . "</option>\n";
|
2004-07-16 06:33:37 +00:00
|
|
|
|
|
|
|
|
|
foreach($pdfStructDefs as $pdfStructureDefinition) {
|
2006-02-05 18:06:49 +00:00
|
|
|
|
$availableStructureDefinitions .= '<option value="' . $scope . ':' . $pdfStructureDefinition . '">' . getTypeAlias($scope) . ' - ' . $pdfStructureDefinition . "</option>\n";
|
2004-07-16 06:33:37 +00:00
|
|
|
|
}
|
2004-05-30 13:43:42 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo $_SESSION['header'];
|
|
|
|
|
?>
|
|
|
|
|
<title>LDAP Account Manager</title>
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="../../style/layout.css">
|
2006-02-05 18:06:49 +00:00
|
|
|
|
<link rel="stylesheet" type="text/css" href="../../style/type_user.css">
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<p></p>
|
|
|
|
|
<form action="pdfmain.php" method="post">
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<!-- pdf structure options -->
|
2006-02-05 18:06:49 +00:00
|
|
|
|
<fieldset class="useredit">
|
2004-05-30 13:43:42 +00:00
|
|
|
|
<legend>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<b><?php echo _("PDF structures"); ?></b>
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</legend>
|
|
|
|
|
<table border=0>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<!-- new pdf structure -->
|
2004-05-30 13:43:42 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<input type="radio" name="pdf" value="new" checked="checked">
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</td>
|
2006-02-05 18:06:49 +00:00
|
|
|
|
<td><?php echo _("Create a new PDF structure for scope: "); ?><select name="scope" size="1"><?php echo $availableScopes; ?></select></td>
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</tr>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<!-- edit pdf structure -->
|
2004-05-30 13:43:42 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<input type="radio" name="pdf" value="edit">
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<select name="edit" size=1>
|
|
|
|
|
<?php echo $availableStructureDefinitions; ?>
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</select>
|
2006-02-05 18:06:49 +00:00
|
|
|
|
<?php echo _("Edit PDF structure"); ?></td>
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</tr>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<!-- delete pdf structure -->
|
2004-05-30 13:43:42 +00:00
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<input type="radio" name="pdf" value="delete">
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</td>
|
|
|
|
|
<td>
|
2004-07-16 06:33:37 +00:00
|
|
|
|
<select name="delete" size=1>
|
|
|
|
|
<?php echo $availableStructureDefinitions; ?>
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</select>
|
2006-02-05 18:06:49 +00:00
|
|
|
|
<?php echo _("Delete PDF structure"); ?></td>
|
2004-05-30 13:43:42 +00:00
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</fieldset>
|
|
|
|
|
<p></p>
|
|
|
|
|
|
|
|
|
|
<!-- forward is used to check if buttons were pressed -->
|
|
|
|
|
<p>
|
|
|
|
|
<input type="hidden" name="forward" value="yes">
|
|
|
|
|
|
|
|
|
|
<input type="submit" name="submit" value="<?php echo _("Submit"); ?>">
|
|
|
|
|
<input type="submit" name="abort" value="<?php echo _("Abort"); ?>">
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|