diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 16:52:03 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-19 16:52:03 +0200 |
commit | 95741f3936501e3ad6aeb26f93eeb28f9decc273 (patch) | |
tree | 36991750b64e6a768c54651ca0c923e4f1e4eb25 /apps | |
parent | 04e6c12fe220171fc2e3c0f634915e7511cafa92 (diff) | |
parent | e5ee84ca9b7c2b95275fa7ea1100fe8c34a4d695 (diff) | |
download | nextcloud-server-95741f3936501e3ad6aeb26f93eeb28f9decc273.tar.gz nextcloud-server-95741f3936501e3ad6aeb26f93eeb28f9decc273.zip |
Merge pull request #8435 from owncloud/fix-8322-master
Expose permission via WebDAV
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/helper.php | 16 | ||||
-rw-r--r-- | apps/files/tests/ajax_rename.php | 12 |
2 files changed, 15 insertions, 13 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index 58d0886a636..7d8906e2251 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -37,18 +37,10 @@ class Helper public static function determineIcon($file) { if($file['type'] === 'dir') { $icon = \OC_Helper::mimetypeIcon('dir'); - $absPath = $file->getPath(); - $mount = \OC\Files\Filesystem::getMountManager()->find($absPath); - if (!is_null($mount)) { - $sid = $mount->getStorageId(); - if (!is_null($sid)) { - $sid = explode(':', $sid); - if ($sid[0] === 'shared') { - $icon = \OC_Helper::mimetypeIcon('dir-shared'); - } elseif ($sid[0] !== 'local' and $sid[0] !== 'home') { - $icon = \OC_Helper::mimetypeIcon('dir-external'); - } - } + if ($file->isShared()) { + $icon = \OC_Helper::mimetypeIcon('dir-shared'); + } elseif ($file->isMounted()) { + $icon = \OC_Helper::mimetypeIcon('dir-external'); } }else{ $icon = \OC_Helper::mimetypeIcon($file->getMimetype()); diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php index 74ca1e4495d..1b69e438061 100644 --- a/apps/files/tests/ajax_rename.php +++ b/apps/files/tests/ajax_rename.php @@ -24,6 +24,16 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { private static $user; + /** + * @var PHPUnit_Framework_MockObject_MockObject + */ + private $viewMock; + + /** + * @var \OCA\Files\App + */ + private $files; + function setUp() { // mock OC_L10n if (!self::$user) { @@ -72,7 +82,7 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase { ->method('getFileInfo') ->will($this->returnValue(new \OC\Files\FileInfo( '/', - null, + new \OC\Files\Storage\Local(array('datadir' => '/')), '/', array( 'fileid' => 123, |