server()) {
metaRefresh("../login.php");
exit;
}
// Write $_POST variables to $_GET when form was submitted via post
if(isset($_POST['type'])) {
$_GET = $_POST;
if($_POST['pdfname'] == '') {
unset($_GET['pdfname']);
}
}
// Abort and go back to main pdf structure page
if(isset($_GET['abort'])) {
metarefresh('pdfmain.php');
exit;
}
// set new logo and headline
if ((isset($_GET['headline'])) && ($_GET['logoFile'] != $_SESSION['currentPageDefinitions']['filename'])) {
$_SESSION['currentPageDefinitions']['filename'] = $_GET['logoFile'];
}
if ((isset($_GET['headline'])) && ($_GET['headline'] != $_SESSION['currentPageDefinitions']['headline'])) {
$_SESSION['currentPageDefinitions']['headline'] = str_replace('<','',str_replace('>','',$_GET['headline']));
}
// Check if pdfname is valid, then save current structure to file and go to
// main pdf structure page
if(isset($_GET['submit'])) {
include '../main_header.php';
if(!isset($_GET['pdfname']) || !preg_match('/[a-zA-Z0-9\-\_]+/',$_GET['pdfname'])) {
StatusMessage('ERROR', _('PDF-structure name not valid'), _('The name for that PDF-structure you submitted is not valid. A valid name must constist at least of one of the following characters \'a-z\',\'A-Z\',\'0-9\',\'_\',\'-\',\'.\'.'));
}
else {
$return = savePDFStructureDefinitions($_GET['type'],$_GET['pdfname']);
if($return == 'ok') {
StatusMessage('INFO', _("PDF structure was successfully saved."), $_GET['pdfname']);
}
elseif($return == 'no perms'){
StatusMessage('ERROR', _("Could not save PDF profile, access denied."), $_GET['pdfname']);
}
}
echo ("
" . _("Back to PDF Editor") . "");
echo "