<?php
    if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../../../').'/');
    if (!defined('DOKU_PLUGIN')) {
      define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
    }
    define('DOKU_FILELISTMANAGER',1);
    require_once(DOKU_INC.'inc/init.php');
    require_once(DOKU_INC.'inc/lang/en/lang.php');
    require_once(DOKU_INC.'inc/lang/'.$conf['lang'].'/lang.php');
    require_once(DOKU_INC.'inc/media.php');
    require_once(DOKU_INC.'inc/common.php');
    require_once(DOKU_INC.'inc/search.php');
    require_once(DOKU_INC.'inc/template.php');
    require_once(DOKU_INC.'inc/auth.php');
    require_once('../functions.php');
    session_write_close();  //close session


    // get namespace to display (either direct or from deletion order)
    $NS = $_REQUEST['ns'];
    $NS = cleanID($NS);
    
    getPluginName();

    // check auth
    $AUTH = auth_quickaclcheck("$NS:*");

    // create the given namespace (just for beautification)
    if($AUTH >= AUTH_UPLOAD) { io_createNamespace("$NS:xxx", 'media'); }


    // finished - start output
    header('Content-Type: text/html; charset=utf-8');
    include('../filemanager.php');
