Completed
Pull Request — master (#4303)
by Björn
26:25
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   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -321,11 +321,11 @@  discard block
 block discarded – undo
321 321
 				$share->getSharedWith()
322 322
 			);
323 323
 		} catch (HintException $hintException) {
324
-			$this->logger->error('Failed to send share by mail: ' . $hintException->getMessage());
324
+			$this->logger->error('Failed to send share by mail: '.$hintException->getMessage());
325 325
 			$this->removeShareFromTable($shareId);
326 326
 			throw $hintException;
327 327
 		} catch (\Exception $e) {
328
-			$this->logger->error('Failed to send share by mail: ' . $e->getMessage());
328
+			$this->logger->error('Failed to send share by mail: '.$e->getMessage());
329 329
 			$this->removeShareFromTable($shareId);
330 330
 			throw new HintException('Failed to send share by mail',
331 331
 				$this->l->t('Failed to send share by E-mail'));
@@ -354,9 +354,9 @@  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
 		if ($owner === $initiator) {
357
-			$subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename));
357
+			$subject = (string) $this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename));
358 358
 		} else {
359
-			$subject = (string)$this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName));
359
+			$subject = (string) $this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName));
360 360
 		}
361 361
 
362 362
 		$message = $this->mailer->createMessage();
@@ -368,10 +368,10 @@  discard block
 block discarded – undo
368 368
 		if ($owner === $initiator) {
369 369
 			$text = $this->l->t('%s shared »%s« with you.', [$ownerDisplayName, $filename]);
370 370
 		} else {
371
-			$text= $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]);
371
+			$text = $this->l->t('%s shared »%s« with you on behalf of %s.', [$ownerDisplayName, $filename, $initiator]);
372 372
 		}
373 373
 		$emailTemplate->addBodyText(
374
-			$text . ' ' . $this->l->t('Click the button below to open it.'),
374
+			$text.' '.$this->l->t('Click the button below to open it.'),
375 375
 			$text
376 376
 		);
377 377
 		$emailTemplate->addBodyButton(
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 		// The "Reply-To" is set to the sharer if an mail address is configured
401 401
 		// also the default footer contains a "Do not reply" which needs to be adjusted.
402 402
 		$ownerEmail = $ownerUser->getEMailAddress();
403
-		if($ownerEmail !== null) {
403
+		if ($ownerEmail !== null) {
404 404
 			$message->setReplyTo([$ownerEmail => $ownerDisplayName]);
405
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
405
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
406 406
 		} else {
407 407
 			$emailTemplate->addFooter();
408 408
 		}
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 		$initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator;
435 435
 		$initiatorEmailAddress = ($initiatorUser instanceof IUser) ? $initiatorUser->getEMailAddress() : null;
436 436
 
437
-		$subject = (string)$this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
437
+		$subject = (string) $this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]);
438 438
 		$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]);
439 439
 		$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]);
440 440
 
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
 			);
485 485
 		}
486 486
 
487
-		$subject = (string)$this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]);
487
+		$subject = (string) $this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]);
488 488
 		$bodyPart = $this->l->t("You just shared »%s« with %s. The share was already send to the recipient. Due to the security policies defined by the administrator of %s each share needs to be protected by password and it is not allowed to send the password directly to the recipient. Therefore you need to forward the password manually to the recipient.", [$filename, $shareWith, $this->defaults->getName()]);
489 489
 
490 490
 		$message = $this->mailer->createMessage();
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 	 */
519 519
 	protected function generateToken($size = 15) {
520 520
 		$token = $this->secureRandom->generate(
521
-			$size, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS);
521
+			$size, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS);
522 522
 		return $token;
523 523
 	}
524 524
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 			->orderBy('id');
540 540
 
541 541
 		$cursor = $qb->execute();
542
-		while($data = $cursor->fetch()) {
542
+		while ($data = $cursor->fetch()) {
543 543
 			$children[] = $this->createShareObject($data);
544 544
 		}
545 545
 		$cursor->closeCursor();
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 		$qb->execute();
584 584
 		$id = $qb->getLastInsertId();
585 585
 
586
-		return (int)$id;
586
+		return (int) $id;
587 587
 	}
588 588
 
589 589
 	/**
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 		// a real password was given
601 601
 		$validPassword = $plainTextPassword !== null && $plainTextPassword !== '';
602 602
 
603
-		if($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
603
+		if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
604 604
 			$this->sendPassword($share, $plainTextPassword);
605 605
 		}
606 606
 		/*
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 
695 695
 		$cursor = $qb->execute();
696 696
 		$shares = [];
697
-		while($data = $cursor->fetch()) {
697
+		while ($data = $cursor->fetch()) {
698 698
 			$shares[] = $this->createShareObject($data);
699 699
 		}
700 700
 		$cursor->closeCursor();
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 			->execute();
747 747
 
748 748
 		$shares = [];
749
-		while($data = $cursor->fetch()) {
749
+		while ($data = $cursor->fetch()) {
750 750
 			$shares[] = $this->createShareObject($data);
751 751
 		}
752 752
 		$cursor->closeCursor();
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
 		$cursor = $qb->execute();
787 787
 
788
-		while($data = $cursor->fetch()) {
788
+		while ($data = $cursor->fetch()) {
789 789
 			$shares[] = $this->createShareObject($data);
790 790
 		}
791 791
 		$cursor->closeCursor();
@@ -848,15 +848,15 @@  discard block
 block discarded – undo
848 848
 	protected function createShareObject($data) {
849 849
 
850 850
 		$share = new Share($this->rootFolder, $this->userManager);
851
-		$share->setId((int)$data['id'])
852
-			->setShareType((int)$data['share_type'])
853
-			->setPermissions((int)$data['permissions'])
851
+		$share->setId((int) $data['id'])
852
+			->setShareType((int) $data['share_type'])
853
+			->setPermissions((int) $data['permissions'])
854 854
 			->setTarget($data['file_target'])
855
-			->setMailSend((bool)$data['mail_send'])
855
+			->setMailSend((bool) $data['mail_send'])
856 856
 			->setToken($data['token']);
857 857
 
858 858
 		$shareTime = new \DateTime();
859
-		$shareTime->setTimestamp((int)$data['stime']);
859
+		$shareTime->setTimestamp((int) $data['stime']);
860 860
 		$share->setShareTime($shareTime);
861 861
 		$share->setSharedWith($data['share_with']);
862 862
 		$share->setPassword($data['password']);
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 		} else {
868 868
 			//OLD SHARE
869 869
 			$share->setSharedBy($data['uid_owner']);
870
-			$path = $this->getNode($share->getSharedBy(), (int)$data['file_source']);
870
+			$path = $this->getNode($share->getSharedBy(), (int) $data['file_source']);
871 871
 
872 872
 			$owner = $path->getOwner();
873 873
 			$share->setShareOwner($owner->getUID());
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
 			}
881 881
 		}
882 882
 
883
-		$share->setNodeId((int)$data['file_source']);
883
+		$share->setNodeId((int) $data['file_source']);
884 884
 		$share->setNodeType($data['item_type']);
885 885
 
886 886
 		$share->setProviderId($this->identifier());
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
 			);
1000 1000
 		}
1001 1001
 
1002
-		$qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
1002
+		$qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid'));
1003 1003
 		$qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId())));
1004 1004
 
1005 1005
 		$qb->orderBy('id');
Please login to merge, or discard this patch.