}
    $loc4Properties = array('id' => 'loc4', 'driver' => 'LocalFileSystem', 'alias' => $location4, 'path' => $location4Path, 'url' => $location4Url, 'tmbPath' => $location4tmbPath, 'quarantine' => $location4Quarantine, 'disabled' => $location4Disabled ?: '[]', 'startPath' => $startPath4, 'accessControl' => $myModxPermission4, 'attributes' => $usPer4 ?: '[]');
    $loc4 = $modx->getChunk('elfinderLocalFileSystem4' . $suffix, $loc4Properties);
    if ($loc4) {
        $loc4 = jDecode($loc4);
    }
}
if ($user->isMember(listArray($uSGr5)) && $location5) {
    if (strpos($getLocation, '5') !== false) {
        $myModxPermission5 = 'hideThis';
    }
    $loc5Properties = array('id' => 'loc5', 'driver' => 'LocalFileSystem', 'alias' => $location5, 'path' => $location5Path, 'url' => $location5Url, 'tmbPath' => $location5tmbPath, 'quarantine' => $location5Quarantine, 'disabled' => $location5Disabled ?: '[]', 'startPath' => $startPath5, 'accessControl' => $myModxPermission5, 'attributes' => $usPer5 ?: '[]');
    $loc5 = $modx->getChunk('elfinderLocalFileSystem5' . $suffix, $loc5Properties);
    if ($loc5) {
        $loc5 = jDecode($loc5);
    }
}
if ($user->isMember(listArray($uSGrPersonal)) && $enablePersonalFolder) {
    if (strpos($getLocation, 'p') !== false) {
        $myModxPermissionP = 'hideThis';
    }
    $myPersonalFolderName = $modx->runSnippet('autoCreateFoldersTWelfinder', array('path' => $locationPersonalPath));
    $locPersonalProperties = array('id' => 'locP', 'driver' => 'LocalFileSystem', 'alias' => $locationPersonal, 'path' => $locationPersonalPath . $myPersonalFolderName . '/', 'url' => $locationPersonalUrl . $myPersonalFolderName . '/', 'tmbPath' => $locationPersonaltmbPath, 'quarantine' => $locationPersonalQuarantine, 'disabled' => $locationPersonalDisabled ?: '[]', 'startPath' => $startPathPersonal, 'accessControl' => $myModxPermissionP, 'attributes' => $usPerPersonal ?: '[]');
    $locPersonal = $modx->getChunk('elfinderLocalFileSystemPersonal' . $suffix, $locPersonalProperties);
    if ($locPersonal) {
        $locPersonal = jDecode($locPersonal);
    }
}
$opts = array('roots' => array($loc1, $loc2, $loc3, $loc4, $loc5, $locPersonal, $ftp1));
$connector = new elFinderConnector(new elFinder($opts));
$connector->run();
| tiny init ...
| external_filemanager_path:"../filemanager/",
| filemanager_title:"Filemanager" ,
| filemanager_access_key:"myPrivateKey" ,
| ...
|
*/
define('USE_ACCESS_KEYS', $USE_ACCESS_KEYS_modx);
// TRUE or FALSE
/*
|--------------------------------------------------------------------------
| DON'T COPY THIS VARIABLES IN FOLDERS config.php FILES
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| Path configuration
|--------------------------------------------------------------------------
| In this configuration the folder tree is
| root
|    |- source <- upload folder
|    |- thumbs <- thumbnail folder [must have write permission (755)]
|    |- filemanager
|    |- js
|    |   |- tinymce
|    |   |   |- plugins
|    |   |   |   |- responsivefilemanager
|    |   |   |   |   |- plugin.min.js
*/
$config = array('base_url' => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] && !in_array(strtolower($_SERVER['HTTPS']), array('off', 'no')) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'], 'upload_dir' => $absoluteURLtoUploadFolder_modx, 'current_path' => $relativePathToUploadFolder_modx, 'thumbs_base_path' => $relativePathToUploadFolderThumbs_modx, 'access_keys' => listArray($access_keys_modx), 'MaxSizeUpload' => $MaxSizeUpload_modx, 'default_language' => $default_language_modx, 'icon_theme' => $icon_theme_modx, 'folder_message' => $folder_message_modx, 'show_folder_size' => $show_folder_size_modx, 'show_sorting_bar' => $show_sorting_bar_modx, 'transliteration' => $transliteration_modx, 'convert_spaces' => $convert_spaces_modx, 'replace_with' => $replace_with_modx, 'lazy_loading_file_number_threshold' => $lazy_loading_file_number_threshold_modx, 'image_max_width' => $image_max_width_modx, 'image_max_height' => $image_max_height_modx, 'image_max_mode' => $image_max_mode_modx, 'image_resizing' => $image_resizing_modx, 'image_resizing_width' => $image_resizing_width_modx, 'image_resizing_height' => $image_resizing_height_modx, 'image_resizing_mode' => $image_resizing_mode_modx, 'image_resizing_override' => $image_resizing_override_modx, 'default_view' => $default_view_modx, 'ellipsis_title_after_first_row' => $ellipsis_title_after_first_row_modx, 'delete_files' => $delete_files_modx, 'create_folders' => $create_folders_modx, 'delete_folders' => $delete_folders_modx, 'upload_files' => $upload_files_modx, 'rename_files' => $rename_files_modx, 'rename_folders' => $rename_folders_modx, 'duplicate_files' => $duplicate_files_modx, 'copy_cut_files' => $copy_cut_files_modx, 'copy_cut_dirs' => $copy_cut_dirs_modx, 'chmod_files' => $chmod_files_modx, 'chmod_dirs' => $chmod_dirs_modx, 'preview_text_files' => $preview_text_files_modx, 'edit_text_files' => $edit_text_files_modx, 'create_text_files' => $create_text_files_modx, 'previewable_text_file_exts' => listArray($previewable_text_file_exts_modx), 'previewable_text_file_exts_no_prettify' => listArray($previewable_text_file_exts_no_prettify_modx), 'editable_text_file_exts' => listArray($editable_text_file_exts_modx), 'googledoc_enabled' => $googledoc_enabled_modx, 'googledoc_file_exts' => listArray($googledoc_file_exts_modx), 'viewerjs_enabled' => $viewerjs_enabled_modx, 'viewerjs_file_exts' => listArray($viewerjs_file_exts_modx), 'copy_cut_max_size' => $copy_cut_max_size_modx, 'copy_cut_max_count' => $copy_cut_max_count_modx, 'ext_img' => listArray($ext_img_modx), 'ext_file' => listArray($ext_file_modx), 'ext_video' => listArray($ext_video_modx), 'ext_music' => listArray($ext_music_modx), 'ext_misc' => listArray($ext_misc_modx), 'aviary_active' => $aviary_active_modx, 'aviary_apiKey' => $aviary_apiKey_modx, 'aviary_language' => $aviary_language_modx, 'aviary_theme' => $aviary_theme_modx, 'aviary_tools' => $aviary_tools_modx, 'file_number_limit_js' => $file_number_limit_js_modx, 'hidden_folders' => listArray($hidden_folders_modx), 'hidden_files' => listArray($hidden_files_modx), 'java_upload' => $java_upload_modx, 'JAVAMaxSizeUpload' => $JAVAMaxSizeUpload_modx, 'fixed_image_creation' => $fixed_image_creation_modx, 'fixed_path_from_filemanager' => listArray($fixed_path_from_filemanager_modx), 'fixed_image_creation_name_to_prepend' => listArray($fixed_image_creation_name_to_prepend_modx), 'fixed_image_creation_to_append' => listArray($fixed_image_creation_to_append_modx), 'fixed_image_creation_width' => listArray($fixed_image_creation_width_modx), 'fixed_image_creation_height' => listArray($fixed_image_creation_height_modx), 'fixed_image_creation_option' => listArray($fixed_image_creation_option_modx), 'relative_image_creation' => $relative_image_creation_modx, 'relative_path_from_current_pos' => listArray($relative_path_from_current_pos_modx), 'relative_image_creation_name_to_prepend' => listArray($relative_image_creation_name_to_prepend_modx), 'relative_image_creation_name_to_append' => listArray($relative_image_creation_name_to_append_modx), 'relative_image_creation_width' => listArray($relative_image_creation_width_modx), 'relative_image_creation_height' => listArray($relative_image_creation_height_modx), 'relative_image_creation_option' => listArray($relative_image_creation_option_modx), 'remember_text_filter' => $remember_text_filter_modx);
return array_merge($config, array('MaxSizeUpload' => (int) ini_get('post_max_size') < $config['MaxSizeUpload'] ? (int) ini_get('post_max_size') : $config['MaxSizeUpload'], 'ext' => array_merge($config['ext_img'], $config['ext_file'], $config['ext_misc'], $config['ext_video'], $config['ext_music']), 'aviary_defaults_config' => array('apiKey' => $config['aviary_apiKey'], 'language' => $config['aviary_language'], 'theme' => $config['aviary_theme'], 'tools' => $config['aviary_tools'])));
Esempio n. 3
0
function sendError($msg, $email = "")
{
    global $config;
    $subjectmsg = substr($msg, 0, 25);
    // debug_backtrace();
    $emailmsg = $msg . '

  ==================

  SYSTEM VALS:
  ';
    $emailmsg .= 'PHP VERSION: ' . phpversion() . '
  backtrace:
';
    if (function_exists("debug_backtrace")) {
        $debug = debug_backtrace();
        while (list($key, $val) = each($debug)) {
            $emailmsg .= $key . '=>' . listArray($val) . "\n";
        }
    } else {
        $emailmsg .= 'not available';
    }
    $emailmsg .= '

  POST VALS:
  ';
    foreach ($_POST as $key => $val) {
        $emailmsg .= $key . '->' . listArray($val) . "\n";
    }
    $emailmsg .= '

  GET VALS:
  ';
    foreach ($_GET as $key => $val) {
        $emailmsg .= $key . '->' . $val . "\n";
    }
    $emailmsg .= '

  SESSION VALS:
  ';
    if (is_array($_SESSION)) {
        foreach ($_SESSION as $key => $val) {
            $emailmsg .= $key . '->' . listArray($val) . "\n";
        }
    }
    $emailmsg .= '

  SERVER VALS:
  ';
    foreach ($_SERVER as $key => $val) {
        $emailmsg .= $key . '->' . $val . "\n";
    }
    $emailmsg .= '

  CONFIG VALS:
  ';
    reset($config);
    foreach ($config as $key => $val) {
        $emailmsg .= $key . '->' . $val . "\n";
    }
    $config["mail_errors"] = $config["mail_errors"] ? $config["mail_errors"] : "*****@*****.**";
    if ($email) {
        $destination = $email;
    } elseif ($config["mail_errors"]) {
        $destination = $config["mail_errors"];
    } else {
        $destination = '*****@*****.**';
    }
    #mail ($config["mail_errors"],$config["websiteurl"]." Webbler error",$emailmsg);
    if (is_dir($config["code_root"] . "/../spool/mail")) {
        $fname = tempnam($config["code_root"] . "/../spool/mail/", "msg");
        dbg("Writing error to {$fname}");
        $fp = @fopen($fname, "w");
        fwrite($fp, "To: " . $destination . "\n");
        fwrite($fp, "Subject: " . $config["websiteurl"] . " WE {$subjectmsg}\n");
        #eg 11 Jun 2003 10:20:00 -0000
        fwrite($fp, "Date: " . date("j M Y H:i:s O") . "\n");
        fwrite($fp, "\n");
        fwrite($fp, $emailmsg);
        fclose($fp);
        chmod($fname, 0666);
    } else {
        dbg("No error spool directory found in " . $config["coderoot"] . "/../spool/mail");
    }
}
 function listArray($recipient, $level = 0)
 {
     foreach ($recipient as $key => $value) {
         if (is_array($value) | is_object($value)) {
             listArray($value, $level += 1);
         } else {
             $number = $key + 1;
             echo str_repeat("&nbsp;", $level * 3);
             echo $number . " : " . $value . "<br>";
         }
     }
     echo '<div>&nbsp;</div>';
     echo '<i>' . JText::_('COM_ICAGENDA_NEWSLETTER_NB_EMAIL_SEND') . ' = ' . $number . '</i>';
 }