Completed
Push — stable10 ( d1b390...0bd063 )
by Lukas
27:03 queued 26:40
created
apps/dav/lib/Connector/Sabre/LockPlugin.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -34,53 +34,53 @@
 block discarded – undo
34 34
 use Sabre\HTTP\RequestInterface;
35 35
 
36 36
 class LockPlugin extends ServerPlugin {
37
-	/**
38
-	 * Reference to main server object
39
-	 *
40
-	 * @var \Sabre\DAV\Server
41
-	 */
42
-	private $server;
37
+    /**
38
+     * Reference to main server object
39
+     *
40
+     * @var \Sabre\DAV\Server
41
+     */
42
+    private $server;
43 43
 
44
-	/**
45
-	 * {@inheritdoc}
46
-	 */
47
-	public function initialize(\Sabre\DAV\Server $server) {
48
-		$this->server = $server;
49
-		$this->server->on('beforeMethod', [$this, 'getLock'], 50);
50
-		$this->server->on('afterMethod', [$this, 'releaseLock'], 50);
51
-	}
44
+    /**
45
+     * {@inheritdoc}
46
+     */
47
+    public function initialize(\Sabre\DAV\Server $server) {
48
+        $this->server = $server;
49
+        $this->server->on('beforeMethod', [$this, 'getLock'], 50);
50
+        $this->server->on('afterMethod', [$this, 'releaseLock'], 50);
51
+    }
52 52
 
53
-	public function getLock(RequestInterface $request) {
54
-		// we can't listen on 'beforeMethod:PUT' due to order of operations with setting up the tree
55
-		// so instead we limit ourselves to the PUT method manually
56
-		if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
57
-			return;
58
-		}
59
-		try {
60
-			$node = $this->server->tree->getNodeForPath($request->getPath());
61
-		} catch (NotFound $e) {
62
-			return;
63
-		}
64
-		if ($node instanceof Node) {
65
-			try {
66
-				$node->acquireLock(ILockingProvider::LOCK_SHARED);
67
-			} catch (LockedException $e) {
68
-				throw new FileLocked($e->getMessage(), $e->getCode(), $e);
69
-			}
70
-		}
71
-	}
53
+    public function getLock(RequestInterface $request) {
54
+        // we can't listen on 'beforeMethod:PUT' due to order of operations with setting up the tree
55
+        // so instead we limit ourselves to the PUT method manually
56
+        if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
57
+            return;
58
+        }
59
+        try {
60
+            $node = $this->server->tree->getNodeForPath($request->getPath());
61
+        } catch (NotFound $e) {
62
+            return;
63
+        }
64
+        if ($node instanceof Node) {
65
+            try {
66
+                $node->acquireLock(ILockingProvider::LOCK_SHARED);
67
+            } catch (LockedException $e) {
68
+                throw new FileLocked($e->getMessage(), $e->getCode(), $e);
69
+            }
70
+        }
71
+    }
72 72
 
73
-	public function releaseLock(RequestInterface $request) {
74
-		if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
75
-			return;
76
-		}
77
-		try {
78
-			$node = $this->server->tree->getNodeForPath($request->getPath());
79
-		} catch (NotFound $e) {
80
-			return;
81
-		}
82
-		if ($node instanceof Node) {
83
-			$node->releaseLock(ILockingProvider::LOCK_SHARED);
84
-		}
85
-	}
73
+    public function releaseLock(RequestInterface $request) {
74
+        if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) {
75
+            return;
76
+        }
77
+        try {
78
+            $node = $this->server->tree->getNodeForPath($request->getPath());
79
+        } catch (NotFound $e) {
80
+            return;
81
+        }
82
+        if ($node instanceof Node) {
83
+            $node->releaseLock(ILockingProvider::LOCK_SHARED);
84
+        }
85
+    }
86 86
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Principal.php 1 patch
Indentation   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -40,196 +40,196 @@
 block discarded – undo
40 40
 
