Completed
Pull Request — master (#4303)
by Björn
35:10 queued 22:04
created
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/lib/ShareByMailProvider.php 1 patch
Spacing   +23 added lines, -23 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();
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
 		if ($owner === $initiator) {
315 315
 			$text = $this->l->t('%s shared »%s« with you.', [$ownerDisplayName, $filename]);
316 316
 		} else {
317
-			$text= $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]);
317
+			$text = $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]);
318 318
 		}
319 319
 		$emailTemplate->addBodyText(
320
-			$text . ' ' . $this->l->t('Click the button below to open it.'),
320
+			$text.' '.$this->l->t('Click the button below to open it.'),
321 321
 			$text
322 322
 		);
323 323
 		$emailTemplate->addBodyButton(
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
355 355
 		$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null;
356 356
 
357
-		$subject = (string)$this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
357
+		$subject = (string) $this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
358 358
 		$plainBodyPart = $this->l->t("%s shared »%s« with you.\nYou should have already received a separate mail with a link to access it.\n", [$initiatorDisplayName, $filename]);
359 359
 		$htmlBodyPart = $this->l->t('%s shared »%s« with you. You should have already received a separate mail with a link to access it.', [$initiatorDisplayName, $filename]);
360 360
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 			);
402 402
 		}
403 403
 
404
-		$subject = (string)$this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]);
404
+		$subject = (string) $this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]);
405 405
 		$plainBodyPart = $this->l->t("You just shared »%s« with %s.\nThe share was already send to the recipient. Due to the security policies\neach share needs to be protected by password and it is not allowed to send the\npassword directly by mail to the recipient. Therefore you need to forward\nthe password manually to the recipient.", [$filename, $shareWith]);
406 406
 		$htmlBodyPart = $this->l->t('You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies each share needs to be protected by password and it is not allowed to send the password directly by mail to the recipient. Therefore you need to forward the password manually to the recipient.', [$filename, $shareWith]);
407 407
 
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 	 */
433 433
 	protected function generateToken($size = 15) {
434 434
 		$token = $this->secureRandom->generate(
435
-			$size, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS);
435
+			$size, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS);
436 436
 		return $token;
437 437
 	}
438 438
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 			->orderBy('id');
454 454
 
455 455
 		$cursor = $qb->execute();
456
-		while($data = $cursor->fetch()) {
456
+		while ($data = $cursor->fetch()) {
457 457
 			$children[] = $this->createShareObject($data);
458 458
 		}
459 459
 		$cursor->closeCursor();
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 		$qb->execute();
498 498
 		$id = $qb->getLastInsertId();
499 499
 
500
-		return (int)$id;
500
+		return (int) $id;
501 501
 	}
502 502
 
503 503
 	/**
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 		// a real password was given
515 515
 		$validPassword = $plainTextPassword !== null && $plainTextPassword !== '';
516 516
 
517
-		if($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
517
+		if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
518 518
 			$this->sendPassword($share->getNode()->getName(), $share->getSharedBy(), $share->getSharedWith(), $plainTextPassword);
519 519
 		}
520 520
 		/*
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 
609 609
 		$cursor = $qb->execute();
610 610
 		$shares = [];
611
-		while($data = $cursor->fetch()) {
611
+		while ($data = $cursor->fetch()) {
612 612
 			$shares[] = $this->createShareObject($data);
613 613
 		}
614 614
 		$cursor->closeCursor();
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
 			->execute();
661 661
 
662 662
 		$shares = [];
663
-		while($data = $cursor->fetch()) {
663
+		while ($data = $cursor->fetch()) {
664 664
 			$shares[] = $this->createShareObject($data);
665 665
 		}
666 666
 		$cursor->closeCursor();
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 
700 700
 		$cursor = $qb->execute();
701 701
 
702
-		while($data = $cursor->fetch()) {
702
+		while ($data = $cursor->fetch()) {
703 703
 			$shares[] = $this->createShareObject($data);
704 704
 		}
705 705
 		$cursor->closeCursor();
@@ -762,15 +762,15 @@  discard block
 block discarded – undo
762 762
 	protected function createShareObject($data) {
763 763
 
764 764
 		$share = new Share($this->rootFolder, $this->userManager);
765
-		$share->setId((int)$data['id'])
766
-			->setShareType((int)$data['share_type'])
767
-			->setPermissions((int)$data['permissions'])
765
+		$share->setId((int) $data['id'])
766
+			->setShareType((int) $data['share_type'])
767
+			->setPermissions((int) $data['permissions'])
768 768
 			->setTarget($data['file_target'])
769
-			->setMailSend((bool)$data['mail_send'])
769
+			->setMailSend((bool) $data['mail_send'])
770 770
 			->setToken($data['token']);
771 771
 
772 772
 		$shareTime = new \DateTime();
773
-		$shareTime->setTimestamp((int)$data['stime']);
773
+		$shareTime->setTimestamp((int) $data['stime']);
774 774
 		$share->setShareTime($shareTime);
775 775
 		$share->setSharedWith($data['share_with']);
776 776
 		$share->setPassword($data['password']);
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 		} else {
782 782
 			//OLD SHARE
783 783
 			$share->setSharedBy($data['uid_owner']);
784
-			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
784
+			$path = $this->getNode($share->getSharedBy(), (int) $data['file_source']);
785 785
 
786 786
 			$owner = $path->getOwner();
787 787
 			$share->setShareOwner($owner->getUID());
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 			}
795 795
 		}
796 796
 
797
-		$share->setNodeId((int)$data['file_source']);
797
+		$share->setNodeId((int) $data['file_source']);
798 798
 		$share->setNodeType($data['item_type']);
799 799
 
800 800
 		$share->setProviderId($this->identifier());
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
 			);
914 914
 		}
915 915
 
916
-		$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
916
+		$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
917 917
 		$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
918 918
 
919 919
 		$qb->orderBy('id');
Please login to merge, or discard this patch.