Passed
Push — master ( 37782b...410bd9 )
by Morris
15:37
created
lib/private/Encryption/DecryptAll.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 		$this->output = $output;
87 87
 
88 88
 		if ($user !== '' && $this->userManager->userExists($user) === false) {
89
-			$this->output->writeln('User "' . $user . '" does not exist. Please check the username and try again');
89
+			$this->output->writeln('User "'.$user.'" does not exist. Please check the username and try again');
90 90
 			return false;
91 91
 		}
92 92
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 			$this->output->writeln('Files for following users couldn\'t be decrypted, ');
105 105
 			$this->output->writeln('maybe the user is not set up in a way that supports this operation: ');
106 106
 			foreach ($this->failed as $uid => $paths) {
107
-				$this->output->writeln('    ' . $uid);
107
+				$this->output->writeln('    '.$uid);
108 108
 			}
109 109
 			$this->output->writeln('');
110 110
 		}
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
 			/** @var IEncryptionModule $module */
126 126
 			$module = call_user_func($moduleDesc['callback']);
127 127
 			$this->output->writeln('');
128
-			$this->output->writeln('Prepare "' . $module->getDisplayName() . '"');
128
+			$this->output->writeln('Prepare "'.$module->getDisplayName().'"');
129 129
 			$this->output->writeln('');
130 130
 			if ($module->prepareDecryptAll($this->input, $this->output, $user) === false) {
131
-				$this->output->writeln('Module "' . $moduleDesc['displayName'] . '" does not support the functionality to decrypt all files again or the initialization of the module failed!');
131
+				$this->output->writeln('Module "'.$moduleDesc['displayName'].'" does not support the functionality to decrypt all files again or the initialization of the module failed!');
132 132
 				return false;
133 133
 			}
134 134
 		}
@@ -206,16 +206,16 @@  discard block
 block discarded – undo
206 206
 
207 207
 		$this->setupUserFS($uid);
208 208
 		$directories = array();
209
-		$directories[] = '/' . $uid . '/files';
209
+		$directories[] = '/'.$uid.'/files';
210 210
 