41 41
 class Principal implements BackendInterface {
42 42
 
43
-	/** @var IUserManager */
44
-	private $userManager;
45
-
46
-	/** @var IGroupManager */
47
-	private $groupManager;
48
-
49
-	/** @var string */
50
-	private $principalPrefix;
51
-
52
-	/** @var bool */
53
-	private $hasGroups;
54
-
55
-	/**
56
-	 * @param IUserManager $userManager
57
-	 * @param IGroupManager $groupManager
58
-	 * @param string $principalPrefix
59
-	 */
60
-	public function __construct(IUserManager $userManager,
61
-								IGroupManager $groupManager,
62
-								$principalPrefix = 'principals/users/') {
63
-		$this->userManager = $userManager;
64
-		$this->groupManager = $groupManager;
65
-		$this->principalPrefix = trim($principalPrefix, '/');
66
-		$this->hasGroups = ($principalPrefix === 'principals/users/');
67
-	}
68
-
69
-	/**
70
-	 * Returns a list of principals based on a prefix.
71
-	 *
72
-	 * This prefix will often contain something like 'principals'. You are only
73
-	 * expected to return principals that are in this base path.
74
-	 *
75
-	 * You are expected to return at least a 'uri' for every user, you can
76
-	 * return any additional properties if you wish so. Common properties are:
77
-	 *   {DAV:}displayname
78
-	 *
79
-	 * @param string $prefixPath
80
-	 * @return string[]
81
-	 */
82
-	public function getPrincipalsByPrefix($prefixPath) {
83
-		$principals = [];
84
-
85
-		if ($prefixPath === $this->principalPrefix) {
86
-			foreach($this->userManager->search('') as $user) {
87
-				$principals[] = $this->userToPrincipal($user);
88
-			}
89
-		}
90
-
91
-		return $principals;
92
-	}
93
-
94
-	/**
95
-	 * Returns a specific principal, specified by it's path.
96
-	 * The returned structure should be the exact same as from
97
-	 * getPrincipalsByPrefix.
98
-	 *
99
-	 * @param string $path
100
-	 * @return array
101
-	 */
102
-	public function getPrincipalByPath($path) {
103
-		list($prefix, $name) = URLUtil::splitPath($path);
104
-
105
-		if ($prefix === $this->principalPrefix) {
106
-			$user = $this->userManager->get($name);
107
-
108
-			if (!is_null($user)) {
109
-				return $this->userToPrincipal($user);
110
-			}
111
-		}
112
-		return null;
113
-	}
114
-
115
-	/**
116
-	 * Returns the list of members for a group-principal
117
-	 *
118
-	 * @param string $principal
119
-	 * @return string[]
120
-	 * @throws Exception
121
-	 */
122
-	public function getGroupMemberSet($principal) {
123
-		// TODO: for now the group principal has only one member, the user itself
124
-		$principal = $this->getPrincipalByPath($principal);
125
-		if (!$principal) {
126
-			throw new Exception('Principal not found');
127
-		}
128
-
129
-		return [$principal['uri']];
130
-	}
131
-
132
-	/**
133
-	 * Returns the list of groups a principal is a member of
134
-	 *
135
-	 * @param string $principal
136
-	 * @param bool $needGroups
137
-	 * @return array
138
-	 * @throws Exception
139
-	 */
140
-	public function getGroupMembership($principal, $needGroups = false) {
141
-		list($prefix, $name) = URLUtil::splitPath($principal);
142
-
143
-		if ($prefix === $this->principalPrefix) {
144
-			$user = $this->userManager->get($name);
145
-			if (!$user) {
146
-				throw new Exception('Principal not found');
147
-			}
148
-
149
-			if ($this->hasGroups || $needGroups) {
150
-				$groups = $this->groupManager->getUserGroups($user);
151
-				$groups = array_map(function($group) {
152
-					/** @var IGroup $group */
153
-					return 'principals/groups/' . $group->getGID();
154
-				}, $groups);
155
-
156
-				return $groups;
157
-			}
158
-		}
159
-		return [];
160
-	}
161
-
162
-	/**
163
-	 * Updates the list of group members for a group principal.
164
-	 *
165
-	 * The principals should be passed as a list of uri's.
166
-	 *
167
-	 * @param string $principal
168
-	 * @param string[] $members
169
-	 * @throws Exception
170
-	 */
171
-	public function setGroupMemberSet($principal, array $members) {
172
-		throw new Exception('Setting members of the group is not supported yet');
173
-	}
174
-
175
-	/**
176
-	 * @param string $path
177
-	 * @param PropPatch $propPatch
178
-	 * @return int
179
-	 */
180
-	function updatePrincipal($path, PropPatch $propPatch) {
181
-		return 0;
182
-	}
183
-
184
-	/**
185
-	 * @param string $prefixPath
186
-	 * @param array $searchProperties
187
-	 * @param string $test
188
-	 * @return array
189
-	 */
190
-	function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') {
191
-		return [];
192
-	}
193
-
194
-	/**
195
-	 * @param string $uri
196
-	 * @param string $principalPrefix
197
-	 * @return string
198
-	 */
199
-	function findByUri($uri, $principalPrefix) {
200
-		if (substr($uri, 0, 7) === 'mailto:') {
201
-			$email = substr($uri, 7);
202
-			$users = $this->userManager->getByEmail($email);
203
-			if (count($users) === 1) {
204
-				return $this->principalPrefix . '/' . $users[0]->getUID();
205
-			}
206
-		}
207
-
208
-		return '';
209
-	}
210
-
211
-	/**
212
-	 * @param IUser $user
213
-	 * @return array
214
-	 */
215
-	protected function userToPrincipal($user) {
216
-		$userId = $user->getUID();
217
-		$displayName = $user->getDisplayName();
218
-		$principal = [
219
-				'uri' => $this->principalPrefix . '/' . $userId,
220
-				'{DAV:}displayname' => is_null($displayName) ? $userId : $displayName,
221
-		];
222
-
223
-		$email = $user->getEMailAddress();
224
-		if (!empty($email)) {
225
-			$principal['{http://sabredav.org/ns}email-address'] = $email;
226
-			return $principal;
227
-		}
228
-		return $principal;
229
-	}
230
-
231
-	public function getPrincipalPrefix() {
232
-		return $this->principalPrefix;
233
-	}
43
+    /** @var IUserManager */
44
+    private $userManager;
45
+
46
+    /** @var IGroupManager */
47
+    private $groupManager;
48
+
49
+    /** @var string */
50
+    private $principalPrefix;
51
+
52
+    /** @var bool */
53
+    private $hasGroups;
54
+
55
+    /**
56
+     * @param IUserManager $userManager
57
+     * @param IGroupManager $groupManager
58
+     * @param string $principalPrefix
59
+     */
60
+    public function __construct(IUserManager $userManager,
61
+                                IGroupManager $groupManager,
62
+                                $principalPrefix = 'principals/users/') {
63
+        $this->userManager = $userManager;
64
+        $this->groupManager = $groupManager;
65
+        $this->principalPrefix = trim($principalPrefix, '/');
66
+        $this->hasGroups = ($principalPrefix === 'principals/users/');
67
+    }
68
+
69
+    /**
70
+     * Returns a list of principals based on a prefix.
71
+     *
72
+     * This prefix will often contain something like 'principals'. You are only
73
+     * expected to return principals that are in this base path.
74
+     *
75
+     * You are expected to return at least a 'uri' for every user, you can
76
+     * return any additional properties if you wish so. Common properties are:
77
+     *   {DAV:}displayname
78
+     *
79
+     * @param string $prefixPath
80
+     * @return string[]
81
+     */
82
+    public function getPrincipalsByPrefix($prefixPath) {
83
+        $principals = [];
84
+
85
+        if ($prefixPath === $this->principalPrefix) {
86
+            foreach($this->userManager->search('') as $user) {
87
+                $principals[] = $this->userToPrincipal($user);
88
+            }
89
+        }
90
+
91
+        return $principals;
92
+    }
93
+
94
+    /**
95
+     * Returns a specific principal, specified by it's path.
96
+     * The returned structure should be the exact same as from
97
+     * getPrincipalsByPrefix.
98
+     *
99
+     * @param string $path
100
+     * @return array
101
+     */
102
+    public function getPrincipalByPath($path) {
103
+        list($prefix, $name) = URLUtil::splitPath($path);
104
+
105
+        if ($prefix === $this->principalPrefix) {
106
+            $user = $this->userManager->get($name);
107
+
108
+            if (!is_null($user)) {
109
+                return $this->userToPrincipal($user);
110
+            }
111
+        }
112
+        return null;
113
+    }
114
+
115
+    /**
116
+     * Returns the list of members for a group-principal
117
+     *
118
+     * @param string $principal
119
+     * @return string[]
120
+     * @throws Exception
121
+     */
122
+    public function getGroupMemberSet($principal) {
123
+        // TODO: for now the group principal has only one member, the user itself
124
+        $principal = $this->getPrincipalByPath($principal);
125
+        if (!$principal) {
126
+            throw new Exception('Principal not found');
127
+        }
128
+
129
+        return [$principal['uri']];
130
+    }
131
+
132
+    /**
133
+     * Returns the list of groups a principal is a member of
134
+     *
135
+     * @param string $principal
136
+     * @param bool $needGroups
137
+     * @return array
138
+     * @throws Exception
139
+     */
140
+    public function getGroupMembership($principal, $needGroups = false) {
141
+        list($prefix, $name) = URLUtil::splitPath($principal);
142
+
143
+        if ($prefix === $this->principalPrefix) {
144
+            $user = $this->userManager->get($name);
145
+            if (!$user) {
146
+                throw new Exception('Principal not found');
147
+            }
148
+
149
+            if ($this->hasGroups || $needGroups) {
150
+                $groups = $this->groupManager->getUserGroups($user);
151
+                $groups = array_map(function($group) {
152
+                    /** @var IGroup $group */
153
+                    return 'principals/groups/' . $group->getGID();
154
+                }, $groups);
155
+
156
+                return $groups;
157
+            }
158
+        }
159
+        return [];
160
+    }
161
+
162
+    /**
163
+     * Updates the list of group members for a group principal.
164
+     *
165
+     * The principals should be passed as a list of uri's.
166
+     *
167
+     * @param string $principal
168
+     * @param string[] $members
169
+     * @throws Exception
170
+     */
171
+    public function setGroupMemberSet($principal, array $members) {
172
+        throw new Exception('Setting members of the group is not supported yet');
173
+    }
174
+
175
+    /**
176
+     * @param string $path
177
+     * @param PropPatch $propPatch
178
+     * @return int
179
+     */
180
+    function updatePrincipal($path, PropPatch $propPatch) {
181
+        return 0;
182
+    }
183
+
184
+    /**
185
+     * @param string $prefixPath
186
+     * @param array $searchProperties
187
+     * @param string $test
188
+     * @return array
189
+     */
190
+    function searchPrincipals($prefixPath, array $searchProperties, $test = 'allof') {
191
+        return [];
192
+    }
193
+
194
+    /**
195
+     * @param string $uri
196
+     * @param string $principalPrefix
197
+     * @return string
198
+     */
199
+    function findByUri($uri, $principalPrefix) {
200
+        if (substr($uri, 0, 7) === 'mailto:') {
201
+            $email = substr($uri, 7);
202
+            $users = $this->userManager->getByEmail($email);
203
+            if (count($users) === 1) {
204
+                return $this->principalPrefix . '/' . $users[0]->getUID();
205
+            }
206
+        }
207
+
208
+        return '';
209
+    }
210
+
211
+    /**
212
+     * @param IUser $user
213
+     * @return array
214
+     */
215
+    protected function userToPrincipal($user) {
216
+        $userId = $user->getUID();
217
+        $displayName = $user->getDisplayName();
218
+        $principal = [
219
+                'uri' => $this->principalPrefix . '/' . $userId,
220
+                '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName,
221
+        ];
222
+
223
+        $email = $user->getEMailAddress();
224
+        if (!empty($email)) {
225
+            $principal['{http://sabredav.org/ns}email-address'] = $email;
226
+            return $principal;
227
+        }
228
+        return $principal;
229
+    }
230
+
231
+    public function getPrincipalPrefix() {
232
+        return $this->principalPrefix;
233
+    }
234 234
 
