filemanager.config.php in FCKeditor - WYSIWYG HTML editor 6.2
File
filemanager.config.php
View source
<?php
$GLOBALS['devel_shutdown'] = FALSE;
$fck_user_files_path = '';
$fck_user_files_absolute_path = '';
function CheckAuthentication() {
static $authenticated;
if (!isset($authenticated)) {
if (!empty($_SERVER['SCRIPT_FILENAME'])) {
$drupal_path = dirname(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))));
if (!file_exists($drupal_path . '/includes/bootstrap.inc')) {
$drupal_path = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
$depth = 2;
do {
$drupal_path = dirname($drupal_path);
$depth++;
} while (!($bootstrap_file_found = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth < 10);
}
}
if (!isset($bootstrap_file_found) || !$bootstrap_file_found) {
$drupal_path = '../../../';
if (!file_exists($drupal_path . '/includes/bootstrap.inc')) {
$drupal_path = '../..';
do {
$drupal_path .= '/..';
$depth = substr_count($drupal_path, '..');
} while (!($bootstrap_file_found = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth < 10);
}
}
if (!isset($bootstrap_file_found) || $bootstrap_file_found) {
$fck_cwd = getcwd();
chdir($drupal_path);
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$authenticated = user_access('allow fckeditor file uploads');
if (isset($_SESSION['FCKeditor']['UserFilesPath'], $_SESSION['FCKeditor']['UserFilesAbsolutePath'])) {
$GLOBALS['fck_user_files_path'] = $_SESSION['FCKeditor']['UserFilesPath'];
$GLOBALS['fck_user_files_absolute_path'] = $_SESSION['FCKeditor']['UserFilesAbsolutePath'];
}
chdir($fck_cwd);
}
}
return $authenticated;
}
$Config['Enabled'] = CheckAuthentication();
if (!empty($fck_user_files_path)) {
$Config['UserFilesPath'] = $fck_user_files_path;
$Config['UserFilesAbsolutePath'] = $fck_user_files_absolute_path;
}
else {
$Config['UserFilesPath'] = strtr(base_path(), array(
'/modules/fckeditor/fckeditor/editor/filemanager/connectors/php' => '',
'/modules/fckeditor/fckeditor/editor/filemanager/browser/default/connectors/php' => '',
'/modules/fckeditor/fckeditor/editor/filemanager/upload/php' => '',
)) . file_directory_path() . '/';
}