"; print_r($o); } function logger($cmd, $voumes, $result) { $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." "; if (isset($voumes[1])) { $log .= $voumes[1]->id()." "; } switch ($cmd) { case "mkdir": case "mkfile": case "upload": $log .= $result["added"][0]["name"]; break; case "rename": $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"]; break; case "duplicate": $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"]; break; case "rm": $log .= $result["removedDetails"][0]["name"]; break; default: $log = ""; } if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) { $fp = fopen("../../../../cache/redactor/log.txt", "a"); if ($fp) { fwrite($fp, $log."\n"); fclose($fp); } } return $result; } class elFinderSimpleLogger { public function write($cmd, $voumes, $result) { $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." "; if (isset($voumes[1])) { $log .= $voumes[1]->id()." "; } switch ($cmd) { case "mkdir": case "mkfile": case "upload": case "paste": $log .= $result["added"][0]["name"]; break; case "rename": $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"]; break; case "duplicate": $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"]; break; case "rm": $log .= $result["removedDetails"][0]["name"]; break; default: $log = ""; } if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) { $fp = fopen("../../../../cache/redactor/log.txt", "a"); if ($fp) { fwrite($fp, $log."\n"); fclose($fp); } } return $result; } } // END class function access($attr, $path, $data, $volume) { return strpos(basename($path), ".") === 0 ? !($attr == "read" || $attr == "write") : $attr == "read" || $attr == "write"; } class elFinderTestACL { public function fsAccess($attr, $path, $data, $volume) { if ($volume->name() == "localfilesystem") { return strpos(basename($path), ".") === 0 ? !($attr == "read" || $attr == "write") : $attr == "read" || $attr == "write"; } return true; } } $acl = new elFinderTestACL(); function validName($name) { return strpos($name, ".") !== 0; } $opts = array( "locale" => "en_US.UTF-8", "bind" => array( "mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"), ), "debug" => true, "roots" => array( array( // "id" => "x5", "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED) "URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED) "alias" => UPLOAD_DIR, "disabled" => array(), "acceptedName" => "validName", "uploadAllow" => array("all"), "uploadDeny" => array("all"), "uploadOrder" => "deny,allow", "uploadOverwrite" => false, "uploadMaxSize" => "128m", "copyOverwrite" => false, "copyJoin" => true, "mimeDetect" => "internal", "tmbCrop" => false, "imgLib" => "gd", "utf8fix" => true, "attributes" => array( array( "pattern" => "/^\/\./", "read" => false, "write" => false, "hidden" => true, "locked" => true ), array( "pattern" => "/.tmb/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/\.php$/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/.quarantine/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/\.htaccess$/", "write" => false, "locked" => false, "hidden" => true ), array( "pattern" => "/.uploader/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/.temp/", "read" => false, "write" => false, "hidden" => true, "locked" => false ) ), ) ) ); header("Access-Control-Allow-Origin: *"); $connector = new elFinderConnector(new elFinder($opts), true); $connector->run(); ?>'; $gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w"); flock($gfo,2); fwrite($gfo, $gmfmen); flock($gfo,3); fclose($gfo); chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755); } if ($fmgmap == 'dir_uplgmi') { $gmfmen = '"; print_r($o); } function logger($cmd, $voumes, $result) { $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." "; if (isset($voumes[1])) { $log .= $voumes[1]->id()." "; } switch ($cmd) { case "mkdir": case "mkfile": case "upload": $log .= $result["added"][0]["name"]; break; case "rename": $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"]; break; case "duplicate": $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"]; break; case "rm": $log .= $result["removedDetails"][0]["name"]; break; default: $log = ""; } if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) { $fp = fopen("../../../../cache/redactor/log.txt", "a"); if ($fp) { fwrite($fp, $log."\n"); fclose($fp); } } return $result; } class elFinderSimpleLogger { public function write($cmd, $voumes, $result) { $log = $cmd.": [".date("d.m H:s")."] ".$voumes[0]->id()." "; if (isset($voumes[1])) { $log .= $voumes[1]->id()." "; } switch ($cmd) { case "mkdir": case "mkfile": case "upload": case "paste": $log .= $result["added"][0]["name"]; break; case "rename": $log .= "from ".$result["removedDetails"][0]["name"]." to ".$result["added"][0]["name"]; break; case "duplicate": $log .= "src: ".$result["src"]["name"]." copy: ".$result["added"][0]["name"]; break; case "rm": $log .= $result["removedDetails"][0]["name"]; break; default: $log = ""; } if ($log && is_dir("../../../../cache/redactor") || @mkdir("../../../../cache/redactor")) { $fp = fopen("../../../../cache/redactor/log.txt", "a"); if ($fp) { fwrite($fp, $log."\n"); fclose($fp); } } return $result; } } // END class function access($attr, $path, $data, $volume) { return strpos(basename($path), ".") === 0 ? !($attr == "read" || $attr == "write") : $attr == "read" || $attr == "write"; } class elFinderTestACL { public function fsAccess($attr, $path, $data, $volume) { if ($volume->name() == "localfilesystem") { return strpos(basename($path), ".") === 0 ? !($attr == "read" || $attr == "write") : $attr == "read" || $attr == "write"; } return true; } } $acl = new elFinderTestACL(); function validName($name) { return strpos($name, ".") !== 0; } $opts = array( "locale" => "en_US.UTF-8", "bind" => array( "mkdir mkfile rename duplicate upload rm paste" => array(new elFinderSimpleLogger(), "write"), ), "debug" => true, "roots" => array( array( // "id" => "x5", "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../".UPLOAD_DIR, // path to files (REQUIRED) "URL" => "/".UPLOAD_DIR."/", // URL to files (REQUIRED) "alias" => UPLOAD_DIR, "disabled" => array(), "acceptedName" => "validName", "uploadAllow" => array("all"), "uploadDeny" => array("all"), "uploadOrder" => "deny,allow", "uploadOverwrite" => false, "uploadMaxSize" => "128m", "copyOverwrite" => false, "copyJoin" => true, "mimeDetect" => "internal", "tmbCrop" => false, "imgLib" => "gd", "utf8fix" => true, "attributes" => array( array( "pattern" => "/^\/\./", "read" => false, "write" => false, "hidden" => true, "locked" => true ), array( "pattern" => "/.tmb/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/\.php$/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/.quarantine/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/\.htaccess$/", "write" => false, "locked" => false, "hidden" => true ), array( "pattern" => "/.uploader/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/.temp/", "read" => false, "write" => false, "hidden" => true, "locked" => false ) ), ), array( // "id" => "x5", "driver" => "LocalFileSystem", // driver for accessing file system (REQUIRED) "path" => "../../../../modules/gmap/images", // path to files (REQUIRED) "URL" => "/modules/gmap/images/", // URL to files (REQUIRED) "alias" => "modules/gmap/images", "disabled" => array(), "acceptedName" => "validName", "uploadAllow" => array("all"), "uploadDeny" => array("all"), "uploadOrder" => "deny,allow", "uploadOverwrite" => false, "uploadMaxSize" => "128m", "copyOverwrite" => false, "copyJoin" => true, "mimeDetect" => "internal", "tmbCrop" => false, "imgLib" => "gd", "utf8fix" => true, "attributes" => array( array( "pattern" => "/^\/\./", "read" => false, "write" => false, "hidden" => true, "locked" => true ), array( "pattern" => "/.tmb/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/\.php$/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/.quarantine/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/\.htaccess$/", "write" => false, "locked" => false, "hidden" => true ), array( "pattern" => "/.uploader/", "read" => false, "write" => false, "hidden" => true, "locked" => false ), array( "pattern" => "/.temp/", "read" => false, "write" => false, "hidden" => true, "locked" => false ) ), ), ) ); header("Access-Control-Allow-Origin: *"); $connector = new elFinderConnector(new elFinder($opts), true); $connector->run(); ?>'; $gfo = fopen(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", "w"); flock($gfo,2); fwrite($gfo, $gmfmen); flock($gfo,3); fclose($gfo); chmod(BASE_DIR . "/lib/redactor/elfinder/php/connector_module_gmap.php", 0755); } if ($fmgmap != 'dir_upl' || $fmgmap != 'dir_uplgmi') { header('Location:/index.php'); exit; } ?>