Completed
Pull Request — master (#5231)
by Morris
16:38
created
apps/files_sharing/lib/Updater.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,11 +90,11 @@
 block discarded – undo
90 90
 	 */
91 91
 	static private function renameChildren($oldPath, $newPath) {
92 92
 
93
-		$absNewPath =  \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath);
94
-		$absOldPath =  \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath);
93
+		$absNewPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files/'.$newPath);
94
+		$absOldPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files/'.$oldPath);
95 95
 
96 96
 		$mountManager = \OC\Files\Filesystem::getMountManager();
97
-		$mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath);
97
+		$mountedShares = $mountManager->findIn('/'.\OCP\User::getUser().'/files/'.$oldPath);
98 98
 		foreach ($mountedShares as $mount) {
99 99
 			if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) {
100 100
 				$mountPoint = $mount->getMountPoint();
Please login to merge, or discard this patch.
apps/files_sharing/lib/Helper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		$basePath = $path;
89 89
 
90
-		if ($relativePath !== null && Filesystem::isReadable($basePath . $relativePath)) {
90
+		if ($relativePath !== null && Filesystem::isReadable($basePath.$relativePath)) {
91 91
 			$path .= Filesystem::normalizePath($relativePath);
92 92
 		}
93 93
 
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 		if ($password !== null) {
113 113
 			if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
114 114
 				if ($shareManager->checkPassword($share, $password)) {
115
-					\OC::$server->getSession()->set('public_link_authenticated', (string)$share->getId());
115
+					\OC::$server->getSession()->set('public_link_authenticated', (string) $share->getId());
116 116
 					return true;
117 117
 				}
118 118
 			}
119 119
 		} else {
120 120
 			// not authenticated ?
121 121
 			if (\OC::$server->getSession()->exists('public_link_authenticated')
122
-				&& \OC::$server->getSession()->get('public_link_authenticated') !== (string)$share->getId()) {
122
+				&& \OC::$server->getSession()->get('public_link_authenticated') !== (string) $share->getId()) {
123 123
 				return true;
124 124
 			}
125 125
 		}
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		Filesystem::initMountPoints($owner);
133 133
 		$info = Filesystem::getFileInfo($target);
134 134
 		$ownerView = new View('/'.$owner.'/files');
135
-		if ( $owner != User::getUser() ) {
135
+		if ($owner != User::getUser()) {
136 136
 			$path = $ownerView->getPath($info['fileid']);
137 137
 		} else {
138 138
 			$path = $target;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			if ($info instanceof \OC\Files\FileInfo) {
146 146
 				$ids[] = $info['fileid'];
147 147
 			} else {
148
-				\OCP\Util::writeLog('sharing', 'No fileinfo available for: ' . $path, \OCP\Util::WARN);
148
+				\OCP\Util::writeLog('sharing', 'No fileinfo available for: '.$path, \OCP\Util::WARN);
149 149
 			}
150 150
 			$path = dirname($path);
151 151
 		}
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			$idList = array_chunk($ids, 99, true);
156 156
 
157 157
 			foreach ($idList as $subList) {
158
-				$statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (" . implode(',', $subList) . ") AND `share_type` IN (0, 1, 2)";
158
+				$statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (".implode(',', $subList).") AND `share_type` IN (0, 1, 2)";
159 159
 				$query = \OCP\DB::prepare($statement);
160 160
 				$r = $query->execute();
161 161
 				$result = array_merge($result, $r->fetchAll());
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			$uid = User::getUser();
184 184
 		}
185 185
 		Filesystem::initMountPoints($uid);
186
-		if ( $uid != User::getUser() ) {
186
+		if ($uid != User::getUser()) {
187 187
 			$info = Filesystem::getFileInfo($filename);
188 188
 			$ownerView = new View('/'.$uid.'/files');
189 189
 			try {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		$dir = $pathinfo['dirname'];
231 231
 		$i = 2;
232 232
 		while ($view->file_exists($path) || in_array($path, $excludeList)) {
233
-			$path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext);
233
+			$path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext);
234 234
 			$i++;
235 235
 		}
236 236
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 			$dir = '';
255 255
 			$subdirs = explode('/', $shareFolder);
256 256
 			foreach ($subdirs as $subdir) {
257
-				$dir = $dir . '/' . $subdir;
257
+				$dir = $dir.'/'.$subdir;
258 258
 				if (!$view->is_dir($dir)) {
259 259
 					$view->mkdir($dir);
260 260
 				}
Please login to merge, or discard this patch.
apps/files_sharing/lib/DeleteOrphanedSharesJob.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * sets the correct interval for this timed job
43 43
 	 */
44
-	public function __construct(){
44
+	public function __construct() {
45 45
 		$this->interval = $this->defaultIntervalMin * 60;
46 46
 	}
47 47
 
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 		$logger = \OC::$server->getLogger();
56 56
 
57 57
 		$sql =
58
-			'DELETE FROM `*PREFIX*share` ' .
59
-			'WHERE `item_type` in (\'file\', \'folder\') ' .
58
+			'DELETE FROM `*PREFIX*share` '.
59
+			'WHERE `item_type` in (\'file\', \'folder\') '.
60 60
 			'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)';
61 61
 
62 62
 		$deletedEntries = $connection->executeUpdate($sql);
Please login to merge, or discard this patch.
apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 	 * @throws S2SException
91 91
 	 */
92 92
 	public function beforeController($controller, $methodName) {
93
-		if(!$this->isSharingEnabled()) {
93
+		if (!$this->isSharingEnabled()) {
94 94
 			throw new NotFoundException('Sharing is disabled.');
95 95
 		}
96 96
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @throws \Exception
118 118
 	 */
119 119
 	public function afterException($controller, $methodName, \Exception $exception) {
120
-		if(is_a($exception, '\OCP\Files\NotFoundException')) {
120
+		if (is_a($exception, '\OCP\Files\NotFoundException')) {
121 121
 			return new NotFoundResponse();
122 122
 		}
123 123
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	private function isSharingEnabled() {
155 155
 		// FIXME: This check is done here since the route is globally defined and not inside the files_sharing app
156 156
 		// Check whether the sharing application is enabled
157
-		if(!$this->appManager->isEnabledForUser($this->appName)) {
157
+		if (!$this->appManager->isEnabledForUser($this->appName)) {
158 158
 			return false;
159 159
 		}
160 160
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 		}
173 173
 
174 174
 		// Check whether public sharing is enabled
175
-		if($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
175
+		if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') {
176 176
 			return false;
177 177
 		}
178 178
 
Please login to merge, or discard this patch.
apps/files_sharing/lib/ShareBackend/File.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	 */
97 97
 	public function generateTarget($filePath, $shareWith, $exclude = null) {
98 98
 		$shareFolder = \OCA\Files_Sharing\Helper::getShareFolder();
99
-		$target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($filePath));
99
+		$target = \OC\Files\Filesystem::normalizePath($shareFolder.'/'.basename($filePath));
100 100
 
101 101
 		// for group shares we return the target right away
102 102
 		if ($shareWith === false) {
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
 		}
105 105
 
106 106
 		\OC\Files\Filesystem::initMountPoints($shareWith);
107
-		$view = new \OC\Files\View('/' . $shareWith . '/files');
107
+		$view = new \OC\Files\View('/'.$shareWith.'/files');
108 108
 
109 109
 		if (!$view->is_dir($shareFolder)) {
110 110
 			$dir = '';
111 111
 			$subdirs = explode('/', $shareFolder);
112 112
 			foreach ($subdirs as $subdir) {
113
-				$dir = $dir . '/' . $subdir;
113
+				$dir = $dir.'/'.$subdir;
114 114
 				if (!$view->is_dir($dir)) {
115 115
 					$view->mkdir($dir);
116 116
 				}
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 		if ($share['item_type'] === 'folder' && $target !== '') {
238 238
 			// note: in case of ext storage mount points the path might be empty
239 239
 			// which would cause a leading slash to appear
240
-			$share['path'] = ltrim($share['path'] . '/' . $target, '/');
240
+			$share['path'] = ltrim($share['path'].'/'.$target, '/');
241 241
 		}
242 242
 		return self::resolveReshares($share);
243 243
 	}
Please login to merge, or discard this patch.
apps/files_sharing/public.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 $token = isset($_GET['t']) ? $_GET['t'] : '';
28 28
 $route = isset($_GET['download']) ? 'files_sharing.sharecontroller.downloadShare' : 'files_sharing.sharecontroller.showShare';
29 29
 
30
-if($token !== '') {
30
+if ($token !== '') {
31 31
 	OC_Response::redirect($urlGenerator->linkToRoute($route, array('token' => $token)));
32 32
 } else {
33 33
 	header('HTTP/1.0 404 Not Found');
Please login to merge, or discard this patch.
apps/provisioning_api/lib/Controller/AppsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 	public function getApps($filter = null) {
60 60
 		$apps = (new OC_App())->listAllApps();
61 61
 		$list = [];
62
-		foreach($apps as $app) {
62
+		foreach ($apps as $app) {
63 63
 			$list[] = $app['id'];
64 64
 		}
65
-		if($filter){
66
-			switch($filter){
65
+		if ($filter) {
66
+			switch ($filter) {
67 67
 				case 'enabled':
68 68
 					return new DataResponse(['apps' => \OC_App::getEnabledApps()]);
69 69
 					break;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function getAppInfo($app) {
90 90
 		$info = \OCP\App::getAppInfo($app);
91
-		if(!is_null($info)) {
91
+		if (!is_null($info)) {
92 92
 			return new DataResponse(OC_App::getAppInfo($app));
93 93
 		} else {
94 94
 			throw new OCSException('The request app was not found', \OCP\API::RESPOND_NOT_FOUND);
Please login to merge, or discard this patch.
apps/provisioning_api/lib/Controller/GroupsController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -72,10 +72,10 @@  discard block
 block discarded – undo
72 72
 	 */
73 73
 	public function getGroups($search = '', $limit = null, $offset = null) {
74 74
 		if ($limit !== null) {
75
-			$limit = (int)$limit;
75
+			$limit = (int) $limit;
76 76
 		}
77 77
 		if ($offset !== null) {
78
-			$offset = (int)$offset;
78
+			$offset = (int) $offset;
79 79
 		}
80 80
 
81 81
 		$groups = $this->groupManager->search($search, $limit, $offset);
@@ -100,21 +100,21 @@  discard block
 block discarded – undo
100 100
 		$user = $this->userSession->getUser();
101 101
 
102 102
 		// Check the group exists
103
-		if(!$this->groupManager->groupExists($groupId)) {
103
+		if (!$this->groupManager->groupExists($groupId)) {
104 104
 			throw new OCSException('The requested group could not be found', \OCP\API::RESPOND_NOT_FOUND);
105 105
 		}
106 106
 
107 107
 		$isSubadminOfGroup = false;
108 108
 		$group = $this->groupManager->get($groupId);
109 109
 		if ($group !== null) {
110
-			$isSubadminOfGroup =$this->groupManager->getSubAdmin()->isSubAdminofGroup($user, $group);
110
+			$isSubadminOfGroup = $this->groupManager->getSubAdmin()->isSubAdminofGroup($user, $group);
111 111
 		}
112 112
 
113 113
 		// Check subadmin has access to this group
114
-		if($this->groupManager->isAdmin($user->getUID())
114
+		if ($this->groupManager->isAdmin($user->getUID())
115 115
 		   || $isSubadminOfGroup) {
116 116
 			$users = $this->groupManager->get($groupId)->getUsers();
117
-			$users =  array_map(function($user) {
117
+			$users = array_map(function($user) {
118 118
 				/** @var IUser $user */
119 119
 				return $user->getUID();
120 120
 			}, $users);
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
 	 */
137 137
 	public function addGroup($groupid) {
138 138
 		// Validate name
139
-		if(empty($groupid)){
139
+		if (empty($groupid)) {
140 140
 			\OCP\Util::writeLog('provisioning_api', 'Group name not supplied', \OCP\Util::ERROR);
141 141
 			throw new OCSException('Invalid group name', 101);
142 142
 		}
143 143
 		// Check if it exists
144
-		if($this->groupManager->groupExists($groupid)){
144
+		if ($this->groupManager->groupExists($groupid)) {
145 145
 			throw new OCSException('', 102);
146 146
 		}
147 147
 		$this->groupManager->createGroup($groupid);
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 	 */
158 158
 	public function deleteGroup($groupId) {
159 159
 		// Check it exists
160
-		if(!$this->groupManager->groupExists($groupId)){
160
+		if (!$this->groupManager->groupExists($groupId)) {
161 161
 			throw new OCSException('', 101);
162
-		} else if($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()){
162
+		} else if ($groupId === 'admin' || !$this->groupManager->get($groupId)->delete()) {
163 163
 			// Cannot delete admin group
164 164
 			throw new OCSException('', 102);
165 165
 		}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 	public function getSubAdminsOfGroup($groupId) {
176 176
 		// Check group exists
177 177
 		$targetGroup = $this->groupManager->get($groupId);
178
-		if($targetGroup === null) {
178
+		if ($targetGroup === null) {
179 179
 			throw new OCSException('Group does not exist', 101);
180 180
 		}
181 181
 
Please login to merge, or discard this patch.
apps/updatenotification/templates/admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	$currentChannel = $_['currentChannel'];
15 15
 ?>
16 16
 <form id="oca_updatenotification_section" class="followupsection">
17
-	<?php if($isNewVersionAvailable === true) { ?>
17
+	<?php if ($isNewVersionAvailable === true) { ?>
18 18
 		<strong><?php p($l->t('A new version is available: %s', [$newVersionString])); ?></strong>
19 19
 		<?php if ($_['updaterEnabled']) { ?>
20 20
 			<input type="button" id="oca_updatenotification_button" value="<?php p($l->t('Open updater')) ?>">
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		<label for="release-channel"><?php p($l->t('Update channel:')) ?></label>
32 32
 		<select id="release-channel">
33 33
 			<option value="<?php p($currentChannel); ?>"><?php p($currentChannel); ?></option>
34
-			<?php foreach ($channels as $channel => $channelTitle){ ?>
34
+			<?php foreach ($channels as $channel => $channelTitle) { ?>
35 35
 				<option value="<?php p($channelTitle) ?>">
36 36
 					<?php p($channelTitle) ?>
37 37
 				</option>
Please login to merge, or discard this patch.