Completed
Pull Request — master (#4303)
by Björn
11:34 queued 20s
created
apps/sharebymail/lib/ShareByMailProvider.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -279,11 +279,11 @@  discard block
 block discarded – undo
279 279
 				$share->getShareOwner(),
280 280
 				$share->getSharedBy(), $share->getSharedWith());
281 281
 		} catch (HintException $hintException) {
282
-			$this->logger->error('Failed to send share by mail: ' . $hintException->getMessage());
282
+			$this->logger->error('Failed to send share by mail: '.$hintException->getMessage());
283 283
 			$this->removeShareFromTable($shareId);
284 284
 			throw $hintException;
285 285
 		} catch (\Exception $e) {
286
-			$this->logger->error('Failed to send share by mail: ' . $e->getMessage());
286
+			$this->logger->error('Failed to send share by mail: '.$e->getMessage());
287 287
 			$this->removeShareFromTable($shareId);
288 288
 			throw new HintException('Failed to send share by mail',
289 289
 				$this->l->t('Failed to send share by E-mail'));
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
301 301
 		$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null;
302 302
 		if ($owner === $initiator) {
303
-			$subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename));
303
+			$subject = (string) $this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename));
304 304
 		} else {
305
-			$subject = (string)$this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName));
305
+			$subject = (string) $this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName));
306 306
 		}
307 307
 
308 308
 		$message = $this->mailer->createMessage();
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
 	protected function createMailBody($template, $filename, $link, $owner, $initiator) {
333 333
 
334 334
 		$mailBodyTemplate = new Template('sharebymail', $template, '');
335
-		$mailBodyTemplate->assign ('filename', \OCP\Util::sanitizeHTML($filename));
336
-		$mailBodyTemplate->assign ('link', $link);
337
-		$mailBodyTemplate->assign ('owner', \OCP\Util::sanitizeHTML($owner));
338
-		$mailBodyTemplate->assign ('initiator', \OCP\Util::sanitizeHTML($initiator));
339
-		$mailBodyTemplate->assign ('onBehalfOf', $initiator !== $owner);
335
+		$mailBodyTemplate->assign('filename', \OCP\Util::sanitizeHTML($filename));
336
+		$mailBodyTemplate->assign('link', $link);
337
+		$mailBodyTemplate->assign('owner', \OCP\Util::sanitizeHTML($owner));
338
+		$mailBodyTemplate->assign('initiator', \OCP\Util::sanitizeHTML($initiator));
339
+		$mailBodyTemplate->assign('onBehalfOf', $initiator !== $owner);
340 340
 		$mailBody = $mailBodyTemplate->fetchPage();
341 341
 
342 342
 		if (is_string($mailBody)) {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 		$initiatorUser = $this->userManager->get($initiator);
366 366
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
367 367
 		$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null;
368
-		$subject = (string)$this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
368
+		$subject = (string) $this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
369 369
 
370 370
 		$message = $this->mailer->createMessage();
371 371
 		$arguments = ['filename' => $filename, 'initiator' => $initiator, 'password' => $password];
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		$initiatorUser = $this->userManager->get($initiator);
399 399
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
400 400
 		$initiatorEMailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null;
401
-		$initiatorFullMail = $initiatorDisplayName . '<' . $initiatorEMailAddress . '>';
401
+		$initiatorFullMail = $initiatorDisplayName.'<'.$initiatorEMailAddress.'>';
402 402
 
403 403
 		if ($initiatorEMailAddress === null) {
404 404
 			throw new \Exception(
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 			);
407 407
 		}
408 408
 
409
-		$subject = (string)$this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]);
409
+		$subject = (string) $this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]);
410 410
 
411 411
 		$message = $this->mailer->createMessage();
412 412
 		$arguments = ['filename' => $filename, 'recipient' => $shareWith, 'password' => $password];
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		$mailBodyTemplate = new Template('sharebymail', $template, '');
438 438
 
439 439
 		foreach ($arguments as $key => $value) {
440
-			$mailBodyTemplate->assign ($key, \OCP\Util::sanitizeHTML($value));
440
+			$mailBodyTemplate->assign($key, \OCP\Util::sanitizeHTML($value));
441 441
 		}
442 442
 
443 443
 		$mailBody = $mailBodyTemplate->fetchPage();
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
 	 */
459 459
 	protected function generateToken($size = 15) {
460 460
 		$token = $this->secureRandom->generate(
461
-			$size, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS);
461
+			$size, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS);
462 462
 		return $token;
463 463
 	}
464 464
 
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
 			->orderBy('id');
480 480
 
481 481
 		$cursor = $qb->execute();
482
-		while($data = $cursor->fetch()) {
482
+		while ($data = $cursor->fetch()) {
483 483
 			$children[] = $this->createShareObject($data);
484 484
 		}
485 485
 		$cursor->closeCursor();
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 		$qb->execute();
524 524
 		$id = $qb->getLastInsertId();
525 525
 
526
-		return (int)$id;
526
+		return (int) $id;
527 527
 	}
528 528
 
