Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external shares are not accessible even if previews are authorised #218

Closed
oparoz opened this issue Jul 19, 2015 · 8 comments
Closed

external shares are not accessible even if previews are authorised #218

oparoz opened this issue Jul 19, 2015 · 8 comments
Assignees
Milestone

Comments

@oparoz
Copy link
Contributor

oparoz commented Jul 19, 2015

On 8.1, external shares have a new (hidden) parameter where you can enable/disable previews for a location.
It seems it doesn't work, at least for ownCloud and samba storage.
We get an access denied error.

@oparoz oparoz changed the title ownCloud via external shares is not accessible external shares are not accessible even if previews are authorised Jul 20, 2015
@oparoz
Copy link
Contributor Author

oparoz commented Jul 21, 2015

I have a quick fix for that and it will be made available as soon as Gallery replaces Pictures as the official app.

@Spekkie
Copy link

Spekkie commented Jul 21, 2015

Do you have any idea when this is going to happen? The only thing I can find is that they will incorporate it in 8.2, yet that release is scheduled for september...
Unfortunately due to this issue galleryplus is useless to me since all my pictures are on an external storage...

@oparoz
Copy link
Contributor Author

oparoz commented Jul 21, 2015

Well, I expect the switch to happen within days/weeks and after that things will return to normal when it comes to commits.

In the meantime, you can try this patch

Index: service/filesservice.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- service/filesservice.php    (date 1436615309000)
+++ service/filesservice.php    (date 1437476943000)
@@ -118,17 +118,13 @@
     */
    protected function isAllowedAndAvailable($node) {
        try {
-           if (!$node->isMounted()) {
                return $this->isAllowed($node) && $this->isAvailable($node);
-           }
        } catch (\Exception $exception) {
            $message = 'The folder is not available: ' . $exception->getMessage();
            $this->logger->error($message);

            return false;
        }
-
-       return false;
    }

    /**
@@ -278,9 +274,13 @@
        if ($this->isExternalShare($node)) {
            $allowed = $this->isExternalShareAllowed();
        }
+
+       if ($node->isMounted()) {
-       $mount = $node->getMountPoint();
+           $mount = $node->getMountPoint();
+           $allowed = $mount && $mount->getOption('previews', true);
+       }

-       return $allowed && $mount && $mount->getOption('previews', true);
+       return $allowed;
    }

    /**

cc @j-ed which was also affected

IMPORTANT: THIS IS FOR 8.1

@Spekkie
Copy link

Spekkie commented Jul 21, 2015

Many thanks!
This indeed fixes my problem 👍

@j-ed
Copy link

j-ed commented Jul 22, 2015

@oparoz I've copied over the service/filesservice.phpfile from the v8.1 package and applied the patch. The error message is currently not shown but a spinning wheel is constantly shown. It seems that the app tries to create previews for all kind pictures now which lasts forever. I've not yet seen an image on the screen. As soon as I access the app the following messages are logged:

...,"app":"core","message":"DB execute with arguments : array (   0 => '13',   1 => 'd41d8cd98f00b204e9800998ecf8427e', )","level":0,"time":"2015-07-22 18:09:46+02:00","method":"GET","url":"\/owncloud\/index.php\/apps\/galleryplus\/files?location=&mediatypes=image%2Fpng%3Bimage%2Fjpeg%3Bimage%2Fgif%3Bimage%2Fx-xbitmap%3Bimage%2Fbmp%3Bimage%2Fx-dcraw&features=&etag"}
...,"app":"core","message":"DB prepare : SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`,\n\t\t\t\t\t   `storage_mtime`, `encrypted`, `unencrypted_size`, `etag`, `permissions`\n\t\t\t\tFROM `oc_filecache` WHERE `storage` = ? AND `path_hash` = ?","level":0,"time":"2015-07-22 18:09:46+02:00","method":"GET","url":"\/owncloud\/index.php\/apps\/galleryplus\/files?location=&mediatypes=image%2Fpng%3Bimage%2Fjpeg%3Bimage%2Fgif%3Bimage%2Fx-xbitmap%3Bimage%2Fbmp%3Bimage%2Fx-dcraw&features=&etag"}

@oparoz
Copy link
Contributor Author

oparoz commented Jul 22, 2015

@j-ed If I remember correctly, you're still on 8.0 and that version does not offer a configuration switch for external storage, letting the app known if previews are allowed.

What you could try to do is to use the original file which came with Gallery for 8.0 and only apply the first patch.

@oparoz
Copy link
Contributor Author

oparoz commented Jul 22, 2015

Also, it takes forever to get thumbnails of other ownCloud instances on 8.0, so I expect the same with mounted WebDAV storage.
You should be able to see thumbnails slowly making their way to the browser using the browser console.

@oparoz oparoz self-assigned this Jul 25, 2015
@oparoz oparoz added this to the 14 (2015-07-31) milestone Jul 25, 2015
@oparoz
Copy link
Contributor Author

oparoz commented Jul 25, 2015

Fixed via cc8a216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants