some more porting of the sharing

This commit is contained in:
Robin Appelman 2012-10-27 14:25:15 +02:00
parent 86be7e8872
commit 0fb707d2c9
2 changed files with 7 additions and 5 deletions

View file

@ -9,11 +9,12 @@ if (version_compare($installedVersion, '0.3', '<')) {
OC_User::useBackend(new OC_User_Database()); OC_User::useBackend(new OC_User_Database());
OC_Group::useBackend(new OC_Group_Database()); OC_Group::useBackend(new OC_Group_Database());
OC_App::loadApps(array('authentication')); OC_App::loadApps(array('authentication'));
$rootView = new \OC\Files\View('');
while ($row = $result->fetchRow()) { while ($row = $result->fetchRow()) {
$meta = \OC\Files\Filesystem::getId($path, ''); $meta = $rootView->getFileInfo($$row['source']);
$itemSource = OC_FileCache::getId($row['source'], ''); $itemSource = $meta['fileid'];
if ($itemSource != -1) { if ($itemSource != -1) {
$file = OC_FileCache::get($row['source'], ''); $file = $meta;
if ($file['mimetype'] == 'httpd/unix-directory') { if ($file['mimetype'] == 'httpd/unix-directory') {
$itemType = 'folder'; $itemType = 'folder';
} else { } else {
@ -69,6 +70,6 @@ if (version_compare($installedVersion, '0.3.3', '<')) {
OC_App::loadApps(array('authentication')); OC_App::loadApps(array('authentication'));
$users = OC_User::getUsers(); $users = OC_User::getUsers();
foreach ($users as $user) { foreach ($users as $user) {
OC_FileCache::delete('Shared', '/'.$user.'/files/'); // OC_FileCache::delete('Shared', '/'.$user.'/files/');
} }
} }

View file

@ -10,7 +10,8 @@ if (isset($_GET['token'])) {
$qry = \OC_DB::prepare('SELECT `source` FROM `*PREFIX*sharing` WHERE `target` = ? LIMIT 1'); $qry = \OC_DB::prepare('SELECT `source` FROM `*PREFIX*sharing` WHERE `target` = ? LIMIT 1');
$filepath = $qry->execute(array($_GET['token']))->fetchOne(); $filepath = $qry->execute(array($_GET['token']))->fetchOne();
if(isset($filepath)) { if(isset($filepath)) {
$info = OC_FileCache_Cached::get($filepath, ''); $rootView = new \OC\Files\View('');
$info = $rootView->getFileInfo($filepath, '');
if(strtolower($info['mimetype']) == 'httpd/unix-directory') { if(strtolower($info['mimetype']) == 'httpd/unix-directory') {
$_GET['dir'] = $filepath; $_GET['dir'] = $filepath;
} else { } else {