@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <fieldset id="ldapWizard2"> |
2 | 2 | <div> |
3 | 3 | <p> |
4 | - <?php p($l->t('Listing and searching for users is constrained by these criteria:'));?> |
|
4 | + <?php p($l->t('Listing and searching for users is constrained by these criteria:')); ?> |
|
5 | 5 | </p> |
6 | 6 | <p> |
7 | 7 | <label for="ldap_userfilter_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_userfilter_objectclass" multiple="multiple" |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | </p> |
15 | 15 | <p> |
16 | 16 | <label></label> |
17 | - <span class="ldapInputColElement"><?php p($l->t('The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin.'));?></span> |
|
17 | + <span class="ldapInputColElement"><?php p($l->t('The most common object classes for users are organizationalPerson, person, user, and inetOrgPerson. If you are not sure which object class to select, please consult your directory admin.')); ?></span> |
|
18 | 18 | </p> |
19 | 19 | <p> |
20 | 20 | <label for="ldap_userfilter_groups"> |
21 | - <?php p($l->t('Only from these groups:'));?> |
|
21 | + <?php p($l->t('Only from these groups:')); ?> |
|
22 | 22 | </label> |
23 | 23 | |
24 | - <input type="text" class="ldapManyGroupsSupport ldapManyGroupsSearch hidden" placeholder="<?php p($l->t('Search groups'));?>" /> |
|
24 | + <input type="text" class="ldapManyGroupsSupport ldapManyGroupsSearch hidden" placeholder="<?php p($l->t('Search groups')); ?>" /> |
|
25 | 25 | |
26 | 26 | <select id="ldap_userfilter_groups" multiple="multiple" |
27 | 27 | name="ldap_userfilter_groups" class="multiSelectPlugin"> |
@@ -30,26 +30,26 @@ discard block |
||
30 | 30 | <p class="ldapManyGroupsSupport hidden"> |
31 | 31 | <label></label> |
32 | 32 | <select class="ldapGroupList ldapGroupListAvailable" multiple="multiple" |
33 | - title="<?php p($l->t('Available groups'));?>"></select> |
|
33 | + title="<?php p($l->t('Available groups')); ?>"></select> |
|
34 | 34 | <span class="buttonSpan"> |
35 | 35 | <button class="ldapGroupListSelect" type="button">></button><br/> |
36 | 36 | <button class="ldapGroupListDeselect" type="button"><</button> |
37 | 37 | </span> |
38 | 38 | <select class="ldapGroupList ldapGroupListSelected" multiple="multiple" |
39 | - title="<?php p($l->t('Selected groups'));?>"></select> |
|
39 | + title="<?php p($l->t('Selected groups')); ?>"></select> |
|
40 | 40 | </p> |
41 | 41 | <p> |
42 | - <label><a id='toggleRawUserFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query'));?></a></label> |
|
42 | + <label><a id='toggleRawUserFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query')); ?></a></label> |
|
43 | 43 | </p> |
44 | 44 | <p id="ldapReadOnlyUserFilterContainer" class="hidden ldapReadOnlyFilterContainer"> |
45 | - <label><?php p($l->t('LDAP Filter:'));?></label> |
|
45 | + <label><?php p($l->t('LDAP Filter:')); ?></label> |
|
46 | 46 | <span class="ldapFilterReadOnlyElement ldapInputColElement"></span> |
47 | 47 | </p> |
48 | 48 | <p id="rawUserFilterContainer"> |
49 | 49 | <textarea type="text" id="ldap_userlist_filter" name="ldap_userlist_filter" |
50 | 50 | class="ldapFilterInputElement" |
51 | - placeholder="<?php p($l->t('Edit LDAP Query'));?>" |
|
52 | - title="<?php p($l->t('The filter specifies which LDAP users shall have access to the %s instance.', [$theme->getName()]));?>"> |
|
51 | + placeholder="<?php p($l->t('Edit LDAP Query')); ?>" |
|
52 | + title="<?php p($l->t('The filter specifies which LDAP users shall have access to the %s instance.', [$theme->getName()])); ?>"> |
|
53 | 53 | </textarea> |
54 | 54 | </p> |
55 | 55 | <p> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | </p> |
58 | 58 | <p class="ldap_count"> |
59 | 59 | <button class="ldapGetEntryCount ldapGetUserCount" name="ldapGetEntryCount" type="button"> |
60 | - <?php p($l->t('Verify settings and count users'));?> |
|
60 | + <?php p($l->t('Verify settings and count users')); ?> |
|
61 | 61 | </button> |
62 | 62 | <span id="ldap_user_count"></span> |
63 | 63 | </p> |
@@ -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> |
@@ -1,29 +1,29 @@ discard block |
||
1 | 1 | <fieldset id="ldapWizard3"> |
2 | 2 | <div> |
3 | 3 | <p> |
4 | - <?php p($l->t('When logging in, %s will find the user based on the following attributes:', [$theme->getName()]));?> |
|
4 | + <?php p($l->t('When logging in, %s will find the user based on the following attributes:', [$theme->getName()])); ?> |
|
5 | 5 | </p> |
6 | 6 | <p> |
7 | 7 | <label for="ldap_loginfilter_username"> |
8 | - <?php p($l->t('LDAP / AD Username:'));?> |
|
8 | + <?php p($l->t('LDAP / AD Username:')); ?> |
|
9 | 9 | </label> |
10 | 10 | |
11 | 11 | <input type="checkbox" id="ldap_loginfilter_username" |
12 | - title="<?php p($l->t('Allows login against the LDAP / AD username, which is either "uid" or "sAMAccountName" and will be detected.'));?>" |
|
12 | + title="<?php p($l->t('Allows login against the LDAP / AD username, which is either "uid" or "sAMAccountName" and will be detected.')); ?>" |
|
13 | 13 | name="ldap_loginfilter_username" value="1" /> |
14 | 14 | </p> |
15 | 15 | <p> |
16 | 16 | <label for="ldap_loginfilter_email"> |
17 | - <?php p($l->t('LDAP / AD Email Address:'));?> |
|
17 | + <?php p($l->t('LDAP / AD Email Address:')); ?> |
|
18 | 18 | </label> |
19 | 19 | |
20 | 20 | <input type="checkbox" id="ldap_loginfilter_email" |
21 | - title="<?php p($l->t('Allows login against an email attribute. "mail" and "mailPrimaryAddress" allowed.'));?>" |
|
21 | + title="<?php p($l->t('Allows login against an email attribute. "mail" and "mailPrimaryAddress" allowed.')); ?>" |
|
22 | 22 | name="ldap_loginfilter_email" value="1" /> |
23 | 23 | </p> |
24 | 24 | <p> |
25 | 25 | <label for="ldap_loginfilter_attributes"> |
26 | - <?php p($l->t('Other Attributes:'));?> |
|
26 | + <?php p($l->t('Other Attributes:')); ?> |
|
27 | 27 | </label> |
28 | 28 | |
29 | 29 | <select id="ldap_loginfilter_attributes" multiple="multiple" |
@@ -31,17 +31,17 @@ discard block |
||
31 | 31 | </select> |
32 | 32 | </p> |
33 | 33 | <p> |
34 | - <label><a id='toggleRawLoginFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query'));?></a></label> |
|
34 | + <label><a id='toggleRawLoginFilter' class='ldapToggle'>↓ <?php p($l->t('Edit LDAP Query')); ?></a></label> |
|
35 | 35 | </p> |
36 | 36 | <p id="ldapReadOnlyLoginFilterContainer" class="hidden ldapReadOnlyFilterContainer"> |
37 | - <label><?php p($l->t('LDAP Filter:'));?></label> |
|
37 | + <label><?php p($l->t('LDAP Filter:')); ?></label> |
|
38 | 38 | <span class="ldapFilterReadOnlyElement ldapInputColElement"></span> |
39 | 39 | </p> |
40 | 40 | <p id="rawLoginFilterContainer" class="invisible"> |
41 | 41 | <textarea type="text" id="ldap_login_filter" name="ldap_login_filter" |
42 | 42 | class="ldapFilterInputElement" |
43 | - placeholder="<?php p($l->t('Edit LDAP Query'));?>" |
|
44 | - title="<?php p($l->t('Defines the filter to apply, when login is attempted. "%%uid" replaces the username in the login action. Example: "uid=%%uid"'));?>"> |
|
43 | + placeholder="<?php p($l->t('Edit LDAP Query')); ?>" |
|
44 | + title="<?php p($l->t('Defines the filter to apply, when login is attempted. "%%uid" replaces the username in the login action. Example: "uid=%%uid"')); ?>"> |
|
45 | 45 | </textarea> |
46 | 46 | </p> |
47 | 47 | <p> |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | </p> |
50 | 50 | <p class="ldap_verify"> |
51 | 51 | <input type="text" id="ldap_test_loginname" name="ldap_test_loginname" |
52 | - placeholder="<?php p($l->t('Test Loginname'));?>" |
|
52 | + placeholder="<?php p($l->t('Test Loginname')); ?>" |
|
53 | 53 | class="ldapVerifyInput" |
54 | 54 | title="Attempts to receive a DN for the given loginname and the current login filter"/> |
55 | 55 | <button class="ldapVerifyLoginName" name="ldapTestLoginSettings" type="button" disabled="disabled"> |
56 | - <?php p($l->t('Verify settings'));?> |
|
56 | + <?php p($l->t('Verify settings')); ?> |
|
57 | 57 | </button> |
58 | 58 | </p> |
59 | 59 | <?php print_unescaped($_['wizardControls']); ?> |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | <ul> |
15 | 15 | <li><?php p($l->t('Remote Address: %s', [$_['remoteAddr']])) ?></li> |
16 | 16 | <li><?php p($l->t('Request ID: %s', [$_['requestID']])) ?></li> |
17 | - <?php if($_['debugMode']): ?> |
|
17 | + <?php if ($_['debugMode']): ?> |
|
18 | 18 | <li><?php p($l->t('Type: %s', [$_['errorClass']])) ?></li> |
19 | 19 | <li><?php p($l->t('Code: %s', [$_['errorCode']])) ?></li> |
20 | 20 | <li><?php p($l->t('Message: %s', [$_['errorMsg']])) ?></li> |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | <?php endif; ?> |
24 | 24 | </ul> |
25 | 25 | |
26 | - <?php if($_['debugMode']): ?> |
|
26 | + <?php if ($_['debugMode']): ?> |
|
27 | 27 | <br /> |
28 | 28 | <h3><?php p($l->t('Trace')) ?></h3> |
29 | 29 | <pre><?php p($_['trace']) ?></pre> |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | * @throws \Exception |
67 | 67 | */ |
68 | 68 | public function beforeController($controller, $methodName) { |
69 | - if(!$this->reflector->hasAnnotation('NoSubadminRequired')) { |
|
70 | - if(!$this->isSubAdmin) { |
|
69 | + if (!$this->reflector->hasAnnotation('NoSubadminRequired')) { |
|
70 | + if (!$this->isSubAdmin) { |
|
71 | 71 | throw new NotAdminException($this->l10n->t('Logged in user must be a subadmin')); |
72 | 72 | } |
73 | 73 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @throws \Exception |
83 | 83 | */ |
84 | 84 | public function afterException($controller, $methodName, \Exception $exception) { |
85 | - if($exception instanceof NotAdminException) { |
|
85 | + if ($exception instanceof NotAdminException) { |
|
86 | 86 | $response = new TemplateResponse('core', '403', array(), 'guest'); |
87 | 87 | $response->setStatus(Http::STATUS_FORBIDDEN); |
88 | 88 | return $response; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $activity->setApp('systemtags') |
111 | 111 | ->setType('systemtags') |
112 | 112 | ->setAuthor($actor) |
113 | - ->setObject('systemtag', (int)$tag->getId(), $tag->getName()); |
|
113 | + ->setObject('systemtag', (int) $tag->getId(), $tag->getName()); |
|
114 | 114 | if ($event->getEvent() === ManagerEvent::EVENT_CREATE) { |
115 | 115 | $activity->setSubject(Provider::CREATE_TAG, [ |
116 | 116 | $actor, |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function mapperEvent(MapperEvent $event) { |
152 | 152 | $tagIds = $event->getTags(); |
153 | - if ($event->getObjectType() !== 'files' ||empty($tagIds) |
|
153 | + if ($event->getObjectType() !== 'files' || empty($tagIds) |
|
154 | 154 | || !in_array($event->getEvent(), [MapperEvent::EVENT_ASSIGN, MapperEvent::EVENT_UNASSIGN]) |
155 | 155 | || !$this->appManager->isInstalled('activity')) { |
156 | 156 | // System tags not for files, no tags, not (un-)assigning or no activity-app enabled (save the energy) |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ->setObject($event->getObjectType(), (int) $event->getObjectId()); |
203 | 203 | |
204 | 204 | foreach ($users as $user => $path) { |
205 | - $user = (string)$user; // numerical ids could be ints which are not accepted everywhere |
|
205 | + $user = (string) $user; // numerical ids could be ints which are not accepted everywhere |
|
206 | 206 | $activity->setAffectedUser($user); |
207 | 207 | |
208 | 208 | foreach ($tags as $tag) { |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) { |
160 | - $keys = array_map(function ($header) { |
|
160 | + $keys = array_map(function($header) { |
|
161 | 161 | return strtolower(str_replace(' ', '_', $header)); |
162 | 162 | }, $headers); |
163 | 163 | |
164 | - $pairs = array_map(function (StorageConfig $config) use ($keys, $userId) { |
|
164 | + $pairs = array_map(function(StorageConfig $config) use ($keys, $userId) { |
|
165 | 165 | $values = [ |
166 | 166 | $config->getId(), |
167 | 167 | $config->getMountPoint(), |
@@ -195,23 +195,23 @@ discard block |
||
195 | 195 | 'encoding_compatibility' => false, |
196 | 196 | 'readonly' => false, |
197 | 197 | ]; |
198 | - $rows = array_map(function (StorageConfig $config) use ($userId, $defaultMountOptions, $full) { |
|
198 | + $rows = array_map(function(StorageConfig $config) use ($userId, $defaultMountOptions, $full) { |
|
199 | 199 | $storageConfig = $config->getBackendOptions(); |
200 | 200 | $keys = array_keys($storageConfig); |
201 | 201 | $values = array_values($storageConfig); |
202 | 202 | |
203 | 203 | if (!$full) { |
204 | - $values = array_map(function ($value) { |
|
204 | + $values = array_map(function($value) { |
|
205 | 205 | if (is_string($value) && strlen($value) > 32) { |
206 | - return substr($value, 0, 6) . '...' . substr($value, -6, 6); |
|
206 | + return substr($value, 0, 6).'...'.substr($value, -6, 6); |
|
207 | 207 | } else { |
208 | 208 | return $value; |
209 | 209 | } |
210 | 210 | }, $values); |
211 | 211 | } |
212 | 212 | |
213 | - $configStrings = array_map(function ($key, $value) { |
|
214 | - return $key . ': ' . json_encode($value); |
|
213 | + $configStrings = array_map(function($key, $value) { |
|
214 | + return $key.': '.json_encode($value); |
|
215 | 215 | }, $keys, $values); |
216 | 216 | $configString = implode(', ', $configStrings); |
217 | 217 | |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | $keys = array_keys($mountOptions); |
226 | 226 | $values = array_values($mountOptions); |
227 | 227 | |
228 | - $optionsStrings = array_map(function ($key, $value) { |
|
229 | - return $key . ': ' . json_encode($value); |
|
228 | + $optionsStrings = array_map(function($key, $value) { |
|
229 | + return $key.': '.json_encode($value); |
|
230 | 230 | }, $keys, $values); |
231 | 231 | $optionsString = implode(', ', $optionsStrings); |
232 | 232 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $dir = $pathinfo['dirname']; |
59 | 59 | $i = 2; |
60 | 60 | while ($view->file_exists($path) || in_array($path, $excludeList)) { |
61 | - $path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext); |
|
61 | + $path = Filesystem::normalizePath($dir.'/'.$name.' ('.$i.')'.$ext); |
|
62 | 62 | $i++; |
63 | 63 | } |
64 | 64 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $dir = ''; |
83 | 83 | $subdirs = explode('/', $shareFolder); |
84 | 84 | foreach ($subdirs as $subdir) { |
85 | - $dir = $dir . '/' . $subdir; |
|
85 | + $dir = $dir.'/'.$subdir; |
|
86 | 86 | if (!$view->is_dir($dir)) { |
87 | 87 | $view->mkdir($dir); |
88 | 88 | } |
@@ -165,24 +165,24 @@ discard block |
||
165 | 165 | $configuredDatabases = $this->config->getValue('supportedDatabases', |
166 | 166 | ['sqlite', 'mysql', 'pgsql']); |
167 | 167 | } |
168 | - if(!is_array($configuredDatabases)) { |
|
168 | + if (!is_array($configuredDatabases)) { |
|
169 | 169 | throw new Exception('Supported databases are not properly configured.'); |
170 | 170 | } |
171 | 171 | |
172 | 172 | $supportedDatabases = array(); |
173 | 173 | |
174 | - foreach($configuredDatabases as $database) { |
|
175 | - if(array_key_exists($database, $availableDatabases)) { |
|
174 | + foreach ($configuredDatabases as $database) { |
|
175 | + if (array_key_exists($database, $availableDatabases)) { |
|
176 | 176 | $working = false; |
177 | 177 | $type = $availableDatabases[$database]['type']; |
178 | 178 | $call = $availableDatabases[$database]['call']; |
179 | 179 | |
180 | 180 | if ($type === 'function') { |
181 | 181 | $working = $this->is_callable($call); |
182 | - } elseif($type === 'pdo') { |
|
182 | + } elseif ($type === 'pdo') { |
|
183 | 183 | $working = in_array($call, $this->getAvailableDbDriversForPdo(), true); |
184 | 184 | } |
185 | - if($working) { |
|
185 | + if ($working) { |
|
186 | 186 | $supportedDatabases[$database] = $availableDatabases[$database]['name']; |
187 | 187 | } |
188 | 188 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | // Create data directory to test whether the .htaccess works |
209 | 209 | // Notice that this is not necessarily the same data directory as the one |
210 | 210 | // that will effectively be used. |
211 | - if(!file_exists($dataDir)) { |
|
211 | + if (!file_exists($dataDir)) { |
|
212 | 212 | @mkdir($dataDir); |
213 | 213 | } |
214 | 214 | $htAccessWorking = true; |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | if (\OC_Util::runningOnMac()) { |
232 | 232 | $errors[] = [ |
233 | 233 | 'error' => $this->l10n->t( |
234 | - 'Mac OS X is not supported and %s will not work properly on this platform. ' . |
|
234 | + 'Mac OS X is not supported and %s will not work properly on this platform. '. |
|
235 | 235 | 'Use it at your own risk! ', |
236 | 236 | [$this->defaults->getName()] |
237 | 237 | ), |
@@ -239,10 +239,10 @@ discard block |
||
239 | 239 | ]; |
240 | 240 | } |
241 | 241 | |
242 | - if($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) { |
|
242 | + if ($this->iniWrapper->getString('open_basedir') !== '' && PHP_INT_SIZE === 4) { |
|
243 | 243 | $errors[] = [ |
244 | 244 | 'error' => $this->l10n->t( |
245 | - 'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. ' . |
|
245 | + 'It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. '. |
|
246 | 246 | 'This will lead to problems with files over 4 GB and is highly discouraged.', |
247 | 247 | [$this->defaults->getName()] |
248 | 248 | ), |
@@ -272,13 +272,13 @@ discard block |
||
272 | 272 | $error = array(); |
273 | 273 | $dbType = $options['dbtype']; |
274 | 274 | |
275 | - if(empty($options['adminlogin'])) { |
|
275 | + if (empty($options['adminlogin'])) { |
|
276 | 276 | $error[] = $l->t('Set an admin username.'); |
277 | 277 | } |
278 | - if(empty($options['adminpass'])) { |
|
278 | + if (empty($options['adminpass'])) { |
|
279 | 279 | $error[] = $l->t('Set an admin password.'); |
280 | 280 | } |
281 | - if(empty($options['directory'])) { |
|
281 | + if (empty($options['directory'])) { |
|
282 | 282 | $options['directory'] = \OC::$SERVERROOT."/data"; |
283 | 283 | } |
284 | 284 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | $request = \OC::$server->getRequest(); |
308 | 308 | |
309 | 309 | //no errors, good |
310 | - if(isset($options['trusted_domains']) |
|
310 | + if (isset($options['trusted_domains']) |
|
311 | 311 | && is_array($options['trusted_domains'])) { |
312 | 312 | $trustedDomains = $options['trusted_domains']; |
313 | 313 | } else { |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | ]; |
336 | 336 | |
337 | 337 | if ($this->config->getValue('overwrite.cli.url', null) === null) { |
338 | - $newConfigValues['overwrite.cli.url'] = $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . \OC::$WEBROOT; |
|
338 | + $newConfigValues['overwrite.cli.url'] = $request->getServerProtocol().'://'.$request->getInsecureServerHost().\OC::$WEBROOT; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | $this->config->setValues($newConfigValues); |
@@ -353,20 +353,20 @@ discard block |
||
353 | 353 | return $error; |
354 | 354 | } catch (Exception $e) { |
355 | 355 | $error[] = [ |
356 | - 'error' => 'Error while trying to create admin user: ' . $e->getMessage(), |
|
356 | + 'error' => 'Error while trying to create admin user: '.$e->getMessage(), |
|
357 | 357 | 'hint' => '', |
358 | 358 | ]; |
359 | 359 | return $error; |
360 | 360 | } |
361 | 361 | |
362 | 362 | //create the user and group |
363 | - $user = null; |
|
363 | + $user = null; |
|
364 | 364 | try { |
365 | 365 | $user = \OC::$server->getUserManager()->createUser($username, $password); |
366 | 366 | if (!$user) { |
367 | 367 | $error[] = "User <$username> could not be created."; |
368 | 368 | } |
369 | - } catch(Exception $exception) { |
|
369 | + } catch (Exception $exception) { |
|
370 | 370 | $error[] = $exception->getMessage(); |
371 | 371 | } |
372 | 372 | |
@@ -376,14 +376,14 @@ discard block |
||
376 | 376 | $config->setAppValue('core', 'lastupdatedat', microtime(true)); |
377 | 377 | $config->setAppValue('core', 'vendor', $this->getVendor()); |
378 | 378 | |
379 | - $group =\OC::$server->getGroupManager()->createGroup('admin'); |
|
379 | + $group = \OC::$server->getGroupManager()->createGroup('admin'); |
|
380 | 380 | $group->addUser($user); |
381 | 381 | |
382 | 382 | // Install shipped apps and specified app bundles |
383 | 383 | Installer::installShippedApps(); |
384 | 384 | $bundleFetcher = new BundleFetcher(\OC::$server->getL10N('lib')); |
385 | 385 | $defaultInstallationBundles = $bundleFetcher->getDefaultInstallationBundle(); |
386 | - foreach($defaultInstallationBundles as $bundle) { |
|
386 | + foreach ($defaultInstallationBundles as $bundle) { |
|
387 | 387 | try { |
388 | 388 | $this->installer->installAppBundle($bundle); |
389 | 389 | } catch (Exception $e) {} |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | $config = \OC::$server->getSystemConfig(); |
437 | 437 | |
438 | 438 | // For CLI read the value from overwrite.cli.url |
439 | - if(\OC::$CLI) { |
|
439 | + if (\OC::$CLI) { |
|
440 | 440 | $webRoot = $config->getValue('overwrite.cli.url', ''); |
441 | - if($webRoot === '') { |
|
441 | + if ($webRoot === '') { |
|
442 | 442 | return false; |
443 | 443 | } |
444 | 444 | $webRoot = parse_url($webRoot, PHP_URL_PATH); |
@@ -465,14 +465,14 @@ discard block |
||
465 | 465 | $htaccessContent = explode($content, $htaccessContent, 2)[0]; |
466 | 466 | |
467 | 467 | //custom 403 error page |
468 | - $content.= "\nErrorDocument 403 ".$webRoot."/"; |
|
468 | + $content .= "\nErrorDocument 403 ".$webRoot."/"; |
|
469 | 469 | |
470 | 470 | //custom 404 error page |
471 | - $content.= "\nErrorDocument 404 ".$webRoot."/"; |
|
471 | + $content .= "\nErrorDocument 404 ".$webRoot."/"; |
|
472 | 472 | |
473 | 473 | // Add rewrite rules if the RewriteBase is configured |
474 | 474 | $rewriteBase = $config->getValue('htaccess.RewriteBase', ''); |
475 | - if($rewriteBase !== '') { |
|
475 | + if ($rewriteBase !== '') { |
|
476 | 476 | $content .= "\n<IfModule mod_rewrite.c>"; |
477 | 477 | $content .= "\n Options -MultiViews"; |
478 | 478 | $content .= "\n RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]"; |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $content .= "\n RewriteCond %{REQUEST_FILENAME} !/ocs-provider/"; |
493 | 493 | $content .= "\n RewriteCond %{REQUEST_URI} !^/\\.well-known/(acme-challenge|pki-validation)/.*"; |
494 | 494 | $content .= "\n RewriteRule . index.php [PT,E=PATH_INFO:$1]"; |
495 | - $content .= "\n RewriteBase " . $rewriteBase; |
|
495 | + $content .= "\n RewriteBase ".$rewriteBase; |
|
496 | 496 | $content .= "\n <IfModule mod_env.c>"; |
497 | 497 | $content .= "\n SetEnv front_controller_active true"; |
498 | 498 | $content .= "\n <IfModule mod_dir.c>"; |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | |
505 | 505 | if ($content !== '') { |
506 | 506 | //suppress errors in case we don't have permissions for it |
507 | - return (bool) @file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content . "\n"); |
|
507 | + return (bool) @file_put_contents($setupHelper->pathToHtaccess(), $htaccessContent.$content."\n"); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | return false; |
@@ -512,25 +512,25 @@ discard block |
||
512 | 512 | |
513 | 513 | public static function protectDataDirectory() { |
514 | 514 | //Require all denied |
515 | - $now = date('Y-m-d H:i:s'); |
|
515 | + $now = date('Y-m-d H:i:s'); |
|
516 | 516 | $content = "# Generated by Nextcloud on $now\n"; |
517 | - $content.= "# line below if for Apache 2.4\n"; |
|
518 | - $content.= "<ifModule mod_authz_core.c>\n"; |
|
519 | - $content.= "Require all denied\n"; |
|
520 | - $content.= "</ifModule>\n\n"; |
|
521 | - $content.= "# line below if for Apache 2.2\n"; |
|
522 | - $content.= "<ifModule !mod_authz_core.c>\n"; |
|
523 | - $content.= "deny from all\n"; |
|
524 | - $content.= "Satisfy All\n"; |
|
525 | - $content.= "</ifModule>\n\n"; |
|
526 | - $content.= "# section for Apache 2.2 and 2.4\n"; |
|
527 | - $content.= "<ifModule mod_autoindex.c>\n"; |
|
528 | - $content.= "IndexIgnore *\n"; |
|
529 | - $content.= "</ifModule>\n"; |
|
530 | - |
|
531 | - $baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data'); |
|
532 | - file_put_contents($baseDir . '/.htaccess', $content); |
|
533 | - file_put_contents($baseDir . '/index.html', ''); |
|
517 | + $content .= "# line below if for Apache 2.4\n"; |
|
518 | + $content .= "<ifModule mod_authz_core.c>\n"; |
|
519 | + $content .= "Require all denied\n"; |
|
520 | + $content .= "</ifModule>\n\n"; |
|
521 | + $content .= "# line below if for Apache 2.2\n"; |
|
522 | + $content .= "<ifModule !mod_authz_core.c>\n"; |
|
523 | + $content .= "deny from all\n"; |
|
524 | + $content .= "Satisfy All\n"; |
|
525 | + $content .= "</ifModule>\n\n"; |
|
526 | + $content .= "# section for Apache 2.2 and 2.4\n"; |
|
527 | + $content .= "<ifModule mod_autoindex.c>\n"; |
|
528 | + $content .= "IndexIgnore *\n"; |
|
529 | + $content .= "</ifModule>\n"; |
|
530 | + |
|
531 | + $baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data'); |
|
532 | + file_put_contents($baseDir.'/.htaccess', $content); |
|
533 | + file_put_contents($baseDir.'/index.html', ''); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | /** |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | private function getVendor() { |
544 | 544 | // this should really be a JSON file |
545 | - require \OC::$SERVERROOT . '/version.php'; |
|
545 | + require \OC::$SERVERROOT.'/version.php'; |
|
546 | 546 | /** @var string $vendor */ |
547 | 547 | return (string) $vendor; |
548 | 548 | } |