[Pkg-owncloud-commits] [owncloud] 170/273: Remove external shares if the share is invalid
David Prévot
taffit at moszumanska.debian.org
Fri Jul 4 03:13:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 8061a4ccc09bbd6ba675521d1f9e2ced396c862f
Author: Robin Appelman <icewind at owncloud.com>
Date: Tue Jul 1 14:58:07 2014 +0200
Remove external shares if the share is invalid
---
apps/files_sharing/lib/external/manager.php | 2 ++
apps/files_sharing/lib/external/storage.php | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php
index 4441a72..e4e4d60 100644
--- a/apps/files_sharing/lib/external/manager.php
+++ b/apps/files_sharing/lib/external/manager.php
@@ -108,7 +108,9 @@ class Manager {
* @return Mount
*/
protected function mountShare($data) {
+ $data['manager'] = $this;
$mountPoint = '/' . $this->userSession->getUser()->getUID() . '/files' . $data['mountpoint'];
+ $data['mountpoint'] = $mountPoint;
$mount = new Mount(self::STORAGE, $mountPoint, $data, $this, $this->storageLoader);
$this->mountManager->addMount($mount);
return $mount;
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index be3f367..cbde21d 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -39,7 +39,13 @@ class Storage extends DAV implements ISharedStorage {
private $updateChecked = false;
+ /**
+ * @var \OCA\Files_Sharing\External\Manager
+ */
+ private $manager;
+
public function __construct($options) {
+ $this->manager = $options['manager'];
$this->remote = $options['remote'];
$this->remoteUser = $options['owner'];
list($protocol, $remote) = explode('://', $this->remote);
@@ -134,7 +140,8 @@ class Storage extends DAV implements ISharedStorage {
if ($this->testRemote()) {
// valid ownCloud instance means that the public share no longer exists
// since this is permanent (re-sharing the file will create a new token)
- // we mark the storage as invalid
+ // we remove the invalid storage
+ $this->manager->removeShare($this->mountPoint);
throw new StorageInvalidException();
} else {
// ownCloud instance is gone, likely to be a temporary server configuration error
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list