Skip to content

Commit

Permalink
fix working with symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
dio-el-claire committed Jul 5, 2011
1 parent ca79861 commit 1081afd
Show file tree
Hide file tree
Showing 127 changed files with 923 additions and 311 deletions.
File renamed without changes.
246 changes: 0 additions & 246 deletions maket.html

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
56 changes: 28 additions & 28 deletions connectors/php/connector.php → src/connectors/php/connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ function validName($name) {
array(
// 'id' => 'x5',
'driver' => 'LocalFileSystem',
'path' => '../../files/',
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../files/',
'path' => '../../../files/',
'URL' => dirname($_SERVER['PHP_SELF']) . '/../../../files/',
'alias' => 'File system',
'caseSensitive' => true,
'accessControl' => array($acl, 'fsAccess'),
Expand Down Expand Up @@ -235,32 +235,32 @@ function validName($name) {
// )
),
),
array(
'driver' => 'MySQL',
'path' => 1,
// 'treeDeep' => 2,
'user' => 'root',
'pass' => 'hane',
'db' => 'elfinder',
'user_id' => 1,
'accessControl' => 'access',
'separator' => ':',
// 'copyTo' => false,
// 'URL' => 'http://localhost/git/elfinder',
'tmbPath' => '../../files/.dbtmb/',
'tmbURL' => 'http://localhost/git/elfinder/files/.dbtmb/',
// 'attributes' => array(
// array(),
// array(
// 'pattern' => '/\.jpg$/',
// 'read' => false,
// 'write' => false,
// 'locked' => true,
// 'hidden' => true
// )
// )

)
// array(
// 'driver' => 'MySQL',
// 'path' => 1,
// // 'treeDeep' => 2,
// 'user' => 'root',
// 'pass' => 'hane',
// 'db' => 'elfinder',
// 'user_id' => 1,
// 'accessControl' => 'access',
// 'separator' => ':',
// // 'copyTo' => false,
// // 'URL' => 'http://localhost/git/elfinder',
// 'tmbPath' => '../../files/.dbtmb/',
// 'tmbURL' => 'http://localhost/git/elfinder/files/.dbtmb/',
// // 'attributes' => array(
// // array(),
// // array(
// // 'pattern' => '/\.jpg$/',
// // 'read' => false,
// // 'write' => false,
// // 'locked' => true,
// // 'hidden' => true
// // )
// // )
//
// )
)

);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -403,26 +403,27 @@ protected function open($args) {
$init = !empty($args['init']);
$tree = !empty($args['tree']);
$volume = $this->volume($target);
$cwd = $volume ? $volume->dir($target) : false;
// echo 'cwd<br>';
$cwd = $volume ? $volume->dir($target, false, true) : false;
$hash = $init ? 'default folder' : '#'.$target;

// on init request we can get invalid dir hash -
// dir which can not be opened now, but remembered by client,
// so open default dir
if (!$cwd || !$cwd['read']) {
if ($init) {
$volume = $this->default;
$target = $volume->defaultPath();
$cwd = $volume->dir($target);
}
if ((!$cwd || !$cwd['read']) && $init) {
$volume = $this->default;
$cwd = $volume->dir($volume->defaultPath(), false, true);
}

if (!$cwd) {
return array('error' => $this->error(self::ERROR_OPEN, $hash, self::ERROR_DIR_NOT_FOUND));
}
if (!$cwd['read']) {
return array('error' => $this->error(self::ERROR_OPEN, $hash, self::ERROR_PERM_DENIED));
}

$files = array();

// echo 'tree<br>';
// get folders trees
if ($args['tree']) {
foreach ($this->volumes as $id => $v) {
Expand All @@ -431,9 +432,9 @@ protected function open($args) {
}
}
}

// echo 'scandir<br>';
// get current working directory files list and add to $files if not exists in it
if (($ls = $volume->scandir($target, $args['mimes'])) === false) {
if (($ls = $volume->scandir($cwd['hash'], $args['mimes'])) === false) {
return array('error' => $this->error(self::ERROR_OPEN, $cwd['name'], $volume->error()));
}

Expand Down
File renamed without changes.
Loading

0 comments on commit 1081afd

Please sign in to comment.