235 235
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/Forbidden.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -24,42 +24,42 @@
 block discarded – undo
24 24
 
25 25
 class Forbidden extends \Sabre\DAV\Exception\Forbidden {
26 26
 
27
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
27
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
28 28
 
29
-	/**
30
-	 * @var bool
31
-	 */
32
-	private $retry;
29
+    /**
30
+     * @var bool
31
+     */
32
+    private $retry;
33 33
 
34
-	/**
35
-	 * @param string $message
36
-	 * @param bool $retry
37
-	 * @param \Exception $previous
38
-	 */
39
-	public function __construct($message, $retry = false, \Exception $previous = null) {
40
-		parent::__construct($message, 0, $previous);
41
-		$this->retry = $retry;
42
-	}
34
+    /**
35
+     * @param string $message
36
+     * @param bool $retry
37
+     * @param \Exception $previous
38
+     */
39
+    public function __construct($message, $retry = false, \Exception $previous = null) {
40
+        parent::__construct($message, 0, $previous);
41
+        $this->retry = $retry;
42
+    }
43 43
 
44
-	/**
45
-	 * This method allows the exception to include additional information
46
-	 * into the WebDAV error response
47
-	 *
48
-	 * @param \Sabre\DAV\Server $server
49
-	 * @param \DOMElement $errorNode
50
-	 * @return void
51
-	 */
52
-	public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
44
+    /**
45
+     * This method allows the exception to include additional information
46
+     * into the WebDAV error response
47
+     *
48
+     * @param \Sabre\DAV\Server $server
49
+     * @param \DOMElement $errorNode
50
+     * @return void
51
+     */
52
+    public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
53 53
 
54
-		// set ownCloud namespace
55
-		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
54
+        // set ownCloud namespace
55
+        $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
56 56
 
57
-		// adding the retry node
58
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
59
-		$errorNode->appendChild($error);
57
+        // adding the retry node
58
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
59
+        $errorNode->appendChild($error);
60 60
 
61
-		// adding the message node
62
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
63
-		$errorNode->appendChild($error);
64
-	}
61
+        // adding the message node
62
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
63
+        $errorNode->appendChild($error);
64
+    }
65 65
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/InvalidPath.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -26,53 +26,53 @@
 block discarded – undo
