PDF editor bug should be removed

This commit is contained in:
duergner 2004-09-08 14:40:25 +00:00
parent fe4947e491
commit 61012f6572
3 changed files with 17 additions and 12 deletions

View File

@ -26,19 +26,23 @@ include_once("ldap.inc");
function getPDFStructureDefinitions($scope = "user") {
$return = array();
$dirHandle = opendir($_SESSION['lampath'] . '/config/pdf/' . $scope . '/');
while($file = readdir($dirHandle)) {
if(!is_dir($file) && $file != '.' && $file != '..' && $file != 'default.xml') {
array_push($return, substr($file,0,strlen($file)-4));
$path = $_SESSION['lampath'] . 'config/pdf/' . $scope;
if(is_dir($path)) {
$dirHandle = opendir($path);
while($file = readdir($dirHandle)) {
if(!is_dir($file) && $file != '.' && $file != '..' && $file != 'default.xml') {
array_push($return, substr($file,0,strlen($file)-4));
}
}
sort($return);
}
sort($return);
return $return;
}
function loadPDFStructureDefinitions($scope='user', $definition='default.xml') {
$parser = new xmlParser();
$xml = $parser->parse($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition);
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
$xml = $parser->parse($file);
$border = array();
$structure = array();
@ -61,7 +65,7 @@ function savePDFStructureDefinitions($scope,$definition) {
$handle = fopen($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition,'w');
$pdf_attributes = '';
foreach($_SESSION['currentPageDefinitions'] as $key => $value) {
if($key != 'TYPE') {
if($key != 'type') {
$pdf_attributes .= ' ' . $key . '="' . $value . '"';
}
}
@ -98,7 +102,8 @@ function savePDFStructureDefinitions($scope,$definition) {
}
function deletePDFStructureDefinition($scope,$definition) {
return unlink($_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition . '.xml');
$file = $_SESSION['lampath'] . 'config/pdf/' . $scope . '/' . $definition;
return unlink($file);
}
function getAvailableLogos() {

View File

@ -36,12 +36,12 @@ setlanguage();
// Unset pdf structure definitions in session if set
if(isset($_SESSION['currentPDFStructure'])) {
unset($_SESSION['currentPDFStructure']);
unset($_SESSION['availablePDFFields']);
unset($_SESSION['currentPageDefinitions']);
session_unregister('currentPDFStructure');
session_unregister('availablePDFFields');
session_unregister('currentPageDefinitions');
unset($_SESSION['currentPDFStructure']);
unset($_SESSION['availablePDFFields']);
unset($_SESSION['currentPageDefinitions']);
}
// check if user is logged in, if not go to login

View File

@ -319,7 +319,7 @@ elseif(isset($_POST['page'])) {
$_SESSION['currentPageDefinitions']['logo-max'] = true;
}
if($_POST['headline'] != 'LDAP Account Manager' && $_POST['headline'] != $_SESSION['currentPageDefinitions']['headline']) {
$_SESSION['currentPageDefinitions']['headline'] = $_POST['headline'];
$_SESSION['currentPageDefinitions']['headline'] = str_replace('<','',str_replace('>','',$_POST['headline']));
}
if($_POST['margin-top'] != '10.0' && $_SESSION['currentPageDefinitions']['margin-top'] != $_POST['margin-top']) {
$_SESSION['currentPageDefinitions']['margin-top'] = $_POST['margin-top'];