Completed
Pull Request — master (#5823)
by Björn
17:16
created
apps/files_sharing/lib/Controller/RemoteController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 			return new DataResponse();
85 85
 		}
86 86
 
87
-		$this->logger->error('Could not accept federated share with id: ' . $id,
87
+		$this->logger->error('Could not accept federated share with id: '.$id,
88 88
 			['app' => 'files_sharing']);
89 89
 
90 90
 		throw new OCSNotFoundException('wrong share ID, share doesn\'t exist.');
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * @return array enriched share info with data from the filecache
116 116
 	 */
117 117
 	private static function extendShareInfo($share) {
118
-		$view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/');
118
+		$view = new \OC\Files\View('/'.\OC_User::getUser().'/files/');
119 119
 		$info = $view->getFileInfo($share['mountpoint']);
120 120
 
121 121
 		$share['mimetype'] = $info->getMimetype();
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 			throw new OCSNotFoundException('Share does not exist');
179 179
 		}
180 180
 
181
-		$mountPoint = '/' . \OC_User::getUser() . '/files' . $shareInfo['mountpoint'];
181
+		$mountPoint = '/'.\OC_User::getUser().'/files'.$shareInfo['mountpoint'];
182 182
 
183 183
 		if ($this->externalManager->removeShare($mountPoint) === true) {
184 184
 			return new DataResponse();
Please login to merge, or discard this patch.
apps/federatedfilesharing/lib/Controller/RequestHandlerController.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 		$owner = isset($_POST['owner']) ? $_POST['owner'] : null;
127 127
 		$sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null;
128 128
 		$shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null;
129
-		$remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null;
129
+		$remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null;
130 130
 		$sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null;
131 131
 		$ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null;
132 132
 
@@ -137,13 +137,13 @@  discard block
 block discarded – undo
137 137
 			}
138 138
 
139 139
 			// FIXME this should be a method in the user management instead
140
-			\OCP\Util::writeLog('files_sharing', 'shareWith before, ' . $shareWith, \OCP\Util::DEBUG);
140
+			\OCP\Util::writeLog('files_sharing', 'shareWith before, '.$shareWith, \OCP\Util::DEBUG);
141 141
 			\OCP\Util::emitHook(
142 142
 				'\OCA\Files_Sharing\API\Server2Server',
143 143
 				'preLoginNameUsedAsUserName',
144 144
 				array('uid' => &$shareWith)
145 145
 			);
146
-			\OCP\Util::writeLog('files_sharing', 'shareWith after, ' . $shareWith, \OCP\Util::DEBUG);
146
+			\OCP\Util::writeLog('files_sharing', 'shareWith after, '.$shareWith, \OCP\Util::DEBUG);
147 147
 
148 148
 			if (!\OCP\User::userExists($shareWith)) {
149 149
 				throw new OCSException('User does not exists', 400);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 					->setType('remote_share')
180 180
 					->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')])
181 181
 					->setAffectedUser($shareWith)
182
-					->setObject('remote_share', (int)$shareId, $name);
182
+					->setObject('remote_share', (int) $shareId, $name);
183 183
 				\OC::$server->getActivityManager()->publish($event);
184 184
 
185 185
 				$urlGenerator = \OC::$server->getURLGenerator();
@@ -194,20 +194,20 @@  discard block
 block discarded – undo
194 194
 
195 195
 				$declineAction = $notification->createAction();
196 196
 				$declineAction->setLabel('decline')
197
-					->setLink($urlGenerator->getAbsoluteURL($urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'DELETE');
197
+					->setLink($urlGenerator->getAbsoluteURL($urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'DELETE');
198 198
 				$notification->addAction($declineAction);
199 199
 
200 200
 				$acceptAction = $notification->createAction();
201 201
 				$acceptAction->setLabel('accept')
202
-					->setLink($urlGenerator->getAbsoluteURL($urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'POST');
202
+					->setLink($urlGenerator->getAbsoluteURL($urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'POST');
203 203
 				$notification->addAction($acceptAction);
204 204
 
205 205
 				$notificationManager->notify($notification);
206 206
 
207 207
 				return new Http\DataResponse();
208 208
 			} catch (\Exception $e) {
209
-				\OCP\Util::writeLog('files_sharing', 'server can not add remote share, ' . $e->getMessage(), \OCP\Util::ERROR);
210
-				throw new OCSException('internal server error, was not able to add share from ' . $remote, 500);
209
+				\OCP\Util::writeLog('files_sharing', 'server can not add remote share, '.$e->getMessage(), \OCP\Util::ERROR);
210
+				throw new OCSException('internal server error, was not able to add share from '.$remote, 500);
211 211
 			}
212 212
 		}
213 213
 
@@ -230,8 +230,8 @@  discard block
 block discarded – undo
230 230
 
231 231
 		$token = $this->request->getParam('token', null);
232 232
 		$shareWith = $this->request->getParam('shareWith', null);
233
-		$permission = (int)$this->request->getParam('permission', null);
234
-		$remoteId = (int)$this->request->getParam('remoteId', null);
233
+		$permission = (int) $this->request->getParam('permission', null);
234
+		$remoteId = (int) $this->request->getParam('remoteId', null);
235 235
 
236 236
 		if ($id === null ||
237 237
 			$token === null ||
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 				$share->setSharedWith($shareWith);
267 267
 				try {
268 268
 					$result = $this->federatedShareProvider->create($share);
269
-					$this->federatedShareProvider->storeRemoteId((int)$result->getId(), $remoteId);
269
+					$this->federatedShareProvider->storeRemoteId((int) $result->getId(), $remoteId);
270 270
 					return new Http\DataResponse([
271 271
 						'token' => $result->getToken(),
272 272
 						'remoteId' => $result->getId()
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
 			$notification = $notificationManager->createNotification();
446 446
 			$notification->setApp('files_sharing')
447 447
 				->setUser($share['user'])
448
-				->setObject('remote_share', (int)$share['id']);
448
+				->setObject('remote_share', (int) $share['id']);
449 449
 			$notificationManager->markProcessed($notification);
450 450
 
451 451
 			$event = \OC::$server->getActivityManager()->generateEvent();
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 				->setType('remote_share')
454 454
 				->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path])
455 455
 				->setAffectedUser($user)
456
-				->setObject('remote_share', (int)$share['id'], $path);
456
+				->setObject('remote_share', (int) $share['id'], $path);
457 457
 			\OC::$server->getActivityManager()->publish($event);
458 458
 		}
459 459
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		$validPermission = ctype_digit($permissions);
596 596
 		$validToken = $this->verifyShare($share, $token);
597 597
 		if ($validPermission && $validToken) {
598
-			$this->updatePermissionsInDatabase($share, (int)$permissions);
598
+			$this->updatePermissionsInDatabase($share, (int) $permissions);
599 599
 		} else {
600 600
 			throw new OCSBadRequestException();
601 601
 		}
Please login to merge, or discard this patch.