26 26
 
27 27
 class InvalidPath extends Exception {
28 28
 
29
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
29
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
30 30
 
31
-	/**
32
-	 * @var bool
33
-	 */
34
-	private $retry;
31
+    /**
32
+     * @var bool
33
+     */
34
+    private $retry;
35 35
 
36
-	/**
37
-	 * @param string $message
38
-	 * @param bool $retry
39
-	 */
40
-	public function __construct($message, $retry = false) {
41
-		parent::__construct($message);
42
-		$this->retry = $retry;
43
-	}
36
+    /**
37
+     * @param string $message
38
+     * @param bool $retry
39
+     */
40
+    public function __construct($message, $retry = false) {
41
+        parent::__construct($message);
42
+        $this->retry = $retry;
43
+    }
44 44
 
45
-	/**
46
-	 * Returns the HTTP status code for this exception
47
-	 *
48
-	 * @return int
49
-	 */
50
-	public function getHTTPCode() {
45
+    /**
46
+     * Returns the HTTP status code for this exception
47
+     *
48
+     * @return int
49
+     */
50
+    public function getHTTPCode() {
51 51
 
52
-		return 400;
52
+        return 400;
53 53
 
54
-	}
54
+    }
55 55
 
56
-	/**
57
-	 * This method allows the exception to include additional information
58
-	 * into the WebDAV error response
59
-	 *
60
-	 * @param \Sabre\DAV\Server $server
61
-	 * @param \DOMElement $errorNode
62
-	 * @return void
63
-	 */
64
-	public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
56
+    /**
57
+     * This method allows the exception to include additional information
58
+     * into the WebDAV error response
59
+     *
60
+     * @param \Sabre\DAV\Server $server
61
+     * @param \DOMElement $errorNode
62
+     * @return void
63
+     */
64
+    public function serialize(\Sabre\DAV\Server $server,\DOMElement $errorNode) {
65 65
 
66
-		// set ownCloud namespace
67
-		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
66
+        // set ownCloud namespace
67
+        $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
68 68
 
69
-		// adding the retry node
70
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
71
-		$errorNode->appendChild($error);
69
+        // adding the retry node
70
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:retry', var_export($this->retry, true));
71
+        $errorNode->appendChild($error);
72 72
 
73
-		// adding the message node
74
-		$error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
75
-		$errorNode->appendChild($error);
76
-	}
73
+        // adding the message node
74
+        $error = $errorNode->ownerDocument->createElementNS('o:','o:reason', $this->getMessage());
75
+        $errorNode->appendChild($error);
76
+    }
77 77
 
78 78
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/PasswordLoginForbidden.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -29,27 +29,27 @@
 block discarded – undo
29 29
 
