Example #1
0
 * @link      http://www.phpmyfaq.de
 * @since     2004-04-29
 */
if (!defined('IS_VALID_PHPMYFAQ')) {
    header('Location: http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
if ($permission["editcateg"]) {
    $id = PMF_Filter::filterInput(INPUT_GET, 'cat', FILTER_VALIDATE_INT);
    $parent_id = PMF_Filter::filterInput(INPUT_GET, 'parent_id', FILTER_VALIDATE_INT);
    $category = new PMF_Category($current_admin_user, $current_admin_groups, false);
    $categories = $category->getAllCategories();
    $category->categories = null;
    unset($category->categories);
    $category->getCategories($parent_id, false);
    $category->buildTree($parent_id);
    $header = sprintf('%s: <em>%s</em>', $PMF_LANG['ad_categ_move'], $category->categories[$id]['name']);
    ?>
        <header>
            <h2><?php 
    print $header;
    ?>
</h2>
        </header>
        <form action="?action=changecategory" method="post">
            <input type="hidden" name="cat" value="<?php 
    print $id;
    ?>
" />
            <input type="hidden" name="csrf" value="<?php 
    print $user->getCsrfTokenFromSession();
Example #2
0
    $protocol = 'http';
    if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
        $protocol = 'https';
    }
    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
    exit;
}
//
// GET Parameters Syntax:
//   export.file.php?
//          type={pdf|xhtml|xml}
//      [&dispos={inline|attachment}], default: attachment
//       [&catid=NN[&downwards=1]], default: all, downwards
//
$categoryId = PMF_Filter::filterInput(INPUT_POST, 'catid', FILTER_VALIDATE_INT);
$downwards = PMF_Filter::filterInput(INPUT_POST, 'downwards', FILTER_VALIDATE_BOOLEAN, false);
$inlineDisposition = PMF_Filter::filterInput(INPUT_POST, 'dispos', FILTER_SANITIZE_STRING);
$type = PMF_Filter::filterInput(INPUT_POST, 'type', FILTER_SANITIZE_STRING, 'none');
$faq = new PMF_Faq($faqConfig);
$category = new PMF_Category($faqConfig);
$category->buildTree();
$tags = new PMF_Tags($faqConfig);
$export = PMF_Export::create($faq, $category, $faqConfig, $type);
$content = $export->generate($categoryId, $downwards);
// Stream the file content
$oHttpStreamer = new PMF_HttpStreamer(Response::create(), $type, $content);
if ('inline' == $inlineDisposition) {
    $oHttpStreamer->send(PMF_HttpStreamer::HTTP_CONTENT_DISPOSITION_INLINE);
} else {
    $oHttpStreamer->send(PMF_HttpStreamer::HTTP_CONTENT_DISPOSITION_ATTACHMENT);
}