@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | private function hash($methodIdentifier, |
56 | 56 | $userIdentifier) { |
57 | - return hash('sha512', $methodIdentifier . $userIdentifier); |
|
57 | + return hash('sha512', $methodIdentifier.$userIdentifier); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | private function getExistingAttempts($identifier) { |
65 | 65 | $cachedAttempts = json_decode($this->cache->get($identifier), true); |
66 | - if(is_array($cachedAttempts)) { |
|
66 | + if (is_array($cachedAttempts)) { |
|
67 | 67 | return $cachedAttempts; |
68 | 68 | } |
69 | 69 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $currentTime = $this->timeFactory->getTime(); |
84 | 84 | /** @var array $existingAttempts */ |
85 | 85 | foreach ($existingAttempts as $attempt) { |
86 | - if(($attempt + $seconds) > $currentTime) { |
|
86 | + if (($attempt + $seconds) > $currentTime) { |
|
87 | 87 | $count++; |
88 | 88 | } |
89 | 89 | } |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | |
104 | 104 | // Unset all attempts older than $period |
105 | 105 | foreach ($existingAttempts as $key => $attempt) { |
106 | - if(($attempt + $period) < $currentTime) { |
|
106 | + if (($attempt + $period) < $currentTime) { |
|
107 | 107 | unset($existingAttempts[$key]); |
108 | 108 | } |
109 | 109 | } |
110 | 110 | $existingAttempts = array_values($existingAttempts); |
111 | 111 | |
112 | 112 | // Store the new attempt |
113 | - $existingAttempts[] = (string)$currentTime; |
|
113 | + $existingAttempts[] = (string) $currentTime; |
|
114 | 114 | $this->cache->set($identifier, json_encode($existingAttempts)); |
115 | 115 | } |
116 | 116 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function beforeController($controller, $methodName) { |
62 | 62 | parent::beforeController($controller, $methodName); |
63 | 63 | |
64 | - if($this->reflector->hasAnnotation('BruteForceProtection')) { |
|
64 | + if ($this->reflector->hasAnnotation('BruteForceProtection')) { |
|
65 | 65 | $action = $this->reflector->getAnnotationParameter('BruteForceProtection', 'action'); |
66 | 66 | $this->throttler->sleepDelay($this->request->getRemoteAddress(), $action); |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * {@inheritDoc} |
72 | 72 | */ |
73 | 73 | public function afterController($controller, $methodName, Response $response) { |
74 | - if($this->reflector->hasAnnotation('BruteForceProtection') && $response->isThrottled()) { |
|
74 | + if ($this->reflector->hasAnnotation('BruteForceProtection') && $response->isThrottled()) { |
|
75 | 75 | $action = $this->reflector->getAnnotationParameter('BruteForceProtection', 'action'); |
76 | 76 | $ip = $this->request->getRemoteAddress(); |
77 | 77 | $this->throttler->sleepDelay($ip, $action); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $storedPassword = $share->getPassword(); |
148 | 148 | $authenticated = $this->session->get('public_link_authenticated') === $share->getId() || |
149 | 149 | $this->shareManager->checkPassword($share, $password); |
150 | - if (!empty($storedPassword) && !$authenticated ) { |
|
150 | + if (!empty($storedPassword) && !$authenticated) { |
|
151 | 151 | $response = new JSONResponse( |
152 | 152 | ['message' => 'No permission to access the share'], |
153 | 153 | Http::STATUS_BAD_REQUEST |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $httpClient = $this->clientService->newClient(); |
192 | 192 | |
193 | 193 | try { |
194 | - $response = $httpClient->post($remote . '/index.php/apps/federatedfilesharing/createFederatedShare', |
|
194 | + $response = $httpClient->post($remote.'/index.php/apps/federatedfilesharing/createFederatedShare', |
|
195 | 195 | [ |
196 | 196 | 'body' => |
197 | 197 | [ |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | // note: checkStorageAvailability will already remove the invalid share |
286 | 286 | Util::writeLog( |
287 | 287 | 'federatedfilesharing', |
288 | - 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), |
|
288 | + 'Invalid remote storage: '.get_class($e).': '.$e->getMessage(), |
|
289 | 289 | Util::DEBUG |
290 | 290 | ); |
291 | 291 | return new JSONResponse(['message' => $this->l->t('Could not authenticate to remote share, password might be wrong')], Http::STATUS_BAD_REQUEST); |
292 | 292 | } catch (\Exception $e) { |
293 | 293 | Util::writeLog( |
294 | 294 | 'federatedfilesharing', |
295 | - 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), |
|
295 | + 'Invalid remote storage: '.get_class($e).': '.$e->getMessage(), |
|
296 | 296 | Util::DEBUG |
297 | 297 | ); |
298 | 298 | $externalManager->removeShare($mount->getMountPoint()); |
@@ -311,14 +311,14 @@ discard block |
||
311 | 311 | } catch (StorageInvalidException $e) { |
312 | 312 | Util::writeLog( |
313 | 313 | 'federatedfilesharing', |
314 | - 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), |
|
314 | + 'Invalid remote storage: '.get_class($e).': '.$e->getMessage(), |
|
315 | 315 | Util::DEBUG |
316 | 316 | ); |
317 | 317 | return new JSONResponse(['message' => $this->l->t('Storage not valid')], Http::STATUS_BAD_REQUEST); |
318 | 318 | } catch (\Exception $e) { |
319 | 319 | Util::writeLog( |
320 | 320 | 'federatedfilesharing', |
321 | - 'Invalid remote storage: ' . get_class($e) . ': ' . $e->getMessage(), |
|
321 | + 'Invalid remote storage: '.get_class($e).': '.$e->getMessage(), |
|
322 | 322 | Util::DEBUG |
323 | 323 | ); |
324 | 324 | return new JSONResponse(['message' => $this->l->t('Couldn\'t add remote share')], Http::STATUS_BAD_REQUEST); |
@@ -198,7 +198,7 @@ |
||
198 | 198 | } catch (NotFoundException $e) { |
199 | 199 | return new DataResponse( |
200 | 200 | [ |
201 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
201 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
202 | 202 | ], |
203 | 203 | Http::STATUS_NOT_FOUND |
204 | 204 | ); |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <fieldset id="ldapWizard4"> |
2 | 2 | <div> |
3 | 3 | <p> |
4 | - <?php p($l->t('Groups meeting these criteria are available in %s:', $theme->getName()));?> |
|
4 | + <?php p($l->t('Groups meeting these criteria are available in %s:', $theme->getName())); ?> |
|
5 | 5 | </p> |
6 | 6 | <p> |
7 | 7 | <label for="ldap_groupfilter_objectclass"> |
8 | - <?php p($l->t('Only these object classes:'));?> |
|
8 | + <?php p($l->t('Only these object classes:')); ?> |
|
9 | 9 | </label> |
10 | 10 | |
11 | 11 | <select id="ldap_groupfilter_objectclass" multiple="multiple" |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | </p> |
15 | 15 | <p> |
16 | 16 | <label for="ldap_groupfilter_groups"> |
17 | - <?php p($l->t('Only from these groups:'));?> |
|
17 | + <?php p($l->t('Only from these groups:')); ?> |
|
18 | 18 | </label> |
19 | 19 | |
20 | - <input type="text" class="ldapManyGroupsSupport ldapManyGroupsSearch hidden" placeholder="<?php p($l->t('Search groups'));?>" /> |
|
20 | + <input type="text" class="ldapManyGroupsSupport ldapManyGroupsSearch hidden" placeholder="<?php p($l->t('Search groups')); ?>" /> |
|
21 | 21 | |
22 | 22 | <select id="ldap_groupfilter_groups" multiple="multiple" |
23 | 23 | name="ldap_groupfilter_groups" class="multiSelectPlugin"> |
@@ -27,25 +27,25 @@ discard block |
||
27 | 27 | <p class="ldapManyGroupsSupport hidden"> |
28 | 28 | <label></label> |
29 | 29 | <select class="ldapGroupList ldapGroupListAvailable" multiple="multiple" |
30 | - title="<?php p($l->t('Available groups'));?>"></select> |
|
30 | + title="<?php p($l->t('Available groups')); ?>"></select> |
|
31 | 31 | <span class="buttonSpan"> |
32 | 32 | <button class="ldapGroupListSelect" type="button">></button><br/> |
33 | 33 | <button class="ldapGroupListDeselect" type="button"><</button> |
34 | 34 | </span> |
35 | 35 | <select class="ldapGroupList ldapGroupListSelected" multiple="multiple" |
36 | - title="<?php p($l->t('Selected groups'));?>"></select> |
|
36 | + title="<?php p($l->t('Selected groups')); ?>"></select> |
|
37 | 37 | </p> |
38 | 38 | <p> |
39 | - <label><a id='toggleRawGroupFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query'));?></a></label> |
|
39 | + <label><a id='toggleRawGroupFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query')); ?></a></label> |
|
40 | 40 | </p> |
41 | 41 | <p id="ldapReadOnlyGroupFilterContainer" class="hidden ldapReadOnlyFilterContainer"> |
42 | - <label><?php p($l->t('LDAP Filter:'));?></label> |
|
42 | + <label><?php p($l->t('LDAP Filter:')); ?></label> |
|
43 | 43 | <span class="ldapFilterReadOnlyElement ldapInputColElement"></span> |
44 | 44 | </p> |
45 | 45 | <p id="rawGroupFilterContainer" class="invisible"> |
46 | 46 | <textarea type="text" id="ldap_group_filter" name="ldap_group_filter" |
47 | - placeholder="<?php p($l->t('Edit LDAP Query'));?>" |
|
48 | - title="<?php p($l->t('The filter specifies which LDAP groups shall have access to the %s instance.', $theme->getName()));?>"> |
|
47 | + placeholder="<?php p($l->t('Edit LDAP Query')); ?>" |
|
48 | + title="<?php p($l->t('The filter specifies which LDAP groups shall have access to the %s instance.', $theme->getName())); ?>"> |
|
49 | 49 | </textarea> |
50 | 50 | </p> |
51 | 51 | <p> |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | </p> |
54 | 54 | <p class="ldap_count"> |
55 | 55 | <button class="ldapGetEntryCount ldapGetGroupCount" name="ldapGetEntryCount" type="button"> |
56 | - <?php p($l->t('Verify settings and count the groups'));?> |
|
56 | + <?php p($l->t('Verify settings and count the groups')); ?> |
|
57 | 57 | </button> |
58 | 58 | <span id="ldap_group_count"></span> |
59 | 59 | </p> |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } catch (NotFoundException $e) { |
123 | 123 | return new DataResponse( |
124 | 124 | [ |
125 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
125 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
126 | 126 | ], |
127 | 127 | Http::STATUS_NOT_FOUND |
128 | 128 | ); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } else { |
163 | 163 | return new DataResponse( |
164 | 164 | [ |
165 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', array($id)) |
|
165 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" is not user editable', array($id)) |
|
166 | 166 | ], |
167 | 167 | Http::STATUS_FORBIDDEN |
168 | 168 | ); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } catch (NotFoundException $e) { |
171 | 171 | return new DataResponse( |
172 | 172 | [ |
173 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
173 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
174 | 174 | ], |
175 | 175 | Http::STATUS_NOT_FOUND |
176 | 176 | ); |
@@ -198,7 +198,7 @@ |
||
198 | 198 | } catch (NotFoundException $e) { |
199 | 199 | return new DataResponse( |
200 | 200 | [ |
201 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
201 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', array($id)) |
|
202 | 202 | ], |
203 | 203 | Http::STATUS_NOT_FOUND |
204 | 204 | ); |
@@ -11,19 +11,19 @@ |
||
11 | 11 | <p class="settings-hint"><?php p($l->t('Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing.')); ?></p> |
12 | 12 | |
13 | 13 | <p> |
14 | - <input id="autoAddServers" type="checkbox" class="checkbox" <?php if($_['autoAddServers']) p('checked'); ?> /> |
|
14 | + <input id="autoAddServers" type="checkbox" class="checkbox" <?php if ($_['autoAddServers']) p('checked'); ?> /> |
|
15 | 15 | <label for="autoAddServers"><?php p($l->t('Add server automatically once a federated share was created successfully')); ?></label> |
16 | 16 | </p> |
17 | 17 | |
18 | 18 | <ul id="listOfTrustedServers"> |
19 | - <?php foreach($_['trustedServers'] as $trustedServer) { ?> |
|
19 | + <?php foreach ($_['trustedServers'] as $trustedServer) { ?> |
|
20 | 20 | <li id="<?php p($trustedServer['id']); ?>"> |
21 | - <?php if((int)$trustedServer['status'] === TrustedServers::STATUS_OK) { ?> |
|
21 | + <?php if ((int) $trustedServer['status'] === TrustedServers::STATUS_OK) { ?> |
|
22 | 22 | <span class="status success"></span> |
23 | 23 | <?php |
24 | - } elseif( |
|
25 | - (int)$trustedServer['status'] === TrustedServers::STATUS_PENDING || |
|
26 | - (int)$trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED |
|
24 | + } elseif ( |
|
25 | + (int) $trustedServer['status'] === TrustedServers::STATUS_PENDING || |
|
26 | + (int) $trustedServer['status'] === TrustedServers::STATUS_ACCESS_REVOKED |
|
27 | 27 | ) { ?> |
28 | 28 | <span class="status indeterminate"></span> |
29 | 29 | <?php } else {?> |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $offset = $arguments['offset']; |
70 | 70 | $stopAt = $arguments['stopAt']; |
71 | 71 | |
72 | - $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')'); |
|
72 | + $this->logger->info('Building calendar index ('.$offset.'/'.$stopAt.')'); |
|
73 | 73 | |
74 | 74 | $offset = $this->buildIndex($offset, $stopAt); |
75 | 75 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | 'offset' => $offset, |
81 | 81 | 'stopAt' => $stopAt |
82 | 82 | ]); |
83 | - $this->logger->info('New building calendar index job scheduled with offset ' . $offset); |
|
83 | + $this->logger->info('New building calendar index job scheduled with offset '.$offset); |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ->orderBy('id', 'ASC'); |
101 | 101 | |
102 | 102 | $stmt = $query->execute(); |
103 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
103 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
104 | 104 | $offset = $row['id']; |
105 | 105 | |
106 | 106 | $calendarData = $row['calendardata']; |