} } } } } if (isset($_POST['text']) and isset($_GET['organ']) and isset($_GET['file'])) { //save changes if (checkOrgan($_GET['organ']) and checkWritePerms($_GET['organ'])) { if (checkFilename($_GET['file']) and checkLock($_SESSION['user'], $_GET['organ'], $_GET['file'])) { writeIntoFile($_POST['text'], $_GET['organ'], $_GET['file']); $smarty->assign('text', $_POST['text']); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); deleteLock($_GET['organ'], $_GET['file']); } else { if (checkAdminPerms($_GET['organ'])) { if ($_GET['file'] == "template") { writeTemplate($_POST['text'], $_POST['organ']); $smarty->assign('text', $_POST['text']); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); deleteLock($_GET['organ'], $_GET['file']); } else { if ($_GET['file'] == "email") { writeEmailTemplate($_POST['text'], $_GET['organ']); $smarty->assign('text', $_POST['text']); $smarty->assign('organ', $_GET['organ']); $smarty->assign('file', $_GET['file']); deleteLock($_GET['organ'], $_GET['file']); } else { if ($_GET['file'] == "resolutions.txt") {
<?php session_start(); // put full path to Smarty.class.php require_once 'smartydef.php'; require 'defines.php'; require 'lib.php'; function remove_intern_tags($text) { return preg_replace(INTERN_REGEX, "", $text); } $smarty->assign('this', 'publish.php'); if (isset($_GET['file']) && isset($_GET['organ'])) { if (checkOrgan($_GET['organ']) && checkFilename($_GET['file']) && checkAdminPerms($_GET['organ'])) { $organ = $_GET['organ']; $folder = REPORTDIR . SUBUNPUBLISHED . $organ . '/'; $path = $folder . $_GET['file']; if (is_file($path)) { $text = readFromFile($organ, $_GET['file']); //remove [intern][/intern] $text = remove_intern_tags($text); if (isset($_GET['rly'])) { pandocToHTML($path, REPORTDIR . SUBPUBLISHED . $_GET['organ'] . "/" . $_GET['file'] . ".html"); pandocToPDF($path, REPORTDIR . SUBPUBLISHED . $_GET['organ'] . "/" . $_GET['file'] . ".pdf"); //resolution collection $conclusions = array(); preg_match_all(";\\[beschluss\\](.*?)\\[/beschluss\\];s", $text, $conclusions); foreach ($conclusions[0] as $key => $con) { $str = substr($con, 11, -12); file_put_contents(REPORTDIR . SUBPUBLISHED . $_GET['organ'] . ".resolutions.txt", $_GET['file'] . ": " . $str . "\n", FILE_APPEND); }
$smarty->assign('organs', $organs); $smarty->assign('this', 'invite.php'); if (isset($_SESSION['user'])) { $user = $_SESSION['user']; } $smarty->assign("user", $user); if (isset($_GET['organ'])) { if (checkOrgan($_GET['organ'])) { //input validation $smarty->assign("read", checkReadPerms($_GET['organ'])); $smarty->assign("write", checkWritePerms($_GET['organ'])); $smarty->assign("admin", checkAdminPerms($_GET['organ'])); $smarty->assign("organ", $_GET['organ']); $file = REPORTDIR . "/" . $_GET['organ'] . ".invitations.txt"; //only admin is allowed to invite if (checkAdminPerms($_GET['organ']) && isset($_POST['mailtext'])) { // append to report dir / $organ.invitation $add = $_POST['mailtext'] . "\n====End of Invitation====\n"; $add .= file_get_contents($file); file_put_contents($file, $add); rlyWriteEMail($emailFrom[$_GET['organ']], "APVEL Protokollsystem", $emailUN[$_GET['organ']], "Einladung zur nächsten Sitzung " . $organs[$_GET['organ']], $_POST['mailtext'], array()); } // get text $lastInvite = ""; $handle = fopen($file, "r"); foreach (file($file) as $line) { if ($line != "====End of Invitation====\n") { $lastInvite .= $line; } else { break; }
$mdfile = $_GET['report']; $mdpath = REPORTDIR . SUBPUBLISHED . $_GET['organ'] . "/" . $mdfile; $htmlpath = $mdpath . ".html"; $pdfpath = $mdpath . ".pdf"; rename($mdpath, REPORTDIR . SUBUNPUBLISHED . $_GET['organ'] . "/" . $mdfile); unlink($htmlpath); unlink($pdfpath); //write Email: $sub = "Protokoll zurueckgezogen : " . $_GET["organ"] . $_GET['report']; rlyWriteEmail($emailFrom[$_GET['organ']], 'APVEL', $emailUN[$_GET['organ']], $sub, "Begruendung folgt gleich", array()); } } else { //show unpublished reports? $smarty->assign("read", checkReadPerms($_GET['organ'])); $smarty->assign("write", checkWritePerms($_GET['organ'])); $smarty->assign("admin", checkAdminPerms($_GET['organ'])); //show unpublished reports $folderPub = REPORTDIR . SUBPUBLISHED . $_GET['organ'] . '/'; $folderUnPub = REPORTDIR . SUBUNPUBLISHED . $_GET['organ'] . '/'; if (!is_dir($folderPub)) { die("Wrong folder structure: " . $folderPub); } if (!is_dir($folderUnPub)) { die("Wrong folder structure: " . $folderUnPub); } $unpublishedReports = array(); $publishedReports = array(); getPublishedArray($folderPub, $publishedReports); readDirIntoArray($folderUnPub, ".md", $unpublishedReports); sort($unpublishedReports); if (isset($_GET['page'])) {