30 30
 class PasswordLoginForbidden extends NotAuthenticated {
31 31
 
32
-	const NS_OWNCLOUD = 'http://owncloud.org/ns';
33
-
34
-	public function getHTTPCode() {
35
-		return 401;
36
-	}
37
-
38
-	/**
39
-	 * This method allows the exception to include additional information
40
-	 * into the WebDAV error response
41
-	 *
42
-	 * @param Server $server
43
-	 * @param DOMElement $errorNode
44
-	 * @return void
45
-	 */
46
-	public function serialize(Server $server, DOMElement $errorNode) {
47
-
48
-		// set ownCloud namespace
49
-		$errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
50
-
51
-		$error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden');
52
-		$errorNode->appendChild($error);
53
-	}
32
+    const NS_OWNCLOUD = 'http://owncloud.org/ns';
33
+
34
+    public function getHTTPCode() {
35
+        return 401;
36
+    }
37
+
38
+    /**
39
+     * This method allows the exception to include additional information
40
+     * into the WebDAV error response
41
+     *
42
+     * @param Server $server
43
+     * @param DOMElement $errorNode
44
+     * @return void
45
+     */
46
+    public function serialize(Server $server, DOMElement $errorNode) {
47
+
48
+        // set ownCloud namespace
49
+        $errorNode->setAttribute('xmlns:o', self::NS_OWNCLOUD);
50
+
51
+        $error = $errorNode->ownerDocument->createElementNS('o:', 'o:hint', 'password login forbidden');
52
+        $errorNode->appendChild($error);
53
+    }
54 54
 
55 55
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/FileLocked.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,20 +30,20 @@
 block discarded – undo
30 30
 
31 31
 class FileLocked extends \Sabre\DAV\Exception {
32 32
 
33
-	public function __construct($message = "", $code = 0, Exception $previous = null) {
34
-		if($previous instanceof \OCP\Files\LockNotAcquiredException) {
35
-			$message = sprintf('Target file %s is locked by another process.', $previous->path);
36
-		}
37
-		parent::__construct($message, $code, $previous);
38
-	}
33
+    public function __construct($message = "", $code = 0, Exception $previous = null) {
34
+        if($previous instanceof \OCP\Files\LockNotAcquiredException) {
35
+            $message = sprintf('Target file %s is locked by another process.', $previous->path);
36
+        }
37
+        parent::__construct($message, $code, $previous);
38
+    }
39 39
 
40
-	/**
41
-	 * Returns the HTTP status code for this exception
42
-	 *
43
-	 * @return int
44
-	 */
45
-	public function getHTTPCode() {
40
+    /**
41
+     * Returns the HTTP status code for this exception
42
+     *
43
+     * @return int
44
+     */
45
+    public function getHTTPCode() {
46 46
 
47
-		return 423;
48
-	}
47
+        return 423;
48
+    }
49 49
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/UnsupportedMediaType.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@
 block discarded – undo
31 31
  */
32 32
 class UnsupportedMediaType extends \Sabre\DAV\Exception {
33 33
 
34
-	/**
35
-	 * Returns the HTTP status code for this exception
36
-	 *
37
-	 * @return int
38
-	 */
39
-	public function getHTTPCode() {
34
+    /**
35
+     * Returns the HTTP status code for this exception
36
+     *
37
+     * @return int
38
+     */
39
+    public function getHTTPCode() {
40 40
 
41
-		return 415;
41
+        return 415;
42 42
 
43
-	}
43
+    }
44 44
 
45 45
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/Exception/EntityTooLarge.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,15 +31,15 @@
 block discarded – undo
31 31
  */
32 32
 class EntityTooLarge extends \Sabre\DAV\Exception {
33 33
 
34
-	/**
35
-	 * Returns the HTTP status code for this exception
36
-	 *
37
-	 * @return int
38
-	 */
39
-	public function getHTTPCode() {
34
+    /**
35
+     * Returns the HTTP status code for this exception
36
+     *
37
+     * @return int
38
+     */
39
+    public function getHTTPCode() {
40 40
 
41
-		return 413;
41
+        return 413;
42 42
 
43
-	}
43
+    }
44 44
 
45 45
 }
Please login to merge, or discard this patch.
apps/dav/lib/Connector/Sabre/CustomPropertiesBackend.php 1 patch
Indentation   +317 added lines, -317 removed lines patch added patch discarded remove patch
@@ -36,322 +36,322 @@
 block discarded – undo
36 36
 
37 37
 class CustomPropertiesBackend implements BackendInterface {
38 38
 
39
-	/**
40
-	 * Ignored properties
41
-	 *
42
-	 * @var array
43
-	 */
44
-	private $ignoredProperties = array(
45
-		'{DAV:}getcontentlength',
46
-		'{DAV:}getcontenttype',
47
-		'{DAV:}getetag',
48
-		'{DAV:}quota-used-bytes',
49
-		'{DAV:}quota-available-bytes',
50
-		'{DAV:}quota-available-bytes',
51
-		'{http://owncloud.org/ns}permissions',
52
-		'{http://owncloud.org/ns}downloadURL',
53
-		'{http://owncloud.org/ns}dDC',
54
-		'{http://owncloud.org/ns}size',
55
-	);
56
-
57
-	/**
58
-	 * @var Tree
59
-	 */
60
-	private $tree;
61
-
62
-	/**
63
-	 * @var IDBConnection
64
-	 */
65
-	private $connection;
66
-
67
-	/**
68
-	 * @var IUser
69
-	 */
70
-	private $user;
71
-
72
-	/**
73
-	 * Properties cache
74
-	 *
75
-	 * @var array
76
-	 */
77
-	private $cache = [];
78
-
79
-	/**
80
-	 * @param Tree $tree node tree
81
-	 * @param IDBConnection $connection database connection
82
-	 * @param IUser $user owner of the tree and properties
83
-	 */
84
-	public function __construct(
85
-		Tree $tree,
86
-		IDBConnection $connection,
87
-		IUser $user) {
88
-		$this->tree = $tree;
89
-		$this->connection = $connection;
90
-		$this->user = $user->getUID();
91
-	}
92
-
93
-	/**
94
-	 * Fetches properties for a path.
95
-	 *
96
-	 * @param string $path
97
-	 * @param PropFind $propFind
98
-	 * @return void
99
-	 */
100
-	public function propFind($path, PropFind $propFind) {
101
-		try {
102
-			$node = $this->tree->getNodeForPath($path);
103
-			if (!($node instanceof Node)) {
104
-				return;
105
-			}
106
-		} catch (ServiceUnavailable $e) {
107
-			// might happen for unavailable mount points, skip
108
-			return;
109
-		} catch (NotFound $e) {
110
-			// in some rare (buggy) cases the node might not be found,
111
-			// we catch the exception to prevent breaking the whole list with a 404
112
-			// (soft fail)
113
-			\OC::$server->getLogger()->warning(
114
-				'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(),
115
-				array('app' => 'files')
116
-			);
117
-			return;
118
-		}
119
-
120
-		$requestedProps = $propFind->get404Properties();
121
-
122
-		// these might appear
123
-		$requestedProps = array_diff(
124
-			$requestedProps,
125
-			$this->ignoredProperties
126
-		);
127
-
128
-		if (empty($requestedProps)) {
129
-			return;
130
-		}
131
-
132
-		if ($node instanceof Directory
133
-			&& $propFind->getDepth() !== 0
134
-		) {
135
-			// note: pre-fetching only supported for depth <= 1
136
-			$this->loadChildrenProperties($node, $requestedProps);
137
-		}
138
-
139
-		$props = $this->getProperties($node, $requestedProps);
140
-		foreach ($props as $propName => $propValue) {
141
-			$propFind->set($propName, $propValue);
142
-		}
143
-	}
144
-
145
-	/**
146
-	 * Updates properties for a path
147
-	 *
148
-	 * @param string $path
149
-	 * @param PropPatch $propPatch
150
-	 *
151
-	 * @return void
152
-	 */
153
-	public function propPatch($path, PropPatch $propPatch) {
154
-		$node = $this->tree->getNodeForPath($path);
155
-		if (!($node instanceof Node)) {
156
-			return;
157
-		}
158
-
159
-		$propPatch->handleRemaining(function($changedProps) use ($node) {
160
-			return $this->updateProperties($node, $changedProps);
161
-		});
162
-	}
163
-
164
-	/**
165
-	 * This method is called after a node is deleted.
166
-	 *
167
-	 * @param string $path path of node for which to delete properties
168
-	 */
169
-	public function delete($path) {
170
-		$statement = $this->connection->prepare(
171
-			'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'
172
-		);
173
-		$statement->execute(array($this->user, '/' . $path));
174
-		$statement->closeCursor();
175
-
176
-		unset($this->cache[$path]);
177
-	}
178
-
179
-	/**
180
-	 * This method is called after a successful MOVE
181
-	 *
182
-	 * @param string $source
183
-	 * @param string $destination
184
-	 *
185
-	 * @return void
186
-	 */
187
-	public function move($source, $destination) {
188
-		$statement = $this->connection->prepare(
189
-			'UPDATE `*PREFIX*properties` SET `propertypath` = ?' .
190
-			' WHERE `userid` = ? AND `propertypath` = ?'
191
-		);
192
-		$statement->execute(array('/' . $destination, $this->user, '/' . $source));
193
-		$statement->closeCursor();
194
-	}
195
-
196
-	/**
197
-	 * Returns a list of properties for this nodes.;
198
-	 * @param Node $node
199
-	 * @param array $requestedProperties requested properties or empty array for "all"
200
-	 * @return array
201
-	 * @note The properties list is a list of propertynames the client
202
-	 * requested, encoded as xmlnamespace#tagName, for example:
203
-	 * http://www.example.org/namespace#author If the array is empty, all
204
-	 * properties should be returned
205
-	 */
206
-	private function getProperties(Node $node, array $requestedProperties) {
207
-		$path = $node->getPath();
208
-		if (isset($this->cache[$path])) {
209
-			return $this->cache[$path];
210
-		}
211
-
212
-		// TODO: chunking if more than 1000 properties
213
-		$sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?';
214
-
215
-		$whereValues = array($this->user, $path);
216
-		$whereTypes = array(null, null);
217
-
218
-		if (!empty($requestedProperties)) {
219
-			// request only a subset
220
-			$sql .= ' AND `propertyname` in (?)';
221
-			$whereValues[] = $requestedProperties;
222
-			$whereTypes[] = \Doctrine\DBAL\Connection::PARAM_STR_ARRAY;
223
-		}
224
-
225
-		$result = $this->connection->executeQuery(
226
-			$sql,
227
-			$whereValues,
228
-			$whereTypes
229
-		);
230
-
231
-		$props = [];
232
-		while ($row = $result->fetch()) {
233
-			$props[$row['propertyname']] = $row['propertyvalue'];
234
-		}
235
-
236
-		$result->closeCursor();
237
-
238
-		$this->cache[$path] = $props;
239
-		return $props;
240
-	}
241
-
242
-	/**
243
-	 * Update properties
244
-	 *
245
-	 * @param Node $node node for which to update properties
246
-	 * @param array $properties array of properties to update
247
-	 *
248
-	 * @return bool
249
-	 */
250
-	private function updateProperties($node, $properties) {
251
-		$path = $node->getPath();
252
-
253
-		$deleteStatement = 'DELETE FROM `*PREFIX*properties`' .
254
-			' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
255
-
256
-		$insertStatement = 'INSERT INTO `*PREFIX*properties`' .
257
-			' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)';
258
-
259
-		$updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' .
260
-			' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
261
-
262
-		// TODO: use "insert or update" strategy ?
263
-		$existing = $this->getProperties($node, array());
264
-		$this->connection->beginTransaction();
265
-		foreach ($properties as $propertyName => $propertyValue) {
266
-			// If it was null, we need to delete the property
267
-			if (is_null($propertyValue)) {
268
-				if (array_key_exists($propertyName, $existing)) {
269
-					$this->connection->executeUpdate($deleteStatement,
270
-						array(
271
-							$this->user,
272
-							$path,
273
-							$propertyName
274
-						)
275
-					);
276
-				}
277
-			} else {
278
-				if (!array_key_exists($propertyName, $existing)) {
279
-					$this->connection->executeUpdate($insertStatement,
280
-						array(
281
-							$this->user,
282
-							$path,
283
-							$propertyName,
284
-							$propertyValue
285
-						)
286
-					);
287
-				} else {
288
-					$this->connection->executeUpdate($updateStatement,
289
-						array(
290
-							$propertyValue,
291
-							$this->user,
292
-							$path,
293
-							$propertyName
294
-						)
295
-					);
296
-				}
297
-			}
298
-		}
299
-
300
-		$this->connection->commit();
301
-		unset($this->cache[$path]);
302
-
303
-		return true;
304
-	}
305
-
306
-	/**
307
-	 * Bulk load properties for directory children
308
-	 *
309
-	 * @param Directory $node
310
-	 * @param array $requestedProperties requested properties
311
-	 *
312
-	 * @return void
313
-	 */
314
-	private function loadChildrenProperties(Directory $node, $requestedProperties) {
315
-		$path = $node->getPath();
316
-		if (isset($this->cache[$path])) {
317
-			// we already loaded them at some point
318
-			return;
319
-		}
320
-
321
-		$childNodes = $node->getChildren();
322
-		// pre-fill cache
323
-		foreach ($childNodes as $childNode) {
324
-			$this->cache[$childNode->getPath()] = [];
325
-		}
326
-
327
-		$sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` LIKE ?';
328
-		$sql .= ' AND `propertyname` in (?) ORDER BY `propertypath`, `propertyname`';
329
-
330
-		$result = $this->connection->executeQuery(
331
-			$sql,
332
-			array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties),
333
-			array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
334
-		);
335
-
336
-		$oldPath = null;
337
-		$props = [];
338
-		while ($row = $result->fetch()) {
339
-			$path = $row['propertypath'];
340
-			if ($oldPath !== $path) {
341
-				// save previously gathered props
342
-				$this->cache[$oldPath] = $props;
343
-				$oldPath = $path;
344
-				// prepare props for next path
345
-				$props = [];
346
-			}
347
-			$props[$row['propertyname']] = $row['propertyvalue'];
348
-		}
349
-		if (!is_null($oldPath)) {
350
-			// save props from last run
351
-			$this->cache[$oldPath] = $props;
352
-		}
353
-
354
-		$result->closeCursor();
355
-	}
39
+    /**
40
+     * Ignored properties
41
+     *
42
+     * @var array
43
+     */
44
+    private $ignoredProperties = array(
45
+        '{DAV:}getcontentlength',
46
+        '{DAV:}getcontenttype',
47
+        '{DAV:}getetag',
48
+        '{DAV:}quota-used-bytes',
49
+        '{DAV:}quota-available-bytes',
50
+        '{DAV:}quota-available-bytes',
51
+        '{http://owncloud.org/ns}permissions',
52
+        '{http://owncloud.org/ns}downloadURL',
53
+        '{http://owncloud.org/ns}dDC',
54
+        '{http://owncloud.org/ns}size',
55
+    );
56
+
57
+    /**
58
+     * @var Tree
59
+     */
60
+    private $tree;
61
+
62
+    /**
63
+     * @var IDBConnection
64
+     */
65
+    private $connection;
66
+
67
+    /**
68
+     * @var IUser
69
+     */
70
+    private $user;
71
+
72
+    /**
73
+     * Properties cache
74
+     *
75
+     * @var array
76
+     */
77
+    private $cache = [];
78
+
79
+    /**
80
+     * @param Tree $tree node tree
81
+     * @param IDBConnection $connection database connection
82
+     * @param IUser $user owner of the tree and properties
83
+     */
84
+    public function __construct(
85
+        Tree $tree,
86
+        IDBConnection $connection,
87
+        IUser $user) {
88
+        $this->tree = $tree;
89
+        $this->connection = $connection;
90
+        $this->user = $user->getUID();
91
+    }
92
+
93
+    /**
94
+     * Fetches properties for a path.
95
+     *
96
+     * @param string $path
97
+     * @param PropFind $propFind
98
+     * @return void
99
+     */
100
+    public function propFind($path, PropFind $propFind) {
101
+        try {
102
+            $node = $this->tree->getNodeForPath($path);
103
+            if (!($node instanceof Node)) {
104
+                return;
105
+            }
106
+        } catch (ServiceUnavailable $e) {
107
+            // might happen for unavailable mount points, skip
108
+            return;
109
+        } catch (NotFound $e) {
110
+            // in some rare (buggy) cases the node might not be found,
111
+            // we catch the exception to prevent breaking the whole list with a 404
112
+            // (soft fail)
113
+            \OC::$server->getLogger()->warning(
114
+                'Could not get node for path: \"' . $path . '\" : ' . $e->getMessage(),
115
+                array('app' => 'files')
116
+            );
117
+            return;
118
+        }
119
+
120
+        $requestedProps = $propFind->get404Properties();
121
+
122
+        // these might appear
123
+        $requestedProps = array_diff(
124
+            $requestedProps,
125
+            $this->ignoredProperties
126
+        );
127
+
128
+        if (empty($requestedProps)) {
129
+            return;
130
+        }
131
+
132
+        if ($node instanceof Directory
133
+            && $propFind->getDepth() !== 0
134
+        ) {
135
+            // note: pre-fetching only supported for depth <= 1
136
+            $this->loadChildrenProperties($node, $requestedProps);
137
+        }
138
+
139
+        $props = $this->getProperties($node, $requestedProps);
140
+        foreach ($props as $propName => $propValue) {
141
+            $propFind->set($propName, $propValue);
142
+        }
143
+    }
144
+
145
+    /**
146
+     * Updates properties for a path
147
+     *
148
+     * @param string $path
149
+     * @param PropPatch $propPatch
150
+     *
151
+     * @return void
152
+     */
153
+    public function propPatch($path, PropPatch $propPatch) {
154
+        $node = $this->tree->getNodeForPath($path);
155
+        if (!($node instanceof Node)) {
156
+            return;
157
+        }
158
+
159
+        $propPatch->handleRemaining(function($changedProps) use ($node) {
160
+            return $this->updateProperties($node, $changedProps);
161
+        });
162
+    }
163
+
164
+    /**
165
+     * This method is called after a node is deleted.
166
+     *
167
+     * @param string $path path of node for which to delete properties
168
+     */
169
+    public function delete($path) {
170
+        $statement = $this->connection->prepare(
171
+            'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'
172
+        );
173
+        $statement->execute(array($this->user, '/' . $path));
174
+        $statement->closeCursor();
175
+
176
+        unset($this->cache[$path]);
177
+    }
178
+
179
+    /**
180
+     * This method is called after a successful MOVE
181
+     *
182
+     * @param string $source
183
+     * @param string $destination
184
+     *
185
+     * @return void
186
+     */
187
+    public function move($source, $destination) {
188
+        $statement = $this->connection->prepare(
189
+            'UPDATE `*PREFIX*properties` SET `propertypath` = ?' .
190
+            ' WHERE `userid` = ? AND `propertypath` = ?'
191
+        );
192
+        $statement->execute(array('/' . $destination, $this->user, '/' . $source));
193
+        $statement->closeCursor();
194
+    }
195
+
196
+    /**
197
+     * Returns a list of properties for this nodes.;
198
+     * @param Node $node
199
+     * @param array $requestedProperties requested properties or empty array for "all"
200
+     * @return array
201
+     * @note The properties list is a list of propertynames the client
202
+     * requested, encoded as xmlnamespace#tagName, for example:
203
+     * http://www.example.org/namespace#author If the array is empty, all
204
+     * properties should be returned
205
+     */
206
+    private function getProperties(Node $node, array $requestedProperties) {
207
+        $path = $node->getPath();
208
+        if (isset($this->cache[$path])) {
209
+            return $this->cache[$path];
210
+        }
211
+
212
+        // TODO: chunking if more than 1000 properties
213
+        $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?';
214
+
215
+        $whereValues = array($this->user, $path);
216
+        $whereTypes = array(null, null);
217
+
218
+        if (!empty($requestedProperties)) {
219
+            // request only a subset
220
+            $sql .= ' AND `propertyname` in (?)';
221
+            $whereValues[] = $requestedProperties;
222
+            $whereTypes[] = \Doctrine\DBAL\Connection::PARAM_STR_ARRAY;
223
+        }
224
+
225
+        $result = $this->connection->executeQuery(
226
+            $sql,
227
+            $whereValues,
228
+            $whereTypes
229
+        );
230
+
231
+        $props = [];
232
+        while ($row = $result->fetch()) {
233
+            $props[$row['propertyname']] = $row['propertyvalue'];
234
+        }
235
+
236
+        $result->closeCursor();
237
+
238
+        $this->cache[$path] = $props;
239
+        return $props;
240
+    }
241
+
242
+    /**
243
+     * Update properties
244
+     *
245
+     * @param Node $node node for which to update properties
246
+     * @param array $properties array of properties to update
247
+     *
248
+     * @return bool
249
+     */
250
+    private function updateProperties($node, $properties) {
251
+        $path = $node->getPath();
252
+
253
+        $deleteStatement = 'DELETE FROM `*PREFIX*properties`' .
254
+            ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
255
+
256
+        $insertStatement = 'INSERT INTO `*PREFIX*properties`' .
257
+            ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)';
258
+
259
+        $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' .
260
+            ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?';
261
+
262
+        // TODO: use "insert or update" strategy ?
263
+        $existing = $this->getProperties($node, array());
264
+        $this->connection->beginTransaction();
265
+        foreach ($properties as $propertyName => $propertyValue) {
266
+            // If it was null, we need to delete the property
267
+            if (is_null($propertyValue)) {
268
+                if (array_key_exists($propertyName, $existing)) {
269
+                    $this->connection->executeUpdate($deleteStatement,
270
+                        array(
271
+                            $this->user,
272
+                            $path,
273
+                            $propertyName
274
+                        )
275
+                    );
276
+                }
277
+            } else {
278
+                if (!array_key_exists($propertyName, $existing)) {
279
+                    $this->connection->executeUpdate($insertStatement,
280
+                        array(
281
+                            $this->user,
282
+                            $path,
283
+                            $propertyName,
284
+                            $propertyValue
285
+                        )
286
+                    );
287
+                } else {
288
+                    $this->connection->executeUpdate($updateStatement,
289
+                        array(
290
+                            $propertyValue,
291
+                            $this->user,
292
+                            $path,
293
+                            $propertyName
294
+                        )
295
+                    );
296
+                }
297
+            }
298
+        }
299
+
300
+        $this->connection->commit();
301
+        unset($this->cache[$path]);
302
+
303
+        return true;
304
+    }
305
+
306
+    /**
307
+     * Bulk load properties for directory children
308
+     *
309
+     * @param Directory $node
310
+     * @param array $requestedProperties requested properties
311
+     *
312
+     * @return void
313
+     */
314
+    private function loadChildrenProperties(Directory $node, $requestedProperties) {
315
+        $path = $node->getPath();
316
+        if (isset($this->cache[$path])) {
317
+            // we already loaded them at some point
318
+            return;
319
+        }
320
+
321
+        $childNodes = $node->getChildren();
322
+        // pre-fill cache
323
+        foreach ($childNodes as $childNode) {
324
+            $this->cache[$childNode->getPath()] = [];
325
+        }
326
+
327
+        $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` LIKE ?';
328
+        $sql .= ' AND `propertyname` in (?) ORDER BY `propertypath`, `propertyname`';
329
+
330
+        $result = $this->connection->executeQuery(
331
+            $sql,
332
+            array($this->user, $this->connection->escapeLikeParameter(rtrim($path, '/')) . '/%', $requestedProperties),
333
+            array(null, null, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY)
334
+        );
335
+
336
+        $oldPath = null;
337
+        $props = [];
338
+        while ($row = $result->fetch()) {
339
+            $path = $row['propertypath'];
340
+            if ($oldPath !== $path) {
341
+                // save previously gathered props
342
+                $this->cache[$oldPath] = $props;
343
+                $oldPath = $path;
344
+                // prepare props for next path
345
+                $props = [];
346
+            }
347
+            $props[$row['propertyname']] = $row['propertyvalue'];
348
+        }
349
+        if (!is_null($oldPath)) {
350
+            // save props from last run
351
+            $this->cache[$oldPath] = $props;
352
+        }
353
+
354
+        $result->closeCursor();
355
+    }
356 356
 
357 357
 }
Please login to merge, or discard this patch.