From a900c7aa94ad6527cb3bdf2600b6b1e9e6b497ac Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Thu, 15 May 2014 12:13:46 +0200
Subject: [PATCH] Fix removing remote shares

---
 apps/files_sharing/lib/external/storage.php | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 2683a6a690..0e799a0e9e 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -88,4 +88,22 @@ class Storage extends \OC\Files\Storage\DAV implements ISharedStorage {
 			return false;
 		}
 	}
+
+	public function unlink($path) {
+		if ($path === '' || $path === false) {
+			$this->manager->removeShare($this->mountPoint);
+			return true;
+		} else {
+			return parent::unlink($path);
+		}
+	}
+
+	public function rmdir($path) {
+		if ($path === '' || $path === false) {
+			$this->manager->removeShare($this->mountPoint);
+			return true;
+		} else {
+			return parent::rmdir($path);
+		}
+	}
 }
-- 
GitLab