Hello,
so i can set the fileRoot on PHP side with:
$fm->setFileRoot('data/test/')
this works just fine. I can uplod and navigate in trough my files and directorys.
There is a function in filemanager.class.php
private function getFullPath($path = '') {
if($path == '') {
$path = $this->get['path'];
}
error_log('GetPath: '.$path);
if($this->config['options']['fileRoot'] !== false) {
error_log('DOC_ROOT: '.$this->doc_root.' - PATH:'.$path);
$full_path = $this->doc_root . rawurldecode(str_replace ( $this->doc_root , '' , $path));
} else {
$full_path = $this->doc_root . rawurldecode($path);
}
$full_path = str_replace("//", "/", $full_path);
error_log(__LINE__.' :FULLPATH: '.$full_path);
return $full_path;
}
on navigation this gives me always the right paths back like:
error_log()
[Tue Jun 04 11:02:29 2013] [error]GetPath: /Penguins.jpg,
[Tue Jun 04 11:02:29 2013] [error]DOC_ROOT: /www/cms-tba
[Tue Jun 04 11:02:29 2013] [error]550 :FULLPATH: /www/cms-tba/data/test/Penguins.jpg,
but when i try to delete the file, or ranem or what ever:
i get this:
[Tue Jun 04 11:10:45 2013] [error] [client 192.168.2.188] GetPath: /data/test/Penguins.jpg,
[Tue Jun 04 11:10:45 2013] [error] DOC_ROOT: /www/cms-tba
[Tue Jun 04 11:10:45 2013] [error]550 :FULLPATH: /www/cms-tba/data/test/data/test/Penguins.jpg,
the full path at the end from where he is supposed to delete the file is wrong.
If i dont use the setFileRoot function and just set the fileRoot in the js config file everything is working.
Im realy clueless at this moment. I dont know ehere he gets the path:
GetPath: /data/test/Penguins.jpg,
when i want to delete.
public function setFileRoot($path) {
if($this->config['options']['serverRoot'] === true) {
$this->doc_root = $_SERVER['DOCUMENT_ROOT']. '/'. $path;
} else {
$this->doc_root = $path;
}
$this->dynamic_fileroot = str_replace($_SERVER['DOCUMENT_ROOT'], '', $this->doc_root);
$this->__log(__METHOD__ . ' $this->doc_root value overwritten : ' . $this->doc_root);
$this->__log(__METHOD__ . ' $this->dynamic_fileroot value ' . $this->dynamic_fileroot);
}