@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | ->orderBy('id'); |
| 289 | 289 | |
| 290 | 290 | $cursor = $qb->execute(); |
| 291 | - while($data = $cursor->fetch()) { |
|
| 291 | + while ($data = $cursor->fetch()) { |
|
| 292 | 292 | $children[] = $this->createShare($data); |
| 293 | 293 | } |
| 294 | 294 | $cursor->closeCursor(); |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $user = $this->userManager->get($recipient); |
| 334 | 334 | |
| 335 | 335 | if (is_null($group)) { |
| 336 | - throw new ProviderException('Group "' . $share->getSharedWith() . '" does not exist'); |
|
| 336 | + throw new ProviderException('Group "'.$share->getSharedWith().'" does not exist'); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | if (!$group->inGroup($user)) { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | ); |
| 494 | 494 | } |
| 495 | 495 | |
| 496 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 496 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 497 | 497 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 498 | 498 | |
| 499 | 499 | $qb->orderBy('id'); |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | |
| 550 | 550 | $cursor = $qb->execute(); |
| 551 | 551 | $shares = []; |
| 552 | - while($data = $cursor->fetch()) { |
|
| 552 | + while ($data = $cursor->fetch()) { |
|
| 553 | 553 | $shares[] = $this->createShare($data); |
| 554 | 554 | } |
| 555 | 555 | $cursor->closeCursor(); |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | ->execute(); |
| 629 | 629 | |
| 630 | 630 | $shares = []; |
| 631 | - while($data = $cursor->fetch()) { |
|
| 631 | + while ($data = $cursor->fetch()) { |
|
| 632 | 632 | $shares[] = $this->createShare($data); |
| 633 | 633 | } |
| 634 | 634 | $cursor->closeCursor(); |
@@ -699,7 +699,7 @@ discard block |
||
| 699 | 699 | |
| 700 | 700 | $cursor = $qb->execute(); |
| 701 | 701 | |
| 702 | - while($data = $cursor->fetch()) { |
|
| 702 | + while ($data = $cursor->fetch()) { |
|
| 703 | 703 | if ($this->isAccessibleResult($data)) { |
| 704 | 704 | $shares[] = $this->createShare($data); |
| 705 | 705 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | $shares2 = []; |
| 715 | 715 | |
| 716 | 716 | $start = 0; |
| 717 | - while(true) { |
|
| 717 | + while (true) { |
|
| 718 | 718 | $groups = array_slice($allGroups, $start, 100); |
| 719 | 719 | $start += 100; |
| 720 | 720 | |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | )); |
| 758 | 758 | |
| 759 | 759 | $cursor = $qb->execute(); |
| 760 | - while($data = $cursor->fetch()) { |
|
| 760 | + while ($data = $cursor->fetch()) { |
|
| 761 | 761 | if ($offset > 0) { |
| 762 | 762 | $offset--; |
| 763 | 763 | continue; |
@@ -826,14 +826,14 @@ discard block |
||
| 826 | 826 | */ |
| 827 | 827 | private function createShare($data) { |
| 828 | 828 | $share = new Share($this->rootFolder, $this->userManager); |
| 829 | - $share->setId((int)$data['id']) |
|
| 830 | - ->setShareType((int)$data['share_type']) |
|
| 831 | - ->setPermissions((int)$data['permissions']) |
|
| 829 | + $share->setId((int) $data['id']) |
|
| 830 | + ->setShareType((int) $data['share_type']) |
|
| 831 | + ->setPermissions((int) $data['permissions']) |
|
| 832 | 832 | ->setTarget($data['file_target']) |
| 833 | - ->setMailSend((bool)$data['mail_send']); |
|
| 833 | + ->setMailSend((bool) $data['mail_send']); |
|
| 834 | 834 | |
| 835 | 835 | $shareTime = new \DateTime(); |
| 836 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 836 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 837 | 837 | $share->setShareTime($shareTime); |
| 838 | 838 | |
| 839 | 839 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) { |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $share->setSharedBy($data['uid_initiator']); |
| 849 | 849 | $share->setShareOwner($data['uid_owner']); |
| 850 | 850 | |
| 851 | - $share->setNodeId((int)$data['file_source']); |
|
| 851 | + $share->setNodeId((int) $data['file_source']); |
|
| 852 | 852 | $share->setNodeType($data['item_type']); |
| 853 | 853 | |
| 854 | 854 | if ($data['expiration'] !== null) { |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | if (isset($data['f_permissions'])) { |
| 860 | 860 | $entryData = $data; |
| 861 | 861 | $entryData['permissions'] = $entryData['f_permissions']; |
| 862 | - $entryData['parent'] = $entryData['f_parent'];; |
|
| 862 | + $entryData['parent'] = $entryData['f_parent']; ; |
|
| 863 | 863 | $share->setNodeCacheEntry(Cache::cacheEntryFromData($entryData, |
| 864 | 864 | \OC::$server->getMimeTypeLoader())); |
| 865 | 865 | } |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | $result = []; |
| 879 | 879 | |
| 880 | 880 | $start = 0; |
| 881 | - while(true) { |
|
| 881 | + while (true) { |
|
| 882 | 882 | /** @var Share[] $shareSlice */ |
| 883 | 883 | $shareSlice = array_slice($shares, $start, 100); |
| 884 | 884 | $start += 100; |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | $shareMap = []; |
| 894 | 894 | |
| 895 | 895 | foreach ($shareSlice as $share) { |
| 896 | - $ids[] = (int)$share->getId(); |
|
| 896 | + $ids[] = (int) $share->getId(); |
|
| 897 | 897 | $shareMap[$share->getId()] = $share; |
| 898 | 898 | } |
| 899 | 899 | |
@@ -910,8 +910,8 @@ discard block |
||
| 910 | 910 | |
| 911 | 911 | $stmt = $query->execute(); |
| 912 | 912 | |
| 913 | - while($data = $stmt->fetch()) { |
|
| 914 | - $shareMap[$data['parent']]->setPermissions((int)$data['permissions']); |
|
| 913 | + while ($data = $stmt->fetch()) { |
|
| 914 | + $shareMap[$data['parent']]->setPermissions((int) $data['permissions']); |
|
| 915 | 915 | $shareMap[$data['parent']]->setTarget($data['file_target']); |
| 916 | 916 | } |
| 917 | 917 | |
@@ -1008,8 +1008,8 @@ discard block |
||
| 1008 | 1008 | |
| 1009 | 1009 | $cursor = $qb->execute(); |
| 1010 | 1010 | $ids = []; |
| 1011 | - while($row = $cursor->fetch()) { |
|
| 1012 | - $ids[] = (int)$row['id']; |
|
| 1011 | + while ($row = $cursor->fetch()) { |
|
| 1012 | + $ids[] = (int) $row['id']; |
|
| 1013 | 1013 | } |
| 1014 | 1014 | $cursor->closeCursor(); |
| 1015 | 1015 | |
@@ -1051,8 +1051,8 @@ discard block |
||
| 1051 | 1051 | |
| 1052 | 1052 | $cursor = $qb->execute(); |
| 1053 | 1053 | $ids = []; |
| 1054 | - while($row = $cursor->fetch()) { |
|
| 1055 | - $ids[] = (int)$row['id']; |
|
| 1054 | + while ($row = $cursor->fetch()) { |
|
| 1055 | + $ids[] = (int) $row['id']; |
|
| 1056 | 1056 | } |
| 1057 | 1057 | $cursor->closeCursor(); |
| 1058 | 1058 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | if ($remoteShare) { |
| 183 | 183 | try { |
| 184 | 184 | $ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); |
| 185 | - $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time()); |
|
| 185 | + $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time()); |
|
| 186 | 186 | $share->setId($shareId); |
| 187 | 187 | list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); |
| 188 | 188 | // remote share was create successfully if we get a valid token as return |
@@ -254,11 +254,11 @@ discard block |
||
| 254 | 254 | $failure = true; |
| 255 | 255 | } |
| 256 | 256 | } catch (\Exception $e) { |
| 257 | - $this->logger->error('Failed to notify remote server of federated share, removing share (' . $e->getMessage() . ')'); |
|
| 257 | + $this->logger->error('Failed to notify remote server of federated share, removing share ('.$e->getMessage().')'); |
|
| 258 | 258 | $failure = true; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - if($failure) { |
|
| 261 | + if ($failure) { |
|
| 262 | 262 | $this->removeShareFromTableById($shareId); |
| 263 | 263 | $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.', |
| 264 | 264 | [$share->getNode()->getName(), $share->getSharedWith()]); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | ->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget()))); |
| 310 | 310 | $result = $query->execute()->fetchAll(); |
| 311 | 311 | |
| 312 | - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { |
|
| 312 | + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { |
|
| 313 | 313 | return $result[0]; |
| 314 | 314 | } |
| 315 | 315 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $qb->execute(); |
| 352 | 352 | $id = $qb->getLastInsertId(); |
| 353 | 353 | |
| 354 | - return (int)$id; |
|
| 354 | + return (int) $id; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -441,14 +441,14 @@ discard block |
||
| 441 | 441 | public function getRemoteId(IShare $share) { |
| 442 | 442 | $query = $this->dbConnection->getQueryBuilder(); |
| 443 | 443 | $query->select('remote_id')->from('federated_reshares') |
| 444 | - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); |
|
| 444 | + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); |
|
| 445 | 445 | $data = $query->execute()->fetch(); |
| 446 | 446 | |
| 447 | 447 | if (!is_array($data) || !isset($data['remote_id'])) { |
| 448 | 448 | throw new ShareNotFound(); |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | - return (int)$data['remote_id']; |
|
| 451 | + return (int) $data['remote_id']; |
|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | /** |
@@ -479,7 +479,7 @@ discard block |
||
| 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(); |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | ); |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 611 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 612 | 612 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 613 | 613 | |
| 614 | 614 | $qb->orderBy('id'); |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | |
| 672 | 672 | $cursor = $qb->execute(); |
| 673 | 673 | $shares = []; |
| 674 | - while($data = $cursor->fetch()) { |
|
| 674 | + while ($data = $cursor->fetch()) { |
|
| 675 | 675 | $shares[] = $this->createShareObject($data); |
| 676 | 676 | } |
| 677 | 677 | $cursor->closeCursor(); |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | ->execute(); |
| 724 | 724 | |
| 725 | 725 | $shares = []; |
| 726 | - while($data = $cursor->fetch()) { |
|
| 726 | + while ($data = $cursor->fetch()) { |
|
| 727 | 727 | $shares[] = $this->createShareObject($data); |
| 728 | 728 | } |
| 729 | 729 | $cursor->closeCursor(); |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | |
| 763 | 763 | $cursor = $qb->execute(); |
| 764 | 764 | |
| 765 | - while($data = $cursor->fetch()) { |
|
| 765 | + while ($data = $cursor->fetch()) { |
|
| 766 | 766 | $shares[] = $this->createShareObject($data); |
| 767 | 767 | } |
| 768 | 768 | $cursor->closeCursor(); |
@@ -839,15 +839,15 @@ discard block |
||
| 839 | 839 | private function createShareObject($data) { |
| 840 | 840 | |
| 841 | 841 | $share = new Share($this->rootFolder, $this->userManager); |
| 842 | - $share->setId((int)$data['id']) |
|
| 843 | - ->setShareType((int)$data['share_type']) |
|
| 844 | - ->setPermissions((int)$data['permissions']) |
|
| 842 | + $share->setId((int) $data['id']) |
|
| 843 | + ->setShareType((int) $data['share_type']) |
|
| 844 | + ->setPermissions((int) $data['permissions']) |
|
| 845 | 845 | ->setTarget($data['file_target']) |
| 846 | - ->setMailSend((bool)$data['mail_send']) |
|
| 846 | + ->setMailSend((bool) $data['mail_send']) |
|
| 847 | 847 | ->setToken($data['token']); |
| 848 | 848 | |
| 849 | 849 | $shareTime = new \DateTime(); |
| 850 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 850 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 851 | 851 | $share->setShareTime($shareTime); |
| 852 | 852 | $share->setSharedWith($data['share_with']); |
| 853 | 853 | |
@@ -857,13 +857,13 @@ discard block |
||
| 857 | 857 | } else { |
| 858 | 858 | //OLD SHARE |
| 859 | 859 | $share->setSharedBy($data['uid_owner']); |
| 860 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
| 860 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
| 861 | 861 | |
| 862 | 862 | $owner = $path->getOwner(); |
| 863 | 863 | $share->setShareOwner($owner->getUID()); |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | - $share->setNodeId((int)$data['file_source']); |
|
| 866 | + $share->setNodeId((int) $data['file_source']); |
|
| 867 | 867 | $share->setNodeType($data['item_type']); |
| 868 | 868 | |
| 869 | 869 | $share->setProviderId($this->identifier()); |
@@ -234,11 +234,11 @@ discard block |
||
| 234 | 234 | $share->getShareOwner(), |
| 235 | 235 | $share->getSharedBy(), $share->getSharedWith()); |
| 236 | 236 | } catch (HintException $hintException) { |
| 237 | - $this->logger->error('Failed to send share by mail: ' . $hintException->getMessage()); |
|
| 237 | + $this->logger->error('Failed to send share by mail: '.$hintException->getMessage()); |
|
| 238 | 238 | $this->removeShareFromTable($shareId); |
| 239 | 239 | throw $hintException; |
| 240 | 240 | } catch (\Exception $e) { |
| 241 | - $this->logger->error('Failed to send share by mail: ' . $e->getMessage()); |
|
| 241 | + $this->logger->error('Failed to send share by mail: '.$e->getMessage()); |
|
| 242 | 242 | $this->removeShareFromTable($shareId); |
| 243 | 243 | throw new HintException('Failed to send share by mail', |
| 244 | 244 | $this->l->t('Failed to send share by E-mail')); |
@@ -254,9 +254,9 @@ discard block |
||
| 254 | 254 | $ownerDisplayName = ($ownerUser instanceof IUser) ? $ownerUser->getDisplayName() : $owner; |
| 255 | 255 | $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; |
| 256 | 256 | if ($owner === $initiator) { |
| 257 | - $subject = (string)$this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); |
|
| 257 | + $subject = (string) $this->l->t('%s shared »%s« with you', array($ownerDisplayName, $filename)); |
|
| 258 | 258 | } else { |
| 259 | - $subject = (string)$this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName)); |
|
| 259 | + $subject = (string) $this->l->t('%s shared »%s« with you on behalf of %s', array($ownerDisplayName, $filename, $initiatorDisplayName)); |
|
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | $message = $this->mailer->createMessage(); |
@@ -283,11 +283,11 @@ discard block |
||
| 283 | 283 | protected function createMailBody($template, $filename, $link, $owner, $initiator) { |
| 284 | 284 | |
| 285 | 285 | $mailBodyTemplate = new Template('sharebymail', $template, ''); |
| 286 | - $mailBodyTemplate->assign ('filename', \OCP\Util::sanitizeHTML($filename)); |
|
| 287 | - $mailBodyTemplate->assign ('link', $link); |
|
| 288 | - $mailBodyTemplate->assign ('owner', \OCP\Util::sanitizeHTML($owner)); |
|
| 289 | - $mailBodyTemplate->assign ('initiator', \OCP\Util::sanitizeHTML($initiator)); |
|
| 290 | - $mailBodyTemplate->assign ('onBehalfOf', $initiator !== $owner); |
|
| 286 | + $mailBodyTemplate->assign('filename', \OCP\Util::sanitizeHTML($filename)); |
|
| 287 | + $mailBodyTemplate->assign('link', $link); |
|
| 288 | + $mailBodyTemplate->assign('owner', \OCP\Util::sanitizeHTML($owner)); |
|
| 289 | + $mailBodyTemplate->assign('initiator', \OCP\Util::sanitizeHTML($initiator)); |
|
| 290 | + $mailBodyTemplate->assign('onBehalfOf', $initiator !== $owner); |
|
| 291 | 291 | $mailBody = $mailBodyTemplate->fetchPage(); |
| 292 | 292 | |
| 293 | 293 | if (is_string($mailBody)) { |
@@ -313,11 +313,11 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | $initiatorUser = $this->userManager->get($initiator); |
| 315 | 315 | $initiatorDisplayName = ($initiatorUser instanceof IUser) ? $initiatorUser->getDisplayName() : $initiator; |
| 316 | - $subject = (string)$this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]); |
|
| 316 | + $subject = (string) $this->l->t('Password to access »%s« shared to you by %s', [$filename, $initiatorDisplayName]); |
|
| 317 | 317 | |
| 318 | 318 | $message = $this->mailer->createMessage(); |
| 319 | 319 | $htmlBody = $this->createMailBodyToSendPassword('mailpassword', $filename, $initiatorDisplayName, $password); |
| 320 | - $textBody = $this->createMailBodyToSendPassword('altmailpassword', $filename,$initiatorDisplayName, $password); |
|
| 320 | + $textBody = $this->createMailBodyToSendPassword('altmailpassword', $filename, $initiatorDisplayName, $password); |
|
| 321 | 321 | $message->setTo([$shareWith]); |
| 322 | 322 | $message->setSubject($subject); |
| 323 | 323 | $message->setBody($textBody, 'text/plain'); |
@@ -338,9 +338,9 @@ discard block |
||
| 338 | 338 | protected function createMailBodyToSendPassword($template, $filename, $initiator, $password) { |
| 339 | 339 | |
| 340 | 340 | $mailBodyTemplate = new Template('sharebymail', $template, ''); |
| 341 | - $mailBodyTemplate->assign ('filename', \OCP\Util::sanitizeHTML($filename)); |
|
| 342 | - $mailBodyTemplate->assign ('password', \OCP\Util::sanitizeHTML($password)); |
|
| 343 | - $mailBodyTemplate->assign ('initiator', \OCP\Util::sanitizeHTML($initiator)); |
|
| 341 | + $mailBodyTemplate->assign('filename', \OCP\Util::sanitizeHTML($filename)); |
|
| 342 | + $mailBodyTemplate->assign('password', \OCP\Util::sanitizeHTML($password)); |
|
| 343 | + $mailBodyTemplate->assign('initiator', \OCP\Util::sanitizeHTML($initiator)); |
|
| 344 | 344 | $mailBody = $mailBodyTemplate->fetchPage(); |
| 345 | 345 | |
| 346 | 346 | if (is_string($mailBody)) { |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | */ |
| 360 | 360 | protected function generateToken() { |
| 361 | 361 | $token = $this->secureRandom->generate( |
| 362 | - 15, ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER . ISecureRandom::CHAR_DIGITS); |
|
| 362 | + 15, ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_DIGITS); |
|
| 363 | 363 | return $token; |
| 364 | 364 | } |
| 365 | 365 | |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | ->orderBy('id'); |
| 381 | 381 | |
| 382 | 382 | $cursor = $qb->execute(); |
| 383 | - while($data = $cursor->fetch()) { |
|
| 383 | + while ($data = $cursor->fetch()) { |
|
| 384 | 384 | $children[] = $this->createShareObject($data); |
| 385 | 385 | } |
| 386 | 386 | $cursor->closeCursor(); |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $qb->execute(); |
| 424 | 424 | $id = $qb->getLastInsertId(); |
| 425 | 425 | |
| 426 | - return (int)$id; |
|
| 426 | + return (int) $id; |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | // a real password was given |
| 441 | 441 | $validPassword = $plainTextPassword !== null && $plainTextPassword !== ''; |
| 442 | 442 | |
| 443 | - if($validPassword && $originalShare->getPassword() !== $share->getPassword()) { |
|
| 443 | + if ($validPassword && $originalShare->getPassword() !== $share->getPassword()) { |
|
| 444 | 444 | $this->sendPassword($share->getNode()->getName(), $share->getSharedBy(), $share->getSharedWith(), $plainTextPassword); |
| 445 | 445 | } |
| 446 | 446 | /* |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | $cursor = $qb->execute(); |
| 536 | 536 | $shares = []; |
| 537 | - while($data = $cursor->fetch()) { |
|
| 537 | + while ($data = $cursor->fetch()) { |
|
| 538 | 538 | $shares[] = $this->createShareObject($data); |
| 539 | 539 | } |
| 540 | 540 | $cursor->closeCursor(); |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | ->execute(); |
| 587 | 587 | |
| 588 | 588 | $shares = []; |
| 589 | - while($data = $cursor->fetch()) { |
|
| 589 | + while ($data = $cursor->fetch()) { |
|
| 590 | 590 | $shares[] = $this->createShareObject($data); |
| 591 | 591 | } |
| 592 | 592 | $cursor->closeCursor(); |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | |
| 626 | 626 | $cursor = $qb->execute(); |
| 627 | 627 | |
| 628 | - while($data = $cursor->fetch()) { |
|
| 628 | + while ($data = $cursor->fetch()) { |
|
| 629 | 629 | $shares[] = $this->createShareObject($data); |
| 630 | 630 | } |
| 631 | 631 | $cursor->closeCursor(); |
@@ -688,15 +688,15 @@ discard block |
||
| 688 | 688 | protected function createShareObject($data) { |
| 689 | 689 | |
| 690 | 690 | $share = new Share($this->rootFolder, $this->userManager); |
| 691 | - $share->setId((int)$data['id']) |
|
| 692 | - ->setShareType((int)$data['share_type']) |
|
| 693 | - ->setPermissions((int)$data['permissions']) |
|
| 691 | + $share->setId((int) $data['id']) |
|
| 692 | + ->setShareType((int) $data['share_type']) |
|
| 693 | + ->setPermissions((int) $data['permissions']) |
|
| 694 | 694 | ->setTarget($data['file_target']) |
| 695 | - ->setMailSend((bool)$data['mail_send']) |
|
| 695 | + ->setMailSend((bool) $data['mail_send']) |
|
| 696 | 696 | ->setToken($data['token']); |
| 697 | 697 | |
| 698 | 698 | $shareTime = new \DateTime(); |
| 699 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 699 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 700 | 700 | $share->setShareTime($shareTime); |
| 701 | 701 | $share->setSharedWith($data['share_with']); |
| 702 | 702 | $share->setPassword($data['password']); |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | } else { |
| 708 | 708 | //OLD SHARE |
| 709 | 709 | $share->setSharedBy($data['uid_owner']); |
| 710 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
| 710 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
| 711 | 711 | |
| 712 | 712 | $owner = $path->getOwner(); |
| 713 | 713 | $share->setShareOwner($owner->getUID()); |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | } |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | - $share->setNodeId((int)$data['file_source']); |
|
| 723 | + $share->setNodeId((int) $data['file_source']); |
|
| 724 | 724 | $share->setNodeType($data['item_type']); |
| 725 | 725 | |
| 726 | 726 | $share->setProviderId($this->identifier()); |
@@ -839,7 +839,7 @@ discard block |
||
| 839 | 839 | ); |
| 840 | 840 | } |
| 841 | 841 | |
| 842 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 842 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 843 | 843 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 844 | 844 | |
| 845 | 845 | $qb->orderBy('id'); |