@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function generateTarget($filePath, $shareWith, $exclude = null) { |
98 | 98 | $shareFolder = \OCA\Files_Sharing\Helper::getShareFolder(); |
99 | - $target = \OC\Files\Filesystem::normalizePath($shareFolder . '/' . basename($filePath)); |
|
99 | + $target = \OC\Files\Filesystem::normalizePath($shareFolder.'/'.basename($filePath)); |
|
100 | 100 | |
101 | 101 | // for group shares we return the target right away |
102 | 102 | if ($shareWith === false) { |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | \OC\Files\Filesystem::initMountPoints($shareWith); |
107 | - $view = new \OC\Files\View('/' . $shareWith . '/files'); |
|
107 | + $view = new \OC\Files\View('/'.$shareWith.'/files'); |
|
108 | 108 | |
109 | 109 | if (!$view->is_dir($shareFolder)) { |
110 | 110 | $dir = ''; |
111 | 111 | $subdirs = explode('/', $shareFolder); |
112 | 112 | foreach ($subdirs as $subdir) { |
113 | - $dir = $dir . '/' . $subdir; |
|
113 | + $dir = $dir.'/'.$subdir; |
|
114 | 114 | if (!$view->is_dir($dir)) { |
115 | 115 | $view->mkdir($dir); |
116 | 116 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ($share['item_type'] === 'folder' && $target !== '') { |
238 | 238 | // note: in case of ext storage mount points the path might be empty |
239 | 239 | // which would cause a leading slash to appear |
240 | - $share['path'] = ltrim($share['path'] . '/' . $target, '/'); |
|
240 | + $share['path'] = ltrim($share['path'].'/'.$target, '/'); |
|
241 | 241 | } |
242 | 242 | return self::resolveReshares($share); |
243 | 243 | } |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | protected function run($argument) { |
71 | 71 | // Delete old tokens after 2 days |
72 | - if($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
72 | + if ($this->timeFactory->getTime() - $this->config->getAppValue('core', 'updater.secret.created', $this->timeFactory->getTime()) >= 172800) { |
|
73 | 73 | $this->config->deleteSystemValue('updater.secret'); |
74 | 74 | } |
75 | 75 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @param string $userId |
30 | 30 | */ |
31 | 31 | public function __construct($userId) { |
32 | - if(empty($userId)) { |
|
32 | + if (empty($userId)) { |
|
33 | 33 | $userId = "<no-user-id-given>"; |
34 | 34 | } |
35 | 35 | parent::__construct("Public Key missing for user: $userId"); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | * @param string $userId |
33 | 33 | */ |
34 | 34 | public function __construct($userId) { |
35 | - if(empty($userId)) { |
|
35 | + if (empty($userId)) { |
|
36 | 36 | $userId = "<no-user-id-given>"; |
37 | 37 | } |
38 | 38 | parent::__construct("Private Key missing for user: $userId"); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | if (!$keyManager->recoveryKeyExists()) { |
111 | 111 | $keyPair = $this->crypt->createKeyPair(); |
112 | - if(!is_array($keyPair)) { |
|
112 | + if (!is_array($keyPair)) { |
|
113 | 113 | return false; |
114 | 114 | } |
115 | 115 | |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | public function changeRecoveryKeyPassword($newPassword, $oldPassword) { |
135 | 135 | $recoveryKey = $this->keyManager->getSystemPrivateKey($this->keyManager->getRecoveryKeyId()); |
136 | 136 | $decryptedRecoveryKey = $this->crypt->decryptPrivateKey($recoveryKey, $oldPassword); |
137 | - if($decryptedRecoveryKey === false) { |
|
137 | + if ($decryptedRecoveryKey === false) { |
|
138 | 138 | return false; |
139 | 139 | } |
140 | 140 | $encryptedRecoveryKey = $this->crypt->encryptPrivateKey($decryptedRecoveryKey, $newPassword); |
141 | 141 | $header = $this->crypt->generateHeader(); |
142 | 142 | if ($encryptedRecoveryKey) { |
143 | - $this->keyManager->setSystemPrivateKey($this->keyManager->getRecoveryKeyId(), $header . $encryptedRecoveryKey); |
|
143 | + $this->keyManager->setSystemPrivateKey($this->keyManager->getRecoveryKeyId(), $header.$encryptedRecoveryKey); |
|
144 | 144 | return true; |
145 | 145 | } |
146 | 146 | return false; |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | $value); |
203 | 203 | |
204 | 204 | if ($value === '1') { |
205 | - $this->addRecoveryKeys('/' . $this->user->getUID() . '/files/'); |
|
205 | + $this->addRecoveryKeys('/'.$this->user->getUID().'/files/'); |
|
206 | 206 | } else { |
207 | - $this->removeRecoveryKeys('/' . $this->user->getUID() . '/files/'); |
|
207 | + $this->removeRecoveryKeys('/'.$this->user->getUID().'/files/'); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | return true; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | foreach ($dirContent as $item) { |
223 | 223 | $filePath = $item->getPath(); |
224 | 224 | if ($item['type'] === 'dir') { |
225 | - $this->addRecoveryKeys($filePath . '/'); |
|
225 | + $this->addRecoveryKeys($filePath.'/'); |
|
226 | 226 | } else { |
227 | 227 | $fileKey = $this->keyManager->getFileKey($filePath, $this->user->getUID()); |
228 | 228 | if (!empty($fileKey)) { |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | foreach ($dirContent as $item) { |
251 | 251 | $filePath = $item->getPath(); |
252 | 252 | if ($item['type'] === 'dir') { |
253 | - $this->removeRecoveryKeys($filePath . '/'); |
|
253 | + $this->removeRecoveryKeys($filePath.'/'); |
|
254 | 254 | } else { |
255 | 255 | $this->keyManager->deleteShareKey($filePath, $this->keyManager->getRecoveryKeyId()); |
256 | 256 | } |
@@ -267,8 +267,8 @@ discard block |
||
267 | 267 | $encryptedKey = $this->keyManager->getSystemPrivateKey($this->keyManager->getRecoveryKeyId()); |
268 | 268 | |
269 | 269 | $privateKey = $this->crypt->decryptPrivateKey($encryptedKey, $recoveryPassword); |
270 | - if($privateKey !== false) { |
|
271 | - $this->recoverAllFiles('/' . $user . '/files/', $privateKey, $user); |
|
270 | + if ($privateKey !== false) { |
|
271 | + $this->recoverAllFiles('/'.$user.'/files/', $privateKey, $user); |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | // Get relative path from encryption/keyfiles |
287 | 287 | $filePath = $item->getPath(); |
288 | 288 | if ($this->view->is_dir($filePath)) { |
289 | - $this->recoverAllFiles($filePath . '/', $privateKey, $uid); |
|
289 | + $this->recoverAllFiles($filePath.'/', $privateKey, $uid); |
|
290 | 290 | } else { |
291 | 291 | $this->recoverFile($filePath, $privateKey, $uid); |
292 | 292 | } |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | $comment = $event->getComment(); |
56 | 56 | |
57 | 57 | $mentions = $this->extractMentions($comment->getMentions()); |
58 | - if(empty($mentions)) { |
|
58 | + if (empty($mentions)) { |
|
59 | 59 | // no one to notify |
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $notification = $this->instantiateNotification($comment); |
64 | 64 | |
65 | - foreach($mentions as $uid) { |
|
66 | - if( ($comment->getActorType() === 'users' && $uid === $comment->getActorId()) |
|
65 | + foreach ($mentions as $uid) { |
|
66 | + if (($comment->getActorType() === 'users' && $uid === $comment->getActorId()) |
|
67 | 67 | || !$this->userManager->userExists($uid) |
68 | 68 | ) { |
69 | 69 | // do not notify unknown users or yourself |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $notification->setUser($uid); |
74 | - if( $event->getEvent() === CommentsEvent::EVENT_DELETE |
|
74 | + if ($event->getEvent() === CommentsEvent::EVENT_DELETE |
|
75 | 75 | || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) |
76 | 76 | { |
77 | 77 | $this->notificationManager->markProcessed($notification); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $notification |
93 | 93 | ->setApp('comments') |
94 | 94 | ->setObject('comment', $comment->getId()) |
95 | - ->setSubject('mention', [ $comment->getObjectType(), $comment->getObjectId() ]) |
|
95 | + ->setSubject('mention', [$comment->getObjectType(), $comment->getObjectId()]) |
|
96 | 96 | ->setDateTime($comment->getCreationDateTime()); |
97 | 97 | |
98 | 98 | return $notification; |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | * @return string[] containing the mentions, e.g. ['alice', 'bob'] |
106 | 106 | */ |
107 | 107 | public function extractMentions(array $mentions) { |
108 | - if(empty($mentions)) { |
|
108 | + if (empty($mentions)) { |
|
109 | 109 | return []; |
110 | 110 | } |
111 | 111 | $uids = []; |
112 | - foreach($mentions as $mention) { |
|
113 | - if($mention['type'] === 'user') { |
|
112 | + foreach ($mentions as $mention) { |
|
113 | + if ($mention['type'] === 'user') { |
|
114 | 114 | $uids[] = $mention['id']; |
115 | 115 | } |
116 | 116 | } |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | * @param CommentsEvent $event |
52 | 52 | */ |
53 | 53 | public function handle(CommentsEvent $event) { |
54 | - if($event->getComment()->getObjectType() !== 'files') { |
|
54 | + if ($event->getComment()->getObjectType() !== 'files') { |
|
55 | 55 | // this is a 'files'-specific Handler |
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | 59 | $eventType = $event->getEvent(); |
60 | - if( $eventType === CommentsEvent::EVENT_ADD |
|
60 | + if ($eventType === CommentsEvent::EVENT_ADD |
|
61 | 61 | ) { |
62 | 62 | $this->notificationHandler($event); |
63 | 63 | $this->activityHandler($event); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | CommentsEvent::EVENT_UPDATE, |
70 | 70 | CommentsEvent::EVENT_DELETE, |
71 | 71 | ]; |
72 | - if(in_array($eventType, $applicableEvents)) { |
|
72 | + if (in_array($eventType, $applicableEvents)) { |
|
73 | 73 | $this->notificationHandler($event); |
74 | 74 | return; |
75 | 75 | } |
@@ -117,7 +117,7 @@ |
||
117 | 117 | \OC_Util::setupFS($user); |
118 | 118 | |
119 | 119 | // Check if this user has a trashbin directory |
120 | - $view = new \OC\Files\View('/' . $user); |
|
120 | + $view = new \OC\Files\View('/'.$user); |
|
121 | 121 | if (!$view->is_dir('/files_trashbin/files')) { |
122 | 122 | return false; |
123 | 123 | } |
@@ -107,8 +107,8 @@ |
||
107 | 107 | protected function removeDeletedFiles($uid) { |
108 | 108 | \OC_Util::tearDownFS(); |
109 | 109 | \OC_Util::setupFS($uid); |
110 | - if ($this->rootFolder->nodeExists('/' . $uid . '/files_trashbin')) { |
|
111 | - $this->rootFolder->get('/' . $uid . '/files_trashbin')->delete(); |
|
110 | + if ($this->rootFolder->nodeExists('/'.$uid.'/files_trashbin')) { |
|
111 | + $this->rootFolder->get('/'.$uid.'/files_trashbin')->delete(); |
|
112 | 112 | $query = $this->dbConnection->getQueryBuilder(); |
113 | 113 | $query->delete('files_trash') |
114 | 114 | ->where($query->expr()->eq('user', $query->createParameter('uid'))) |