[Pkg-owncloud-commits] [owncloud] 110/153: Treat 'all users' as 'global'

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:43 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 9151d7250785eb244a8cfe8082877c231876c671
Author: Robin McCorkell <rmccorkell at karoshi.org.uk>
Date:   Fri Mar 28 15:22:35 2014 +0000

    Treat 'all users' as 'global'
    
    A mount applicable to all users is as good a definition of global as can be
---
 apps/files_external/lib/config.php | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index e23a72b..5e5340e 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -149,6 +149,26 @@ class OC_Mount_Config {
 				}
 			}
 		}
+		if (isset($mountConfig[self::MOUNT_TYPE_USER]) && isset($mountConfig[self::MOUNT_TYPE_USER]['all'])) {
+			$mounts = $mountConfig[self::MOUNT_TYPE_USER]['all'];
+			foreach ($mounts as $mountPoint => $options) {
+				$mountPoint = self::setUserVars($user, $mountPoint);
+				foreach ($options as &$option) {
+					$option = self::setUserVars($user, $option);
+				}
+				$options['options'] = self::decryptPasswords($options['options']);
+				if (!isset($options['priority'])) {
+					$options['priority'] = $backends[$options['class']]['priority'];
+				}
+
+				if ( (!isset($mountPoints[$mountPoint]))
+					|| ($options['priority'] >= $mountPoints[$mountPoint]['priority'])
+					|| ($mountPoints[$mountPoint]['priority_type'] != 'global') ) {
+					$options['priority_type'] = 'global';
+					$mountPoints[$mountPoint] = $options;
+				}
+			}
+		}
 		if (isset($mountConfig[self::MOUNT_TYPE_GROUP])) {
 			foreach ($mountConfig[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
 				if (\OC_Group::inGroup($user, $group)) {
@@ -174,7 +194,7 @@ class OC_Mount_Config {
 		}
 		if (isset($mountConfig[self::MOUNT_TYPE_USER])) {
 			foreach ($mountConfig[self::MOUNT_TYPE_USER] as $mountUser => $mounts) {
-				if ($mountUser === 'all' or strtolower($mountUser) === strtolower($user)) {
+				if (strtolower($mountUser) === strtolower($user)) {
 					foreach ($mounts as $mountPoint => $options) {
 						$mountPoint = self::setUserVars($user, $mountPoint);
 						foreach ($options as &$option) {

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