<?php

define("DOKU_INC", realpath(dirname(__FILE__) . '/../../../../../../') . '/');
define("PAGES", DOKU_INC . 'data/pages/');
define("FCKEDITOR", realpath(dirname(__FILE__) . '/../') . '/');
define('CONNECTOR', FCKEDITOR . 'filemanager/connectors/php/');
require_once CONNECTOR . 'check_acl.php';
global $dwfck_conf;
$page = ltrim($_REQUEST['dw_id'], ':');
$page = str_replace(':', '/', $page);
$path = PAGES . $page . '.txt';
//file_put_contents('ajax-resp.txt', "dw_id=" . $_REQUEST['dw_id'] . "\npage=$page\npath=$path\n" );
$dwfck_conf = doku_config_values();
// needed for cleanID
$resp = "";
$headers = array();
$lines = file($path);
foreach ($lines as $line) {
    if (preg_match('/^=+([^=]+)=+\\s*$/', $line, $matches)) {
        $suffix_anchor = "";
        $suffix_header = "";
        if (isset($headers[$matches[1]])) {
            $headers[$matches[1]]++;
            $suffix_anchor = $headers[$matches[1]];
            $suffix_header = " [{$suffix_anchor}]";
        } else {
            $headers[$matches[1]] = 0;
        }
        $resp .= trim($matches[1]) . $suffix_header . ";;";
        $resp .= cleanID($matches[1]) . $suffix_anchor . "@@";
    }
示例#2
0
 * == END LICENSE ==
 *
 * Configuration file for the File Manager Connector for PHP.
 */
require_once 'check_acl.php';
if (!defined('DOKU_INC')) {
    define('DOKU_INC', realpath(dirname(__FILE__) . '/../../../../../../../../') . '/');
}
global $Config;
global $AUTH;
global $dwfck_client;
global $topLevelFolder;
global $sep;
global $useNixStyle;
global $Dwfck_conf_values;
$Dwfck_conf_values = doku_config_values();
$DWFCK_con_dbg = false;
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
//		authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = true;
if (isset($_REQUEST) && isset($_REQUEST['DWFCK_Client'])) {
    $dwfck_client = $_REQUEST['DWFCK_Client'];
    if (!$dwfck_client) {
        $AUTH_INI = 255;
    }
} else {
    $AUTH_INI = 255;
}
$Config['osDarwin'] = DWFCK_is_OS('DARWIN') ? true : false;
/**