[Pkg-owncloud-commits] [owncloud] 230/258: Added filesystem hooks for mount/unmount ext storage

David Prévot taffit at moszumanska.debian.org
Sat Oct 11 17:22:39 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 fe652258be5248aa2c9827a317ed30361f109594
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu Sep 25 20:17:52 2014 +0200

    Added filesystem hooks for mount/unmount ext storage
---
 apps/files_external/lib/config.php | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 14788c1..68a9e7e 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -491,6 +491,10 @@ class OC_Mount_Config {
 		}
 
 		$mountPoints = self::readData($isPersonal ? OCP\User::getUser() : NULL);
+		// who else loves multi-dimensional array ?
+		$isNew = !isset($mountPoints[$mountType]) ||
+			!isset($mountPoints[$mountType][$applicable]) ||
+			!isset($mountPoints[$mountType][$applicable][$mountPoint]);
 		$mountPoints = self::mergeMountPoints($mountPoints, $mount, $mountType);
 
 		// Set default priority if none set
@@ -506,7 +510,19 @@ class OC_Mount_Config {
 
 		self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints);
 
-		return self::getBackendStatus($class, $classOptions, $isPersonal);
+		$result = self::getBackendStatus($class, $classOptions, $isPersonal);
+		if ($result && $isNew) {
+			\OC_Hook::emit(
+				\OC\Files\Filesystem::CLASSNAME,
+				'add_mount_point',
+				array(
+					'path' => $mountPoint,
+					'type' => $mountType,
+					'applicable' => $applicable
+				)
+			);
+		}
+		return $result;
 	}
 
 	/**
@@ -539,6 +555,15 @@ class OC_Mount_Config {
 			}
 		}
 		self::writeData($isPersonal ? OCP\User::getUser() : NULL, $mountPoints);
+		\OC_Hook::emit(
+			\OC\Files\Filesystem::CLASSNAME,
+			'remove_mount_point',
+			array(
+				'path' => $mountPoint,
+				'type' => $mountType,
+				'applicable' => $applicable
+			)
+		);
 		return true;
 	}
 

-- 
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