@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @return array enriched share info with data from the filecache |
110 | 110 | */ |
111 | 111 | private static function extendShareInfo($share) { |
112 | - $view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/'); |
|
112 | + $view = new \OC\Files\View('/'.\OC_User::getUser().'/files/'); |
|
113 | 113 | $info = $view->getFileInfo($share['mountpoint']); |
114 | 114 | |
115 | 115 | $share['mimetype'] = $info->getMimetype(); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | throw new OCSNotFoundException('Share does not exist'); |
173 | 173 | } |
174 | 174 | |
175 | - $mountPoint = '/' . \OC_User::getUser() . '/files' . $shareInfo['mountpoint']; |
|
175 | + $mountPoint = '/'.\OC_User::getUser().'/files'.$shareInfo['mountpoint']; |
|
176 | 176 | |
177 | 177 | if ($this->externalManager->removeShare($mountPoint) === true) { |
178 | 178 | return new DataResponse(); |
@@ -23,6 +23,6 @@ |
||
23 | 23 | |
24 | 24 | namespace OCA\Files_Sharing; |
25 | 25 | |
26 | -interface ISharedStorage{ |
|
26 | +interface ISharedStorage { |
|
27 | 27 | |
28 | 28 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | /** {@inheritDoc} */ |
39 | 39 | public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) { |
40 | - if(!$this->storage->remoteIsOwnCloud()) { |
|
40 | + if (!$this->storage->remoteIsOwnCloud()) { |
|
41 | 41 | return parent::scan($path, $recursive, $recursive, $lock); |
42 | 42 | } |
43 | 43 | |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | } catch (\Exception $e) { |
89 | 89 | $this->storage->checkStorageAvailability(); |
90 | 90 | throw new \Exception( |
91 | - 'Error while scanning remote share: "' . |
|
92 | - $this->storage->getRemote() . '" ' . |
|
91 | + 'Error while scanning remote share: "'. |
|
92 | + $this->storage->getRemote().'" '. |
|
93 | 93 | $e->getMessage() |
94 | 94 | ); |
95 | 95 | } |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | $this->addResult($data['data'], ''); |
98 | 98 | } else { |
99 | 99 | throw new \Exception( |
100 | - 'Error while scanning remote share: "' . |
|
101 | - $this->storage->getRemote() . '"' |
|
100 | + 'Error while scanning remote share: "'. |
|
101 | + $this->storage->getRemote().'"' |
|
102 | 102 | ); |
103 | 103 | } |
104 | 104 | } |
@@ -113,14 +113,14 @@ discard block |
||
113 | 113 | $children = []; |
114 | 114 | foreach ($data['children'] as $child) { |
115 | 115 | $children[$child['name']] = true; |
116 | - $this->addResult($child, ltrim($path . '/' . $child['name'], '/')); |
|
116 | + $this->addResult($child, ltrim($path.'/'.$child['name'], '/')); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $existingCache = $this->cache->getFolderContentsById($id); |
120 | 120 | foreach ($existingCache as $existingChild) { |
121 | 121 | // if an existing child is not in the new data, remove it |
122 | 122 | if (!isset($children[$existingChild['name']])) { |
123 | - $this->cache->remove(ltrim($path . '/' . $existingChild['name'], '/')); |
|
123 | + $this->cache->remove(ltrim($path.'/'.$existingChild['name'], '/')); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $managerProvider = $this->managerProvider; |
62 | 62 | $manager = $managerProvider(); |
63 | 63 | $data['manager'] = $manager; |
64 | - $mountPoint = '/' . $user->getUID() . '/files/' . ltrim($data['mountpoint'], '/'); |
|
64 | + $mountPoint = '/'.$user->getUID().'/files/'.ltrim($data['mountpoint'], '/'); |
|
65 | 65 | $data['mountpoint'] = $mountPoint; |
66 | 66 | $data['cloudId'] = $this->cloudIdManager->getCloudId($data['owner'], $data['remote']); |
67 | 67 | $data['certificateManager'] = \OC::$server->getCertificateManager($user->getUID()); |
@@ -90,11 +90,11 @@ |
||
90 | 90 | */ |
91 | 91 | static private function renameChildren($oldPath, $newPath) { |
92 | 92 | |
93 | - $absNewPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath); |
|
94 | - $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath); |
|
93 | + $absNewPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files/'.$newPath); |
|
94 | + $absOldPath = \OC\Files\Filesystem::normalizePath('/'.\OCP\User::getUser().'/files/'.$oldPath); |
|
95 | 95 | |
96 | 96 | $mountManager = \OC\Files\Filesystem::getMountManager(); |
97 | - $mountedShares = $mountManager->findIn('/' . \OCP\User::getUser() . '/files/' . $oldPath); |
|
97 | + $mountedShares = $mountManager->findIn('/'.\OCP\User::getUser().'/files/'.$oldPath); |
|
98 | 98 | foreach ($mountedShares as $mount) { |
99 | 99 | if ($mount->getStorage()->instanceOfStorage('OCA\Files_Sharing\ISharedStorage')) { |
100 | 100 | $mountPoint = $mount->getMountPoint(); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $basePath = $path; |
89 | 89 | |
90 | - if ($relativePath !== null && Filesystem::isReadable($basePath . $relativePath)) { |
|
90 | + if ($relativePath !== null && Filesystem::isReadable($basePath.$relativePath)) { |
|
91 | 91 | $path .= Filesystem::normalizePath($relativePath); |
92 | 92 | } |
93 | 93 | |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | if ($password !== null) { |
113 | 113 | if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) { |
114 | 114 | if ($shareManager->checkPassword($share, $password)) { |
115 | - \OC::$server->getSession()->set('public_link_authenticated', (string)$share->getId()); |
|
115 | + \OC::$server->getSession()->set('public_link_authenticated', (string) $share->getId()); |
|
116 | 116 | return true; |
117 | 117 | } |
118 | 118 | } |
119 | 119 | } else { |
120 | 120 | // not authenticated ? |
121 | 121 | if (\OC::$server->getSession()->exists('public_link_authenticated') |
122 | - && \OC::$server->getSession()->get('public_link_authenticated') !== (string)$share->getId()) { |
|
122 | + && \OC::$server->getSession()->get('public_link_authenticated') !== (string) $share->getId()) { |
|
123 | 123 | return true; |
124 | 124 | } |
125 | 125 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | Filesystem::initMountPoints($owner); |
133 | 133 | $info = Filesystem::getFileInfo($target); |
134 | 134 | $ownerView = new View('/'.$owner.'/files'); |
135 | - if ( $owner != User::getUser() ) { |
|
135 | + if ($owner != User::getUser()) { |
|
136 | 136 | $path = $ownerView->getPath($info['fileid']); |
137 | 137 | } else { |
138 | 138 | $path = $target; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | if ($info instanceof \OC\Files\FileInfo) { |
146 | 146 | $ids[] = $info['fileid']; |
147 | 147 | } else { |
148 | - \OCP\Util::writeLog('sharing', 'No fileinfo available for: ' . $path, \OCP\Util::WARN); |
|
148 | + \OCP\Util::writeLog('sharing', 'No fileinfo available for: '.$path, \OCP\Util::WARN); |
|
149 | 149 | } |
150 | 150 | $path = dirname($path); |
151 | 151 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $idList = array_chunk($ids, 99, true); |
156 | 156 | |
157 | 157 | foreach ($idList as $subList) { |
158 | - $statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (" . implode(',', $subList) . ") AND `share_type` IN (0, 1, 2)"; |
|
158 | + $statement = "SELECT `share_with`, `share_type`, `file_target` FROM `*PREFIX*share` WHERE `file_source` IN (".implode(',', $subList).") AND `share_type` IN (0, 1, 2)"; |
|
159 | 159 | $query = \OCP\DB::prepare($statement); |
160 | 160 | $r = $query->execute(); |
161 | 161 | $result = array_merge($result, $r->fetchAll()); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $uid = User::getUser(); |
184 | 184 | } |
185 | 185 | Filesystem::initMountPoints($uid); |
186 | - if ( $uid != User::getUser() ) { |
|
186 | + if ($uid != User::getUser()) { |
|
187 | 187 | $info = Filesystem::getFileInfo($filename); |
188 | 188 | $ownerView = new View('/'.$uid.'/files'); |
189 | 189 | try { |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $dir = $pathinfo['dirname']; |
231 | 231 | $i = 2; |
232 | 232 | while ($view->file_exists($path) || in_array($path, $excludeList)) { |
233 | - $path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext); |
|
233 | + $path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext); |
|
234 | 234 | $i++; |
235 | 235 | } |
236 | 236 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $dir = ''; |
255 | 255 | $subdirs = explode('/', $shareFolder); |
256 | 256 | foreach ($subdirs as $subdir) { |
257 | - $dir = $dir . '/' . $subdir; |
|
257 | + $dir = $dir.'/'.$subdir; |
|
258 | 258 | if (!$view->is_dir($dir)) { |
259 | 259 | $view->mkdir($dir); |
260 | 260 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * sets the correct interval for this timed job |
43 | 43 | */ |
44 | - public function __construct(){ |
|
44 | + public function __construct() { |
|
45 | 45 | $this->interval = $this->defaultIntervalMin * 60; |
46 | 46 | } |
47 | 47 | |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | $logger = \OC::$server->getLogger(); |
56 | 56 | |
57 | 57 | $sql = |
58 | - 'DELETE FROM `*PREFIX*share` ' . |
|
59 | - 'WHERE `item_type` in (\'file\', \'folder\') ' . |
|
58 | + 'DELETE FROM `*PREFIX*share` '. |
|
59 | + 'WHERE `item_type` in (\'file\', \'folder\') '. |
|
60 | 60 | 'AND NOT EXISTS (SELECT `fileid` FROM `*PREFIX*filecache` WHERE `file_source` = `fileid`)'; |
61 | 61 | |
62 | 62 | $deletedEntries = $connection->executeUpdate($sql); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @throws S2SException |
91 | 91 | */ |
92 | 92 | public function beforeController($controller, $methodName) { |
93 | - if(!$this->isSharingEnabled()) { |
|
93 | + if (!$this->isSharingEnabled()) { |
|
94 | 94 | throw new NotFoundException('Sharing is disabled.'); |
95 | 95 | } |
96 | 96 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @throws \Exception |
118 | 118 | */ |
119 | 119 | public function afterException($controller, $methodName, \Exception $exception) { |
120 | - if(is_a($exception, '\OCP\Files\NotFoundException')) { |
|
120 | + if (is_a($exception, '\OCP\Files\NotFoundException')) { |
|
121 | 121 | return new NotFoundResponse(); |
122 | 122 | } |
123 | 123 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | private function isSharingEnabled() { |
155 | 155 | // FIXME: This check is done here since the route is globally defined and not inside the files_sharing app |
156 | 156 | // Check whether the sharing application is enabled |
157 | - if(!$this->appManager->isEnabledForUser($this->appName)) { |
|
157 | + if (!$this->appManager->isEnabledForUser($this->appName)) { |
|
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | // Check whether public sharing is enabled |
175 | - if($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { |
|
175 | + if ($this->config->getAppValue('core', 'shareapi_allow_links', 'yes') !== 'yes') { |
|
176 | 176 | return false; |
177 | 177 | } |
178 | 178 |
@@ -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 | } |