$smarty->assign("write", checkWritePerms($_GET['organ'])); $smarty->assign("admin", checkAdminPerms($_GET['organ'])); } //post /get? if (!isset($_POST['text']) && isset($_GET['file']) && isset($_GET['organ'])) { // read file if (checkOrgan($_GET['organ'])) { if (checkFilename($_GET['file']) && checkReadPerms($_GET['organ'])) { //input validation: get organ $text = readFromFile($_GET['organ'], $_GET['file']); $smarty->assign('text', $text); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); } else { if ($_GET['file'] == 'template' && checkReadPerms($_GET['organ'])) { $smarty->assign('text', readTemplate($_GET['organ'])); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); } else { if ($_GET['file'] == 'email' && checkReadPerms($_GET['organ'])) { $smarty->assign('text', readEmailTemplate($_GET['organ'])); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); } else { if ($_GET['file'] == 'resolutions.txt' && checkReadPerms($_GET['organ'])) { $smarty->assign('text', readResolutions($_GET['organ'])); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); } } }
/** * Generate plugin file from template * * NOTE: aborts entire script on error * * @param string $filename file name (relative path) * @param array $plgdata plugin data * @return void * */ function generatePluginFile($filename, $plgdata) { $content = readTemplate($filename); $content = patch($content, $plgdata); $content = optionalSections($content, $plgdata); writePluginFile($filename, $content, $plgdata); }
<? require_once "lib_admin.php"; require_once "lib_tpt.php"; $color = "#6b7b71"; $light_color = "#b0c7b4"; $dark_color = "#0a1414"; $fname = "tpt_".$_SESSION["c_id"]; $template = readTemplate($fname,$language); if ($template) $tptExists = true; else { $language = defaultTemplateLanguage(); $template = readTemplate($language,$language); $tptExists = false; } if (!$template) die("Impossible to load a valid template"); ?> <!DOCTYPE HTML> <html> <head> <TITLE><?php echo $_SESSION["c_name"]; ?> </TITLE> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <style type="text/css"> body {font-family:arial,sans-serif;font-size:14px;background-color:<?php
$pdf = new tFPDF("L"); $pdf->SetMargins(50,50,50); $pdf->AddFont(SERIF,"","DejaVuSerif.ttf",true); $pdf->AddFont(SERIF,"B","DejaVuSerif-Bold.ttf",true); $pdf->AddFont(SANS,"","DejaVuSans.ttf", true); $pdf->AddFont(SANS,"B","DejaVuSans-Bold.ttf", true); $fname = "tpt_".$_SESSION["c_id"]; $template = readTemplate($fname,$dummy); if ($template) $text = $template->txt; else { $fname = defaultTemplateLanguage(); $template = readTemplate($fname,$dummy); if (!$template) die("Impossible to load a valid template"); else $text = $template->getV1(); } $fbgname = getTemplateBackgroundFilename(); if (!file_exists($fbgname)) $fbgname = ""; if (!isset($_GET["t"])) printCertificate(null,null,null,null,null); else { $CERTIFICATES = true; // flag
} // Zuerst: Uebergebene Parameter ueberpruefen set_CatPageRequest(); # session setzen mit der vorschau vom editor aus dem admin if (DRAFT and getRequestValue('prevcontentadmin', 'post', false)) { unset($_SESSION['prevcontentadmin']); $tmp = getRequestValue('prevcontentadmin', 'post', false); if ($tmp != "prevcontentadminthisclear") { $_SESSION['prevcontentadmin'][CAT_REQUEST][PAGE_REQUEST] = $tmp; } exit("true"); } elseif (!DRAFT) { unset($_SESSION['prevcontentadmin']); } // Dann: HTML-Template einlesen und mit Inhalt fuellen readTemplate($template, $pagecontent); if (strpos($HTML, "<!--{MEMORYUSAGE}-->") > 1) { $HTML = str_replace("<!--{MEMORYUSAGE}-->", get_memory(), $HTML); } if (strpos($HTML, "<!--{EXECUTETIME}-->") > 1) { $HTML = str_replace("<!--{EXECUTETIME}-->", get_executTime($start_time), $HTML); } // Zum Schluß: Ausgabe des fertigen HTML-Dokuments echo $HTML; function get_executTime($start_time) { if (!function_exists('gettimeofday')) { return NULL; } list($usec, $sec) = explode(" ", microtime()); if ($start_time === false) {