@@ -34,97 +34,181 @@ discard block |
||
34 | 34 | <p class="settings-hint"><?php p($l->t('As admin you can fine-tune the sharing behavior. Please see the documentation for more information.'));?></p> |
35 | 35 | <p id="enable"> |
36 | 36 | <input type="checkbox" name="shareapi_enabled" id="shareAPIEnabled" class="checkbox" |
37 | - value="1" <?php if ($_['shareAPIEnabled'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
37 | + value="1" <?php if ($_['shareAPIEnabled'] === 'yes') { |
|
38 | + print_unescaped('checked="checked"'); |
|
39 | +} |
|
40 | +?> /> |
|
38 | 41 | <label for="shareAPIEnabled"><?php p($l->t('Allow apps to use the Share API'));?></label><br/> |
39 | 42 | </p> |
40 | 43 | |
41 | - <p id="internalShareSettings" class="indent <?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
44 | + <p id="internalShareSettings" class="indent <?php if ($_['shareAPIEnabled'] === 'no') { |
|
45 | + p('hidden'); |
|
46 | +} |
|
47 | +?>"> |
|
42 | 48 | <input type="checkbox" name="shareapi_default_internal_expire_date" id="shareapiDefaultInternalExpireDate" class="checkbox" |
43 | - value="1" <?php if ($_['shareDefaultInternalExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
49 | + value="1" <?php if ($_['shareDefaultInternalExpireDateSet'] === 'yes') { |
|
50 | + print_unescaped('checked="checked"'); |
|
51 | +} |
|
52 | +?> /> |
|
44 | 53 | <label for="shareapiDefaultInternalExpireDate"><?php p($l->t('Set default expiration date for shares'));?></label><br/> |
45 | 54 | </p> |
46 | - <p id="setDefaultInternalExpireDate" class="double-indent <?php if ($_['shareDefaultInternalExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
55 | + <p id="setDefaultInternalExpireDate" class="double-indent <?php if ($_['shareDefaultInternalExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') { |
|
56 | + p('hidden'); |
|
57 | +} |
|
58 | +?>"> |
|
47 | 59 | <?php p($l->t( 'Expire after ' )); ?> |
48 | 60 | <input type="text" name='shareapi_internal_expire_after_n_days' id="shareapiInternalExpireAfterNDays" placeholder="<?php p('7')?>" |
49 | 61 | value='<?php p($_['shareInternalExpireAfterNDays']) ?>' /> |
50 | 62 | <?php p($l->t( 'days' )); ?> |
51 | 63 | <input type="checkbox" name="shareapi_internal_enforce_expire_date" id="shareapiInternalEnforceExpireDate" class="checkbox" |
52 | - value="1" <?php if ($_['shareInternalEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
64 | + value="1" <?php if ($_['shareInternalEnforceExpireDate'] === 'yes') { |
|
65 | + print_unescaped('checked="checked"'); |
|
66 | +} |
|
67 | +?> /> |
|
53 | 68 | <label for="shareapiInternalEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> |
54 | 69 | </p> |
55 | 70 | |
56 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
71 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
72 | + p('hidden'); |
|
73 | +} |
|
74 | +?>"> |
|
57 | 75 | <input type="checkbox" name="shareapi_allow_links" id="allowLinks" class="checkbox" |
58 | - value="1" <?php if ($_['allowLinks'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
76 | + value="1" <?php if ($_['allowLinks'] === 'yes') { |
|
77 | + print_unescaped('checked="checked"'); |
|
78 | +} |
|
79 | +?> /> |
|
59 | 80 | <label for="allowLinks"><?php p($l->t('Allow users to share via link'));?></label><br/> |
60 | 81 | </p> |
61 | 82 | |
62 | - <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
83 | + <p id="publicLinkSettings" class="indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareAPIEnabled'] === 'no') { |
|
84 | + p('hidden'); |
|
85 | +} |
|
86 | +?>"> |
|
63 | 87 | <input type="checkbox" name="shareapi_allow_public_upload" id="allowPublicUpload" class="checkbox" |
64 | - value="1" <?php if ($_['allowPublicUpload'] == 'yes') print_unescaped('checked="checked"'); ?> /> |
|
88 | + value="1" <?php if ($_['allowPublicUpload'] == 'yes') { |
|
89 | + print_unescaped('checked="checked"'); |
|
90 | +} |
|
91 | +?> /> |
|
65 | 92 | <label for="allowPublicUpload"><?php p($l->t('Allow public uploads'));?></label><br/> |
66 | 93 | <input type="checkbox" name="shareapi_enable_link_password_by_default" id="enableLinkPasswordByDefault" class="checkbox" |
67 | - value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
94 | + value="1" <?php if ($_['enableLinkPasswordByDefault'] === 'yes') { |
|
95 | + print_unescaped('checked="checked"'); |
|
96 | +} |
|
97 | +?> /> |
|
68 | 98 | <label for="enableLinkPasswordByDefault"><?php p($l->t('Always ask for a password'));?></label><br/> |
69 | 99 | <input type="checkbox" name="shareapi_enforce_links_password" id="enforceLinkPassword" class="checkbox" |
70 | - value="1" <?php if ($_['enforceLinkPassword']) print_unescaped('checked="checked"'); ?> /> |
|
100 | + value="1" <?php if ($_['enforceLinkPassword']) { |
|
101 | + print_unescaped('checked="checked"'); |
|
102 | +} |
|
103 | +?> /> |
|
71 | 104 | <label for="enforceLinkPassword"><?php p($l->t('Enforce password protection'));?></label><br/> |
72 | 105 | |
73 | 106 | <input type="checkbox" name="shareapi_default_expire_date" id="shareapiDefaultExpireDate" class="checkbox" |
74 | - value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
107 | + value="1" <?php if ($_['shareDefaultExpireDateSet'] === 'yes') { |
|
108 | + print_unescaped('checked="checked"'); |
|
109 | +} |
|
110 | +?> /> |
|
75 | 111 | <label for="shareapiDefaultExpireDate"><?php p($l->t('Set default expiration date for link shares'));?></label><br/> |
76 | 112 | |
77 | 113 | </p> |
78 | - <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
114 | + <p id="setDefaultExpireDate" class="double-indent <?php if ($_['allowLinks'] !== 'yes' || $_['shareDefaultExpireDateSet'] === 'no' || $_['shareAPIEnabled'] === 'no') { |
|
115 | + p('hidden'); |
|
116 | +} |
|
117 | +?>"> |
|
79 | 118 | <?php p($l->t( 'Expire after ' )); ?> |
80 | 119 | <input type="text" name='shareapi_expire_after_n_days' id="shareapiExpireAfterNDays" placeholder="<?php p('7')?>" |
81 | 120 | value='<?php p($_['shareExpireAfterNDays']) ?>' /> |
82 | 121 | <?php p($l->t( 'days' )); ?> |
83 | 122 | <input type="checkbox" name="shareapi_enforce_expire_date" id="shareapiEnforceExpireDate" class="checkbox" |
84 | - value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
123 | + value="1" <?php if ($_['shareEnforceExpireDate'] === 'yes') { |
|
124 | + print_unescaped('checked="checked"'); |
|
125 | +} |
|
126 | +?> /> |
|
85 | 127 | <label for="shareapiEnforceExpireDate"><?php p($l->t('Enforce expiration date'));?></label><br/> |
86 | 128 | </p> |
87 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
129 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
130 | + p('hidden'); |
|
131 | +} |
|
132 | +?>"> |
|
88 | 133 | <input type="checkbox" name="shareapi_allow_resharing" id="allowResharing" class="checkbox" |
89 | - value="1" <?php if ($_['allowResharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
134 | + value="1" <?php if ($_['allowResharing'] === 'yes') { |
|
135 | + print_unescaped('checked="checked"'); |
|
136 | +} |
|
137 | +?> /> |
|
90 | 138 | <label for="allowResharing"><?php p($l->t('Allow resharing'));?></label><br/> |
91 | 139 | </p> |
92 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
140 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
141 | + p('hidden'); |
|
142 | +} |
|
143 | +?>"> |
|
93 | 144 | <input type="checkbox" name="shareapi_allow_group_sharing" id="allowGroupSharing" class="checkbox" |
94 | - value="1" <?php if ($_['allowGroupSharing'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
145 | + value="1" <?php if ($_['allowGroupSharing'] === 'yes') { |
|
146 | + print_unescaped('checked="checked"'); |
|
147 | +} |
|
148 | +?> /> |
|
95 | 149 | <label for="allowGroupSharing"><?php p($l->t('Allow sharing with groups'));?></label><br /> |
96 | 150 | </p> |
97 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
151 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
152 | + p('hidden'); |
|
153 | +} |
|
154 | +?>"> |
|
98 | 155 | <input type="checkbox" name="shareapi_only_share_with_group_members" id="onlyShareWithGroupMembers" class="checkbox" |
99 | - value="1" <?php if ($_['onlyShareWithGroupMembers']) print_unescaped('checked="checked"'); ?> /> |
|
156 | + value="1" <?php if ($_['onlyShareWithGroupMembers']) { |
|
157 | + print_unescaped('checked="checked"'); |
|
158 | +} |
|
159 | +?> /> |
|
100 | 160 | <label for="onlyShareWithGroupMembers"><?php p($l->t('Restrict users to only share with users in their groups'));?></label><br/> |
101 | 161 | </p> |
102 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
162 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
163 | + p('hidden'); |
|
164 | +} |
|
165 | +?>"> |
|
103 | 166 | <input type="checkbox" name="shareapi_exclude_groups" id="shareapiExcludeGroups" class="checkbox" |
104 | - value="1" <?php if ($_['shareExcludeGroups']) print_unescaped('checked="checked"'); ?> /> |
|
167 | + value="1" <?php if ($_['shareExcludeGroups']) { |
|
168 | + print_unescaped('checked="checked"'); |
|
169 | +} |
|
170 | +?> /> |
|
105 | 171 | <label for="shareapiExcludeGroups"><?php p($l->t('Exclude groups from sharing'));?></label><br/> |
106 | 172 | </p> |
107 | - <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
173 | + <p id="selectExcludedGroups" class="indent <?php if (!$_['shareExcludeGroups'] || $_['shareAPIEnabled'] === 'no') { |
|
174 | + p('hidden'); |
|
175 | +} |
|
176 | +?>"> |
|
108 | 177 | <input name="shareapi_exclude_groups_list" type="hidden" id="excludedGroups" value="<?php p($_['shareExcludedGroupsList']) ?>" style="width: 400px" class="noJSAutoUpdate"/> |
109 | 178 | <br /> |
110 | 179 | <em><?php p($l->t('These groups will still be able to receive shares, but not to initiate them.')); ?></em> |
111 | 180 | </p> |
112 | 181 | |
113 | - <p class="<?php if ($_['shareAPIEnabled'] === 'no') p('hidden');?>"> |
|
182 | + <p class="<?php if ($_['shareAPIEnabled'] === 'no') { |
|
183 | + p('hidden'); |
|
184 | +} |
|
185 | +?>"> |
|
114 | 186 | <input type="checkbox" name="shareapi_allow_share_dialog_user_enumeration" value="1" id="shareapi_allow_share_dialog_user_enumeration" class="checkbox" |
115 | - <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
187 | + <?php if ($_['allowShareDialogUserEnumeration'] === 'yes') { |
|
188 | + print_unescaped('checked="checked"'); |
|
189 | +} |
|
190 | +?> /> |
|
116 | 191 | <label for="shareapi_allow_share_dialog_user_enumeration"><?php p($l->t('Allow username autocompletion in share dialog. If this is disabled the full username or email address needs to be entered.'));?></label><br /> |
117 | 192 | </p> |
118 | 193 | |
119 | - <p id="shareapi_restrict_user_enumeration_to_group_setting" class="indent <?php if ($_['shareAPIEnabled'] === 'no' || $_['allowShareDialogUserEnumeration'] === 'no') p('hidden');?>"> |
|
194 | + <p id="shareapi_restrict_user_enumeration_to_group_setting" class="indent <?php if ($_['shareAPIEnabled'] === 'no' || $_['allowShareDialogUserEnumeration'] === 'no') { |
|
195 | + p('hidden'); |
|
196 | +} |
|
197 | +?>"> |
|
120 | 198 | <input type="checkbox" name="shareapi_restrict_user_enumeration_to_group" value="1" id="shareapi_restrict_user_enumeration_to_group" class="checkbox" |
121 | - <?php if ($_['restrictUserEnumerationToGroup'] === 'yes') print_unescaped('checked="checked"'); ?> /> |
|
199 | + <?php if ($_['restrictUserEnumerationToGroup'] === 'yes') { |
|
200 | + print_unescaped('checked="checked"'); |
|
201 | +} |
|
202 | +?> /> |
|
122 | 203 | <label for="shareapi_restrict_user_enumeration_to_group"><?php p($l->t('Restrict username autocompletion to users within the same groups'));?></label><br /> |
123 | 204 | </p> |
124 | 205 | |
125 | 206 | <p> |
126 | 207 | <input type="checkbox" id="publicShareDisclaimer" class="checkbox noJSAutoUpdate" |
127 | - <?php if ($_['publicShareDisclaimerText'] !== null) print_unescaped('checked="checked"'); ?> /> |
|
208 | + <?php if ($_['publicShareDisclaimerText'] !== null) { |
|
209 | + print_unescaped('checked="checked"'); |
|
210 | +} |
|
211 | +?> /> |
|
128 | 212 | <label for="publicShareDisclaimer"><?php p($l->t('Show disclaimer text on the public link upload page. (Only shown when the file list is hidden.)'));?></label> |
129 | 213 | <span id="publicShareDisclaimerStatus" class="msg" style="display:none"></span> |
130 | 214 | <br/> |
@@ -134,10 +218,16 @@ discard block |
||
134 | 218 | <h3><?php p($l->t('Default share permissions'));?></h3> |
135 | 219 | <input type="hidden" name="shareapi_default_permissions" id="shareApiDefaultPermissions" class="checkbox" |
136 | 220 | value="<?php p($_['shareApiDefaultPermissions']) ?>" /> |
137 | - <p id="shareApiDefaultPermissionsSection" class="indent <?php if ($_['shareAPIEnabled'] === 'no') p('hidden'); ?>"> |
|
221 | + <p id="shareApiDefaultPermissionsSection" class="indent <?php if ($_['shareAPIEnabled'] === 'no') { |
|
222 | + p('hidden'); |
|
223 | +} |
|
224 | +?>"> |
|
138 | 225 | <?php foreach ($_['shareApiDefaultPermissionsCheckboxes'] as $perm): ?> |
139 | 226 | <input type="checkbox" name="shareapi_default_permission_<?php p($perm['id']) ?>" id="shareapi_default_permission_<?php p($perm['id']) ?>" |
140 | - class="noautosave checkbox" value="<?php p($perm['value']) ?>" <?php if (($_['shareApiDefaultPermissions'] & $perm['value']) !== 0) print_unescaped('checked="checked"'); ?> /> |
|
227 | + class="noautosave checkbox" value="<?php p($perm['value']) ?>" <?php if (($_['shareApiDefaultPermissions'] & $perm['value']) !== 0) { |
|
228 | + print_unescaped('checked="checked"'); |
|
229 | +} |
|
230 | +?> /> |
|
141 | 231 | <label for="shareapi_default_permission_<?php p($perm['id']) ?>"><?php p($perm['label']);?></label> |
142 | 232 | <?php endforeach ?> |
143 | 233 | </p> |
@@ -343,8 +343,9 @@ |
||
343 | 343 | $files = []; |
344 | 344 | $physicalDir = $this->getSourcePath($dir); |
345 | 345 | foreach (scandir($physicalDir) as $item) { |
346 | - if (\OC\Files\Filesystem::isIgnoredDir($item)) |
|
347 | - continue; |
|
346 | + if (\OC\Files\Filesystem::isIgnoredDir($item)) { |
|
347 | + continue; |
|
348 | + } |
|
348 | 349 | $physicalItem = $physicalDir . '/' . $item; |
349 | 350 | |
350 | 351 | if (strstr(strtolower($item), strtolower($query)) !== false) { |
@@ -116,8 +116,7 @@ discard block |
||
116 | 116 | public function append( $key, $value ) { |
117 | 117 | if( array_key_exists( $key, $this->vars )) { |
118 | 118 | $this->vars[$key][] = $value; |
119 | - } |
|
120 | - else{ |
|
119 | + } else{ |
|
121 | 120 | $this->vars[$key] = [ $value ]; |
122 | 121 | } |
123 | 122 | } |
@@ -132,8 +131,7 @@ discard block |
||
132 | 131 | $data = $this->fetchPage(); |
133 | 132 | if( $data === false ) { |
134 | 133 | return false; |
135 | - } |
|
136 | - else{ |
|
134 | + } else{ |
|
137 | 135 | print $data; |
138 | 136 | return true; |
139 | 137 | } |
@@ -133,10 +133,10 @@ |
||
133 | 133 | if ($signalClass) { |
134 | 134 | if ($signalName) { |
135 | 135 | self::$registered[$signalClass][$signalName]=[]; |
136 | - }else{ |
|
136 | + } else{ |
|
137 | 137 | self::$registered[$signalClass]=[]; |
138 | 138 | } |
139 | - }else{ |
|
139 | + } else{ |
|
140 | 140 | self::$registered=[]; |
141 | 141 | } |
142 | 142 | } |
@@ -89,13 +89,11 @@ discard block |
||
89 | 89 | if (count($rangeArray) > 1) { |
90 | 90 | $type = 'multipart/byteranges; boundary='.self::getBoundary(); |
91 | 91 | // no Content-Length header here |
92 | - } |
|
93 | - else { |
|
92 | + } else { |
|
94 | 93 | header(sprintf('Content-Range: bytes %d-%d/%d', $rangeArray[0]['from'], $rangeArray[0]['to'], $fileSize), true); |
95 | 94 | OC_Response::setContentLengthHeader($rangeArray[0]['to'] - $rangeArray[0]['from'] + 1); |
96 | 95 | } |
97 | - } |
|
98 | - else { |
|
96 | + } else { |
|
99 | 97 | OC_Response::setContentLengthHeader($fileSize); |
100 | 98 | } |
101 | 99 | } |
@@ -263,13 +261,11 @@ discard block |
||
263 | 261 | if ($minOffset >= $fileSize) { |
264 | 262 | break; |
265 | 263 | } |
266 | - } |
|
267 | - elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) { |
|
264 | + } elseif (is_numeric($ranges[0]) && $ranges[0] < $fileSize) { |
|
268 | 265 | // case: x- |
269 | 266 | $rangeArray[$ind++] = [ 'from' => $ranges[0], 'to' => $fileSize-1, 'size' => $fileSize ]; |
270 | 267 | break; |
271 | - } |
|
272 | - elseif (is_numeric($ranges[1])) { |
|
268 | + } elseif (is_numeric($ranges[1])) { |
|
273 | 269 | // case: -x |
274 | 270 | if ($ranges[1] > $fileSize) { |
275 | 271 | $ranges[1] = $fileSize; |
@@ -331,8 +327,7 @@ discard block |
||
331 | 327 | try { |
332 | 328 | if (count($rangeArray) == 1) { |
333 | 329 | $view->readfilePart($filename, $rangeArray[0]['from'], $rangeArray[0]['to']); |
334 | - } |
|
335 | - else { |
|
330 | + } else { |
|
336 | 331 | // check if file is seekable (if not throw UnseekableException) |
337 | 332 | // we have to check it before body contents |
338 | 333 | $view->readfilePart($filename, $rangeArray[0]['size'], $rangeArray[0]['size']); |
@@ -355,8 +350,7 @@ discard block |
||
355 | 350 | self::sendHeaders($filename, $name, []); |
356 | 351 | $view->readfile($filename); |
357 | 352 | } |
358 | - } |
|
359 | - else { |
|
353 | + } else { |
|
360 | 354 | $view->readfile($filename); |
361 | 355 | } |
362 | 356 | } |
@@ -14,10 +14,13 @@ |
||
14 | 14 | ?> |
15 | 15 | <?php if (isset($_['content'])): ?> |
16 | 16 | <?php print_unescaped($_['content']) ?> |
17 | -<?php else: ?> |
|
17 | +<?php else { |
|
18 | + : ?> |
|
18 | 19 | <div class="body-login-container update"> |
19 | 20 | <div class="icon-big icon-search icon-white"></div> |
20 | - <h2><?php p($l->t('File not found')); ?></h2> |
|
21 | + <h2><?php p($l->t('File not found')); |
|
22 | +} |
|
23 | +?></h2> |
|
21 | 24 | <p class="infogroup"><?php p($l->t('The document could not be found on the server. Maybe the share was deleted or has expired?')); ?></p> |
22 | 25 | <p><a class="button primary" href="<?php p(\OC::$server->getURLGenerator()->linkTo('', 'index.php')) ?>"> |
23 | 26 | <?php p($l->t('Back to %s', [$theme->getName()])); ?> |