529 529
 	/**
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
 		// a real password was given
541 541
 		$validPassword = $plainTextPassword !== null && $plainTextPassword !== '';
542 542
 
543
-		if($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
543
+		if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
544 544
 			$this->sendPassword($share->getNode()->getName(), $share->getSharedBy(), $share->getSharedWith(), $plainTextPassword);
545 545
 		}
546 546
 		/*
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 
635 635
 		$cursor = $qb->execute();
636 636
 		$shares = [];
637
-		while($data = $cursor->fetch()) {
637
+		while ($data = $cursor->fetch()) {
638 638
 			$shares[] = $this->createShareObject($data);
639 639
 		}
640 640
 		$cursor->closeCursor();
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 			->execute();
687 687
 
688 688
 		$shares = [];
689
-		while($data = $cursor->fetch()) {
689
+		while ($data = $cursor->fetch()) {
690 690
 			$shares[] = $this->createShareObject($data);
691 691
 		}
692 692
 		$cursor->closeCursor();
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 
726 726
 		$cursor = $qb->execute();
727 727
 
728
-		while($data = $cursor->fetch()) {
728
+		while ($data = $cursor->fetch()) {
729 729
 			$shares[] = $this->createShareObject($data);
730 730
 		}
731 731
 		$cursor->closeCursor();
@@ -788,15 +788,15 @@  discard block
 block discarded – undo
788 788
 	protected function createShareObject($data) {
789 789
 
790 790
 		$share = new Share($this->rootFolder, $this->userManager);
791
-		$share->setId((int)$data['id'])
792
-			->setShareType((int)$data['share_type'])
793
-			->setPermissions((int)$data['permissions'])
791
+		$share->setId((int) $data['id'])
792
+			->setShareType((int) $data['share_type'])
793
+			->setPermissions((int) $data['permissions'])
794 794
 			->setTarget($data['file_target'])
795
-			->setMailSend((bool)$data['mail_send'])
795
+			->setMailSend((bool) $data['mail_send'])
796 796
 			->setToken($data['token']);
797 797
 
798 798
 		$shareTime = new \DateTime();
799
-		$shareTime->setTimestamp((int)$data['stime']);
799
+		$shareTime->setTimestamp((int) $data['stime']);
800 800
 		$share->setShareTime($shareTime);
801 801
 		$share->setSharedWith($data['share_with']);
802 802
 		$share->setPassword($data['password']);
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
 		} else {
808 808
 			//OLD SHARE
809 809
 			$share->setSharedBy($data['uid_owner']);
810
-			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
810
+			$path = $this->getNode($share->getSharedBy(), (int) $data['file_source']);
811 811
 
812 812
 			$owner = $path->getOwner();
813 813
 			$share->setShareOwner($owner->getUID());
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 			}
821 821
 		}
822 822
 
823
-		$share->setNodeId((int)$data['file_source']);
823
+		$share->setNodeId((int) $data['file_source']);
824 824
 		$share->setNodeType($data['item_type']);
825 825
 
826 826
 		$share->setProviderId($this->identifier());
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 			);
940 940
 		}
941 941
 
942
-		$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
942
+		$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
943 943
 		$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
944 944
 
945 945
 		$qb->orderBy('id');
Please login to merge, or discard this patch.
apps/sharebymail/templates/settings-admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 	<em><?php p($l->t('Send a personalized link to a file or folder by mail.')); ?></em>
12 12
 
13 13
 	<p>
14
-		<input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> />
14
+		<input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> />
15 15
 		<label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/>
16
-		<input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> />
16
+		<input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> />
17 17
 		<label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label>
18 18
 	</p>
19 19
 
Please login to merge, or discard this patch.
apps/sharebymail/templates/mailpasswordowner.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	<tr><td>
28 28
 			<table cellspacing="0" cellpadding="0" border="0" width="600px">
29 29
 				<tr>
30
-					<td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>">
30
+					<td colspan="2" bgcolor="<?php p($theme->getColorPrimary()); ?>">
31 31
 						<img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/>
32 32
 					</td>
33 33
 				</tr>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 					<td style="font-weight:normal; font-size:0.8em; line-height:1.2em; font-family:verdana,'arial',sans;">--<br>
53 53
 						<?php p($theme->getName()); ?> -
54 54
 						<?php p($theme->getSlogan()); ?>
55
-						<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl());?></a>
55
+						<br><a href="<?php p($theme->getBaseUrl()); ?>"><?php p($theme->getBaseUrl()); ?></a>
56 56
 					</td>
57 57
 				</tr>
58 58
 				<tr>
Please login to merge, or discard this patch.
apps/sharebymail/templates/altmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,5 +32,5 @@
 block discarded – undo
32 32
 ?>
33 33
 
34 34
 <?php print_unescaped("-- \n"); ?>
35
-<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
35
+<?php p($theme->getName().' - '.$theme->getSlogan()); ?>
36 36
 <?php print_unescaped("\n".$theme->getBaseUrl());
Please login to merge, or discard this patch.
apps/sharebymail/templates/altmailpassword.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 ?>
29 29
 
30 30
 <?php print_unescaped("-- \n"); ?>
31
-<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
31
+<?php p($theme->getName().' - '.$theme->getSlogan()); ?>
32 32
 <?php print_unescaped("\n".$theme->getBaseUrl());
Please login to merge, or discard this patch.
apps/sharebymail/templates/altmailpasswordowner.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 ?>
29 29
 
30 30
 <?php print_unescaped("-- \n"); ?>
31
-<?php p($theme->getName() . ' - ' . $theme->getSlogan()); ?>
31
+<?php p($theme->getName().' - '.$theme->getSlogan()); ?>
32 32
 <?php print_unescaped("\n".$theme->getBaseUrl());
Please login to merge, or discard this patch.