Example #1
0
<?php

session_start();
require_once "defines.php";
require_once "lib.php";
require_once "permissions.config.php";
if (isset($_GET['organ']) && isset($_GET['file'])) {
    if (checkOrgan($_GET['organ']) && checkReadPerms($_GET['organ']) && checkFilename($_GET['file'])) {
        $path = REPORTDIR . SUBUNPUBLISHED . $_GET['organ'] . "/" . $_GET['file'];
        $pathPDF = $path . ".pdf";
        pandocToPDF($path, $pathPDF);
        // We'll be outputting a PDF
        header('Content-type: application/pdf');
        // It will be called downloaded.pdf
        header('Content-Disposition: attachment; filename="' . $_GET['file'] . '.pdf"');
        // The PDF source is in original.pdf
        readfile($pathPDF);
    }
}
Example #2
0
<?php

session_start();
require_once 'lib.php';
require_once 'defines.php';
if (isset($_GET['organ']) && isset($_GET['file'])) {
    if (checkOrgan($_GET['organ']) && checkReadPerms($_GET['organ']) && checkFilename($_GET['file'])) {
        $file = REPORTDIR . SUBUNPUBLISHED . $_GET['organ'] . "/" . $_GET['file'];
        pandocToPDF($file, $file . ".pdf");
        $text = file_get_contents(REPORTDIR . $_GET['organ'] . ".email");
        $text .= "\n Edit-Link: https://protokolle.asta.kit.edu/edit/" . $_GET['organ'] . "/" . $_GET['file'] . " \n";
        $text .= file_get_contents($file);
        echo rlyWriteEmail("*****@*****.**", "APVEL", $emailUN[$_GET['organ']], "Unveröffentlichtes Protokoll" . $_GET['file'] . " " . $_GET['organ'], $text, array($file . ".pdf", $file));
    }
}
Example #3
0
{
    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);
                }
                // remove "[beschluss]" tags
                str_replace("[beschluss]", "", $text);
                str_replace("[/beschluss]", "", $text);
                file_put_contents($path, $text);
                //removes intern tags
                //move markdown file
                rename($path, REPORTDIR . SUBPUBLISHED . $_GET['organ'] . "/" . $_GET['file']);
                //write email