@@ -11,9 +11,9 @@ |
||
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 |
@@ -27,7 +27,7 @@ discard block |
||
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 |
||
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> |
@@ -32,5 +32,5 @@ |
||
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()); |
@@ -32,5 +32,5 @@ |
||
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()); |
@@ -32,5 +32,5 @@ |
||
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()); |
@@ -279,11 +279,11 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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]; |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | ); |
406 | 406 | } |
407 | 407 | |
408 | - $subject = (string)$this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]); |
|
408 | + $subject = (string) $this->l->t('Password to access »%s« shared with %s', [$filename, $shareWith]); |
|
409 | 409 | |
410 | 410 | $message = $this->mailer->createMessage(); |
411 | 411 | $arguments = ['filename' => $filename, 'recipient' => $shareWith, 'password' => $password]; |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | $mailBodyTemplate = new Template('sharebymail', $template, ''); |
437 | 437 | |
438 | 438 | foreach ($arguments as $key => $value) { |
439 | - $mailBodyTemplate->assign ($key, \OCP\Util::sanitizeHTML($value)); |
|
439 | + $mailBodyTemplate->assign($key, \OCP\Util::sanitizeHTML($value)); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | $mailBody = $mailBodyTemplate->fetchPage(); |
@@ -457,7 +457,7 @@ discard block |
||
457 | 457 | */ |
458 | 458 | protected function generateToken($size = 15) { |
459 | 459 | $token = $this->secureRandom->generate( |
460 | - $size, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
460 | + $size, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
461 | 461 | return $token; |
462 | 462 | } |
463 | 463 | |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | ->orderBy('id'); |
479 | 479 | |
480 | 480 | $cursor = $qb->execute(); |
481 | - while($data = $cursor->fetch()) { |
|
481 | + while ($data = $cursor->fetch()) { |
|
482 | 482 | $children[] = $this->createShareObject($data); |
483 | 483 | } |
484 | 484 | $cursor->closeCursor(); |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $qb->execute(); |
523 | 523 | $id = $qb->getLastInsertId(); |
524 | 524 | |
525 | - return (int)$id; |
|
525 | + return (int) $id; |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | /** |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | // a real password was given |
540 | 540 | $validPassword = $plainTextPassword !== null && $plainTextPassword !== ''; |
541 | 541 | |
542 | - if($validPassword && $originalShare->getPassword() !== $share->getPassword()) { |
|
542 | + if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) { |
|
543 | 543 | $this->sendPassword($share->getNode()->getName(), $share->getSharedBy(), $share->getSharedWith(), $plainTextPassword); |
544 | 544 | } |
545 | 545 | /* |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | |
634 | 634 | $cursor = $qb->execute(); |
635 | 635 | $shares = []; |
636 | - while($data = $cursor->fetch()) { |
|
636 | + while ($data = $cursor->fetch()) { |
|
637 | 637 | $shares[] = $this->createShareObject($data); |
638 | 638 | } |
639 | 639 | $cursor->closeCursor(); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | ->execute(); |
686 | 686 | |
687 | 687 | $shares = []; |
688 | - while($data = $cursor->fetch()) { |
|
688 | + while ($data = $cursor->fetch()) { |
|
689 | 689 | $shares[] = $this->createShareObject($data); |
690 | 690 | } |
691 | 691 | $cursor->closeCursor(); |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | |
725 | 725 | $cursor = $qb->execute(); |
726 | 726 | |
727 | - while($data = $cursor->fetch()) { |
|
727 | + while ($data = $cursor->fetch()) { |
|
728 | 728 | $shares[] = $this->createShareObject($data); |
729 | 729 | } |
730 | 730 | $cursor->closeCursor(); |
@@ -787,15 +787,15 @@ discard block |
||
787 | 787 | protected function createShareObject($data) { |
788 | 788 | |
789 | 789 | $share = new Share($this->rootFolder, $this->userManager); |
790 | - $share->setId((int)$data['id']) |
|
791 | - ->setShareType((int)$data['share_type']) |
|
792 | - ->setPermissions((int)$data['permissions']) |
|
790 | + $share->setId((int) $data['id']) |
|
791 | + ->setShareType((int) $data['share_type']) |
|
792 | + ->setPermissions((int) $data['permissions']) |
|
793 | 793 | ->setTarget($data['file_target']) |
794 | - ->setMailSend((bool)$data['mail_send']) |
|
794 | + ->setMailSend((bool) $data['mail_send']) |
|
795 | 795 | ->setToken($data['token']); |
796 | 796 | |
797 | 797 | $shareTime = new \DateTime(); |
798 | - $shareTime->setTimestamp((int)$data['stime']); |
|
798 | + $shareTime->setTimestamp((int) $data['stime']); |
|
799 | 799 | $share->setShareTime($shareTime); |
800 | 800 | $share->setSharedWith($data['share_with']); |
801 | 801 | $share->setPassword($data['password']); |
@@ -806,7 +806,7 @@ discard block |
||
806 | 806 | } else { |
807 | 807 | //OLD SHARE |
808 | 808 | $share->setSharedBy($data['uid_owner']); |
809 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
809 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
810 | 810 | |
811 | 811 | $owner = $path->getOwner(); |
812 | 812 | $share->setShareOwner($owner->getUID()); |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | } |
820 | 820 | } |
821 | 821 | |
822 | - $share->setNodeId((int)$data['file_source']); |
|
822 | + $share->setNodeId((int) $data['file_source']); |
|
823 | 823 | $share->setNodeType($data['item_type']); |
824 | 824 | |
825 | 825 | $share->setProviderId($this->identifier()); |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | ); |
939 | 939 | } |
940 | 940 | |
941 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
941 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
942 | 942 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
943 | 943 | |
944 | 944 | $qb->orderBy('id'); |