211 211
 		while ($root = array_pop($directories)) {
212 212
 			$content = $this->rootView->getDirectoryContent($root);
213 213
 			foreach ($content as $file) {
214 214
 				// only decrypt files owned by the user
215
-				if($file->getStorage()->instanceOfStorage('OCA\Files_Sharing\SharedStorage')) {
215
+				if ($file->getStorage()->instanceOfStorage('OCA\Files_Sharing\SharedStorage')) {
216 216
 					continue;
217 217
 				}
218
-				$path = $root . '/' . $file['name'];
218
+				$path = $root.'/'.$file['name'];
219 219
 				if ($this->rootView->is_dir($path)) {
220 220
 					$directories[] = $path;
221 221
 					continue;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		}
260 260
 
261 261
 		$source = $path;
262
-		$target = $path . '.decrypted.' . $this->getTimestamp();
262
+		$target = $path.'.decrypted.'.$this->getTimestamp();
263 263
 
264 264
 		try {
265 265
 			$this->rootView->copy($source, $target);
Please login to merge, or discard this patch.
apps/encryption/lib/Crypto/EncryptAll.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$this->input = $input;
135 135
 		$this->output = $output;
136 136
 
137
-		$headline = 'Encrypt all files with the ' . Encryption::DISPLAY_NAME;
137
+		$headline = 'Encrypt all files with the '.Encryption::DISPLAY_NAME;
138 138
 		$this->output->writeln("\n");
139 139
 		$this->output->writeln($headline);
140 140
 		$this->output->writeln(str_pad('', strlen($headline), '='));
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 		$progress->setFormat(" %message% \n [%bar%]");
184 184
 		$progress->start();
185 185
 
186
-		foreach($this->userManager->getBackends() as $backend) {
186
+		foreach ($this->userManager->getBackends() as $backend) {
187 187
 			$limit = 500;
188 188
 			$offset = 0;
189 189
 			do {
190 190
 				$users = $backend->getUsers('', $limit, $offset);
191 191
 				foreach ($users as $user) {
192 192
 					if ($this->keyManager->userHasKeys($user) === false) {
193
-						$progress->setMessage('Create key-pair for ' . $user);
193
+						$progress->setMessage('Create key-pair for '.$user);
194 194
 						$progress->advance();
195 195
 						$this->setupUserFS($user);
196 196
 						$password = $this->generateOneTimePassword($user);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 					}
203 203
 				}
204 204
 				$offset += $limit;
205
-			} while(count($users) >= $limit);
205
+			} while (count($users) >= $limit);
206 206
 		}
207 207
 
208 208
 		$progress->setMessage('Key-pair created for all users');
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 */
241 241
 	protected function encryptAllUserFilesWithMasterKey(ProgressBar $progress) {
242 242
 		$userNo = 1;
243
-		foreach($this->userManager->getBackends() as $backend) {
243
+		foreach ($this->userManager->getBackends() as $backend) {
244 244
 			$limit = 500;
245 245
 			$offset = 0;
246 246
 			do {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 					$userNo++;
252 252
 				}
253 253
 				$offset += $limit;
254
-			} while(count($users) >= $limit);
254
+			} while (count($users) >= $limit);
255 255
 		}
256 256
 	}
257 257
 
@@ -266,19 +266,19 @@  discard block
 block discarded – undo
266 266
 
267 267
 		$this->setupUserFS($uid);
268 268
 		$directories = array();
269
-		$directories[] =  '/' . $uid . '/files';
269
+		$directories[] = '/'.$uid.'/files';
270 270
 
271
-		while($root = array_pop($directories)) {
271
+		while ($root = array_pop($directories)) {
272 272
 			$content = $this->rootView->getDirectoryContent($root);
273 273
 			foreach ($content as $file) {
274
-				$path = $root . '/' . $file['name'];
274
+				$path = $root.'/'.$file['name'];
275 275
 				if ($this->rootView->is_dir($path)) {
276 276
 					$directories[] = $path;
277 277
 					continue;
278 278
 				} else {
279 279
 					$progress->setMessage("encrypt files for user $userCount: $path");
280 280
 					$progress->advance();
281
-					if($this->encryptFile($path) === false) {
281
+					if ($this->encryptFile($path) === false) {
282 282
 						$progress->setMessage("encrypt files for user $userCount: $path (already encrypted)");
283 283
 						$progress->advance();
284 284
 					}
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 		}
303 303
 
304 304
 		$source = $path;
305
-		$target = $path . '.encrypted.' . time();
305
+		$target = $path.'.encrypted.'.time();
306 306
 
307 307
 		try {
308 308
 			$this->rootView->copy($source, $target);
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 					continue;
425 425
 				}
426 426
 
427
-				$subject = (string)$this->l->t('one-time password for server-side-encryption');
427
+				$subject = (string) $this->l->t('one-time password for server-side-encryption');
428 428
 				list($htmlBody, $textBody) = $this->createMailBody($password);
429 429
 
430 430
 				// send it out now
@@ -472,11 +472,11 @@  discard block
 block discarded – undo
472 472
 	protected function createMailBody($password) {
473 473
 
474 474
 		$html = new \OC_Template("encryption", "mail", "");
475
-		$html->assign ('password', $password);
475
+		$html->assign('password', $password);
476 476
 		$htmlMail = $html->fetchPage();
477 477
 
478 478
 		$plainText = new \OC_Template("encryption", "altmail", "");
479
-		$plainText->assign ('password', $password);
479
+		$plainText->assign('password', $password);
480 480
 		$plainTextMail = $plainText->fetchPage();
481 481
 
482 482
 		return [$htmlMail, $plainTextMail];
Please login to merge, or discard this patch.