@@ -27,7 +27,7 @@ |
||
27 | 27 | use OCP\AppFramework\IAppContainer; |
28 | 28 | |
29 | 29 | class Application extends App { |
30 | - public function __construct () { |
|
30 | + public function __construct() { |
|
31 | 31 | parent::__construct('user_ldap'); |
32 | 32 | $container = $this->getContainer(); |
33 | 33 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function __construct(ILDAPWrapper $ldap) { |
48 | 48 | $this->ldap = $ldap; |
49 | 49 | $memcache = \OC::$server->getMemCacheFactory(); |
50 | - if($memcache->isAvailable()) { |
|
50 | + if ($memcache->isAvailable()) { |
|
51 | 51 | $this->cache = $memcache->create(); |
52 | 52 | } |
53 | 53 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | static $db; |
66 | 66 | static $coreUserManager; |
67 | 67 | static $coreNotificationManager; |
68 | - if(is_null($fs)) { |
|
68 | + if (is_null($fs)) { |
|
69 | 69 | $ocConfig = \OC::$server->getConfig(); |
70 | 70 | $fs = new FilesystemHelper(); |
71 | 71 | $log = new LogWrapper(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return mixed |
92 | 92 | */ |
93 | 93 | protected function getAccess($configPrefix) { |
94 | - if(!isset(self::$accesses[$configPrefix])) { |
|
94 | + if (!isset(self::$accesses[$configPrefix])) { |
|
95 | 95 | $this->addAccess($configPrefix); |
96 | 96 | } |
97 | 97 | return self::$accesses[$configPrefix]; |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | * @return mixed, the result of the specified method |
146 | 146 | */ |
147 | 147 | protected function handleRequest($id, $method, $parameters, $passOnWhen = false) { |
148 | - $result = $this->callOnLastSeenOn($id, $method, $parameters, $passOnWhen); |
|
149 | - if($result === $passOnWhen) { |
|
148 | + $result = $this->callOnLastSeenOn($id, $method, $parameters, $passOnWhen); |
|
149 | + if ($result === $passOnWhen) { |
|
150 | 150 | $result = $this->walkBackends($id, $method, $parameters); |
151 | 151 | } |
152 | 152 | return $result; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | private function getCacheKey($key) { |
160 | 160 | $prefix = 'LDAP-Proxy-'; |
161 | - if(is_null($key)) { |
|
161 | + if (is_null($key)) { |
|
162 | 162 | return $prefix; |
163 | 163 | } |
164 | 164 | return $prefix.md5($key); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @return mixed|null |
170 | 170 | */ |
171 | 171 | public function getFromCache($key) { |
172 | - if(is_null($this->cache) || !$this->isCached($key)) { |
|
172 | + if (is_null($this->cache) || !$this->isCached($key)) { |
|
173 | 173 | return null; |
174 | 174 | } |
175 | 175 | $key = $this->getCacheKey($key); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @return bool |
183 | 183 | */ |
184 | 184 | public function isCached($key) { |
185 | - if(is_null($this->cache)) { |
|
185 | + if (is_null($this->cache)) { |
|
186 | 186 | return false; |
187 | 187 | } |
188 | 188 | $key = $this->getCacheKey($key); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | * @param mixed $value |
195 | 195 | */ |
196 | 196 | public function writeToCache($key, $value) { |
197 | - if(is_null($this->cache)) { |
|
197 | + if (is_null($this->cache)) { |
|
198 | 198 | return; |
199 | 199 | } |
200 | 200 | $key = $this->getCacheKey($key); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | public function clearCache() { |
206 | - if(is_null($this->cache)) { |
|
206 | + if (is_null($this->cache)) { |
|
207 | 207 | return; |
208 | 208 | } |
209 | 209 | $this->cache->clear($this->getCacheKey(null)); |
@@ -65,14 +65,14 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function __construct($storage, array $mountpoints, $arguments = null, $loader = null) { |
67 | 67 | $this->user = $arguments['user']; |
68 | - $this->recipientView = new View('/' . $this->user . '/files'); |
|
68 | + $this->recipientView = new View('/'.$this->user.'/files'); |
|
69 | 69 | |
70 | 70 | $this->superShare = $arguments['superShare']; |
71 | 71 | $this->groupedShares = $arguments['groupedShares']; |
72 | 72 | |
73 | 73 | $newMountPoint = $this->verifyMountPoint($this->superShare, $mountpoints); |
74 | - $absMountPoint = '/' . $this->user . '/files' . $newMountPoint; |
|
75 | - $arguments['ownerView'] = new View('/' . $this->superShare->getShareOwner() . '/files'); |
|
74 | + $absMountPoint = '/'.$this->user.'/files'.$newMountPoint; |
|
75 | + $arguments['ownerView'] = new View('/'.$this->superShare->getShareOwner().'/files'); |
|
76 | 76 | parent::__construct($storage, $absMountPoint, $arguments, $loader); |
77 | 77 | } |
78 | 78 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | $newMountPoint = $this->generateUniqueTarget( |
96 | - \OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint), |
|
96 | + \OC\Files\Filesystem::normalizePath($parent.'/'.$mountPoint), |
|
97 | 97 | $this->recipientView, |
98 | 98 | $mountpoints |
99 | 99 | ); |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | */ |
131 | 131 | private function generateUniqueTarget($path, $view, array $mountpoints) { |
132 | 132 | $pathinfo = pathinfo($path); |
133 | - $ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : ''; |
|
133 | + $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : ''; |
|
134 | 134 | $name = $pathinfo['filename']; |
135 | 135 | $dir = $pathinfo['dirname']; |
136 | 136 | |
137 | 137 | // Helper function to find existing mount points |
138 | - $mountpointExists = function ($path) use ($mountpoints) { |
|
138 | + $mountpointExists = function($path) use ($mountpoints) { |
|
139 | 139 | foreach ($mountpoints as $mountpoint) { |
140 | 140 | if ($mountpoint->getShare()->getTarget() === $path) { |
141 | 141 | return true; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | $i = 2; |
148 | 148 | while ($view->file_exists($path) || $mountpointExists($path)) { |
149 | - $path = Filesystem::normalizePath($dir . '/' . $name . ' (' . $i . ')' . $ext); |
|
149 | + $path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext); |
|
150 | 150 | $i++; |
151 | 151 | } |
152 | 152 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // it is not a file relative to data/user/files |
168 | 168 | if (count($split) < 3 || $split[1] !== 'files') { |
169 | 169 | \OCP\Util::writeLog('file sharing', |
170 | - 'Can not strip userid and "files/" from path: ' . $path, |
|
170 | + 'Can not strip userid and "files/" from path: '.$path, |
|
171 | 171 | \OCP\Util::ERROR); |
172 | 172 | throw new \OCA\Files_Sharing\Exceptions\BrokenPath('Path does not start with /user/files', 10); |
173 | 173 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $sliced = array_slice($split, 2); |
177 | 177 | $relPath = implode('/', $sliced); |
178 | 178 | |
179 | - return '/' . $relPath; |
|
179 | + return '/'.$relPath; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | $this->storage->setMountPoint($relTargetPath); |
199 | 199 | } catch (\Exception $e) { |
200 | 200 | \OCP\Util::writeLog('file sharing', |
201 | - 'Could not rename mount point for shared folder "' . $this->getMountPoint() . '" to "' . $target . '"', |
|
201 | + 'Could not rename mount point for shared folder "'.$this->getMountPoint().'" to "'.$target.'"', |
|
202 | 202 | \OCP\Util::ERROR); |
203 | 203 | } |
204 | 204 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $row = $result->fetch(); |
254 | 254 | $result->closeCursor(); |
255 | 255 | if ($row) { |
256 | - return (int)$row['storage']; |
|
256 | + return (int) $row['storage']; |
|
257 | 257 | } |
258 | 258 | return -1; |
259 | 259 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $updatedEntries = $builder->execute(); |
73 | 73 | if ($updatedEntries > 0) { |
74 | - $out->info('Fixed file share permissions for ' . $updatedEntries . ' shares'); |
|
74 | + $out->info('Fixed file share permissions for '.$updatedEntries.' shares'); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | if ($deletedEntries) { |
110 | - $out->info('Removed ' . $deletedEntries . ' shares where the parent did not exist'); |
|
110 | + $out->info('Removed '.$deletedEntries.' shares where the parent did not exist'); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | public function getACL() { |
102 | - $acl = [ |
|
102 | + $acl = [ |
|
103 | 103 | [ |
104 | 104 | 'privilege' => '{DAV:}read', |
105 | 105 | 'principal' => $this->getOwner(), |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'protected' => true, |
112 | 112 | ]; |
113 | 113 | if ($this->getOwner() !== parent::getOwner()) { |
114 | - $acl[] = [ |
|
114 | + $acl[] = [ |
|
115 | 115 | 'privilege' => '{DAV:}read', |
116 | 116 | 'principal' => parent::getOwner(), |
117 | 117 | 'protected' => true, |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | public function delete() { |
172 | 172 | if (isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) { |
173 | - $principal = 'principal:' . parent::getOwner(); |
|
173 | + $principal = 'principal:'.parent::getOwner(); |
|
174 | 174 | $shares = $this->carddavBackend->getShares($this->getResourceId()); |
175 | 175 | $shares = array_filter($shares, function($share) use ($principal){ |
176 | 176 | return $share['href'] === $principal; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ], |
55 | 55 | ]; |
56 | 56 | |
57 | - if($this->appManager->isEnabledForUser('files_sharing')) { |
|
57 | + if ($this->appManager->isEnabledForUser('files_sharing')) { |
|
58 | 58 | $services['SHARING'] = [ |
59 | 59 | 'version' => 1, |
60 | 60 | 'endpoints' => [ |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - if($this->appManager->isEnabledForUser('activity')) { |
|
88 | + if ($this->appManager->isEnabledForUser('activity')) { |
|
89 | 89 | $services['ACTIVITY'] = [ |
90 | 90 | 'version' => 1, |
91 | 91 | 'endpoints' => [ |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | ]; |
95 | 95 | } |
96 | 96 | |
97 | - if($this->appManager->isEnabledForUser('provisioning_api')) { |
|
97 | + if ($this->appManager->isEnabledForUser('provisioning_api')) { |
|
98 | 98 | $services['PROVISIONING'] = [ |
99 | 99 | 'version' => 1, |
100 | 100 | 'endpoints' => [ |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $principals = []; |
84 | 84 | |
85 | 85 | if ($prefixPath === $this->principalPrefix) { |
86 | - foreach($this->userManager->search('') as $user) { |
|
86 | + foreach ($this->userManager->search('') as $user) { |
|
87 | 87 | $principals[] = $this->userToPrincipal($user); |
88 | 88 | } |
89 | 89 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $groups = $this->groupManager->getUserGroups($user); |
151 | 151 | $groups = array_map(function($group) { |
152 | 152 | /** @var IGroup $group */ |
153 | - return 'principals/groups/' . urlencode($group->getGID()); |
|
153 | + return 'principals/groups/'.urlencode($group->getGID()); |
|
154 | 154 | }, $groups); |
155 | 155 | |
156 | 156 | return $groups; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $email = substr($uri, 7); |
202 | 202 | $users = $this->userManager->getByEmail($email); |
203 | 203 | if (count($users) === 1) { |
204 | - return $this->principalPrefix . '/' . $users[0]->getUID(); |
|
204 | + return $this->principalPrefix.'/'.$users[0]->getUID(); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $userId = $user->getUID(); |
217 | 217 | $displayName = $user->getDisplayName(); |
218 | 218 | $principal = [ |
219 | - 'uri' => $this->principalPrefix . '/' . $userId, |
|
219 | + 'uri' => $this->principalPrefix.'/'.$userId, |
|
220 | 220 | '{DAV:}displayname' => is_null($displayName) ? $userId : $displayName, |
221 | 221 | ]; |
222 | 222 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $principals = []; |
60 | 60 | |
61 | 61 | if ($prefixPath === self::PRINCIPAL_PREFIX) { |
62 | - foreach($this->groupManager->search('') as $user) { |
|
62 | + foreach ($this->groupManager->search('') as $user) { |
|
63 | 63 | $principals[] = $this->groupToPrincipal($user); |
64 | 64 | } |
65 | 65 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @return array |
77 | 77 | */ |
78 | 78 | public function getPrincipalByPath($path) { |
79 | - $elements = explode('/', $path, 3); |
|
79 | + $elements = explode('/', $path, 3); |
|
80 | 80 | if ($elements[0] !== 'principals') { |
81 | 81 | return null; |
82 | 82 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | protected function groupToPrincipal($group) { |
180 | 180 | $groupId = $group->getGID(); |
181 | 181 | $principal = [ |
182 | - 'uri' => 'principals/groups/' . urlencode($groupId), |
|
182 | + 'uri' => 'principals/groups/'.urlencode($groupId), |
|
183 | 183 | '{DAV:}displayname' => $groupId, |
184 | 184 | ]; |
185 | 185 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | protected function userToPrincipal($user) { |
194 | 194 | $principal = [ |
195 | - 'uri' => 'principals/users/' . $user->getUID(), |
|
195 | + 'uri' => 'principals/users/'.$user->getUID(), |
|
196 | 196 | '{DAV:}displayname' => $user->getDisplayName(), |
197 | 197 | ]; |
198 | 198 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | <div class="warning"> |
15 | 15 | <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2> |
16 | 16 | <?php if ($error): ?> |
17 | - <?php if($error_message): ?> |
|
17 | + <?php if ($error_message): ?> |
|
18 | 18 | <p><strong><?php p($error_message); ?></strong></p> |
19 | 19 | <?php else: ?> |
20 | 20 | <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> |