Completed
Pull Request — master (#4098)
by Georg
16:19
created
apps/federatedfilesharing/templates/settings-admin.php 1 patch
Braces   +16 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,10 @@  discard block
 block discarded – undo
11 11
 		href="<?php p(link_to_docs('admin-sharing-federated')); ?>"></a>
12 12
 	<p>
13 13
 		<input type="checkbox" name="outgoing_server2server_share_enabled" id="outgoingServer2serverShareEnabled" class="checkbox"
14
-			   value="1" <?php if ($_['outgoingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> />
14
+			   value="1" <?php if ($_['outgoingServer2serverShareEnabled']) {
15
+    print_unescaped('checked="checked"');
16
+}
17
+?> />
15 18
 		<label for="outgoingServer2serverShareEnabled">
16 19
 			<?php p($l->t('Allow users on this server to send shares to other servers'));?>
17 20
 		</label>
@@ -19,21 +22,30 @@  discard block
 block discarded – undo
19 22
 
20 23
 	<p>
21 24
 		<input type="checkbox" name="incoming_server2server_share_enabled" id="incomingServer2serverShareEnabled" class="checkbox"
22
-			   value="1" <?php if ($_['incomingServer2serverShareEnabled']) print_unescaped('checked="checked"'); ?> />
25
+			   value="1" <?php if ($_['incomingServer2serverShareEnabled']) {
26
+    print_unescaped('checked="checked"');
27
+}
28
+?> />
23 29
 		<label for="incomingServer2serverShareEnabled">
24 30
 			<?php p($l->t('Allow users on this server to receive shares from other servers'));?>
25 31
 		</label><br/>
26 32
 	</p>
27 33
 	<p>
28 34
 		<input type="checkbox" name="lookupServerEnabled" id="lookupServerEnabled" class="checkbox"
29
-			   value="1" <?php if ($_['lookupServerEnabled']) print_unescaped('checked="checked"'); ?> />
35
+			   value="1" <?php if ($_['lookupServerEnabled']) {
36
+    print_unescaped('checked="checked"');
37
+}
38
+?> />
30 39
 		<label for="lookupServerEnabled">
31 40
 			<?php p($l->t('Search global and public address book for users and let local users publish their data'));?>
32 41
 		</label><br/>
33 42
 	</p>
34 43
 	<p>
35 44
 		<input type="checkbox" name="lookupServerUploadEnabled" id="lookupServerUploadEnabled" class="checkbox"
36
-			   value="1" <?php if ($_['lookupServerUploadEnabled']) print_unescaped('checked="checked"'); ?> />
45
+			   value="1" <?php if ($_['lookupServerUploadEnabled']) {
46
+    print_unescaped('checked="checked"');
47
+}
48
+?> />
37 49
 		<label for="lookupServerUploadEnabled">
38 50
 			<?php p($l->t('Allow users to publish their data to a global and public address book'));?>
39 51
 		</label><br/>
Please login to merge, or discard this patch.
settings/templates/admin/server.php 2 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -31,101 +31,101 @@  discard block
 block discarded – undo
31 31
 	<p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.'));?></p>
32 32
 	<ul>
33 33
 		<?php
34
-		// is php setup properly to query system environment variables like getenv('PATH')
35
-		if ($_['getenvServerNotWorking']) {
36
-			?>
34
+        // is php setup properly to query system environment variables like getenv('PATH')
35
+        if ($_['getenvServerNotWorking']) {
36
+            ?>
37 37
 			<li>
38 38
 				<?php p($l->t('php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.')); ?><br>
39 39
 				<?php print_unescaped($l->t('Please check the <a target="_blank" rel="noreferrer" href="%s">installation documentation ↗</a> for php configuration notes and the php configuration of your server, especially when using php-fpm.', link_to_docs('admin-php-fpm'))); ?>
40 40
 			</li>
41 41
 			<?php
42
-		}
42
+        }
43 43
 
44
-		// is read only config enabled
45
-		if ($_['readOnlyConfigEnabled']) {
46
-			?>
44
+        // is read only config enabled
45
+        if ($_['readOnlyConfigEnabled']) {
46
+            ?>
47 47
 			<li>
48 48
 				<?php p($l->t('The Read-Only config has been enabled. This prevents setting some configurations via the web-interface. Furthermore, the file needs to be made writable manually for every update.')); ?>
49 49
 			</li>
50 50
 			<?php
51
-		}
51
+        }
52 52
 
53
-		// Are doc blocks accessible?
54
-		if (!$_['isAnnotationsWorking']) {
55
-			?>
53
+        // Are doc blocks accessible?
54
+        if (!$_['isAnnotationsWorking']) {
55
+            ?>
56 56
 			<li>
57 57
 				<?php p($l->t('PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible.')); ?><br>
58 58
 				<?php p($l->t('This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator.')); ?>
59 59
 			</li>
60 60
 			<?php
61
-		}
61
+        }
62 62
 
63
-		// Is the Transaction isolation level READ_COMMITTED?
64
-		if ($_['invalidTransactionIsolationLevel']) {
65
-			?>
63
+        // Is the Transaction isolation level READ_COMMITTED?
64
+        if ($_['invalidTransactionIsolationLevel']) {
65
+            ?>
66 66
 			<li>
67 67
 				<?php p($l->t('Your database does not run with "READ COMMITTED" transaction isolation level. This can cause problems when multiple actions are executed in parallel.')); ?>
68 68
 			</li>
69 69
 			<?php
70
-		}
70
+        }
71 71
 
72
-		// Warning if memcache is outdated
73
-		foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
74
-			?>
72
+        // Warning if memcache is outdated
73
+        foreach ($_['OutdatedCacheWarning'] as $php_module => $data) {
74
+            ?>
75 75
 			<li>
76 76
 				<?php p($l->t('%1$s below version %2$s is installed, for stability and performance reasons we recommend updating to a newer %1$s version.', $data)); ?>
77 77
 			</li>
78 78
 			<?php
79
-		}
79
+        }
80 80
 
81
-		// if module fileinfo available?
82
-		if (!$_['has_fileinfo']) {
83
-			?>
81
+        // if module fileinfo available?
82
+        if (!$_['has_fileinfo']) {
83
+            ?>
84 84
 			<li>
85 85
 				<?php p($l->t('The PHP module \'fileinfo\' is missing. We strongly recommend to enable this module to get best results with MIME type detection.')); ?>
86 86
 			</li>
87 87
 			<?php
88
-		}
88
+        }
89 89
 
90
-		// locking configured optimally?
91
-		if ($_['fileLockingType'] === 'none') {
92
-			?>
90
+        // locking configured optimally?
91
+        if ($_['fileLockingType'] === 'none') {
92
+            ?>
93 93
 			<li>
94 94
 				<?php print_unescaped($l->t('Transactional file locking is disabled, this might lead to issues with race conditions. Enable \'filelocking.enabled\' in config.php to avoid these problems. See the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a> for more information.', link_to_docs('admin-transactional-locking'))); ?>
95 95
 			</li>
96 96
 			<?php
97
-		}
97
+        }
98 98
 
99
-		// is locale working ?
100
-		if (!$_['isLocaleWorking']) {
101
-			?>
99
+        // is locale working ?
100
+        if (!$_['isLocaleWorking']) {
101
+            ?>
102 102
 			<li>
103 103
 				<?php
104
-				$locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
105
-				p($l->t('System locale can not be set to a one which supports UTF-8.'));
106
-				?>
104
+                $locales = 'en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8';
105
+                p($l->t('System locale can not be set to a one which supports UTF-8.'));
106
+                ?>
107 107
 				<br>
108 108
 				<?php
109
-				p($l->t('This means that there might be problems with certain characters in file names.'));
110
-				?>
109
+                p($l->t('This means that there might be problems with certain characters in file names.'));
110
+                ?>
111 111
 				<br>
112 112
 				<?php
113
-				p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
114
-				?>
113
+                p($l->t('We strongly suggest installing the required packages on your system to support one of the following locales: %s.', [$locales]));
114
+                ?>
115 115
 			</li>
116 116
 			<?php
117
-		}
117
+        }
118 118
 
119
-		if ($_['suggestedOverwriteCliUrl']) {
120
-			?>
119
+        if ($_['suggestedOverwriteCliUrl']) {
120
+            ?>
121 121
 			<li>
122 122
 				<?php p($l->t('If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the "overwrite.cli.url" option in your config.php file to the webroot path of your installation (Suggested: "%s")', $_['suggestedOverwriteCliUrl'])); ?>
123 123
 			</li>
124 124
 			<?php
125
-		}
125
+        }
126 126
 
127
-		if ($_['cronErrors']) {
128
-			?>
127
+        if ($_['cronErrors']) {
128
+            ?>
129 129
 			<li>
130 130
 				<?php p($l->t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?>
131 131
 				<br>
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 				</ol>
137 137
 			</li>
138 138
 			<?php
139
-		}
140
-		?>
139
+        }
140
+        ?>
141 141
 	</ul>
142 142
 
143 143
 	<div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
 	<?php if ($_['cron_log']): ?>
160 160
 		<p class="cronlog inlineblock">
161 161
 			<?php if ($_['lastcron'] !== false):
162
-				$relative_time = relative_modified_date($_['lastcron']);
163
-				$absolute_time = OC_Util::formatDate($_['lastcron']);
164
-				if (time() - $_['lastcron'] <= 3600): ?>
162
+                $relative_time = relative_modified_date($_['lastcron']);
163
+                $absolute_time = OC_Util::formatDate($_['lastcron']);
164
+                if (time() - $_['lastcron'] <= 3600): ?>
165 165
 					<span class="status success"></span>
166 166
 					<span class="crondate" title="<?php p($absolute_time);?>">
167 167
 					<?php p($l->t("Last cron job execution: %s.", [$relative_time]));?>
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 					<?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?>
173 173
 				</span>
174 174
 				<?php endif;
175
-			else: ?>
175
+            else: ?>
176 176
 				<span class="status error"></span>
177 177
 				<?php p($l->t("Cron was not executed yet!"));
178
-			endif; ?>
178
+            endif; ?>
179 179
 		</p>
180 180
 	<?php endif; ?>
181 181
 	<a target="_blank" rel="noreferrer" class="icon-info"
@@ -186,38 +186,38 @@  discard block
 block discarded – undo
186 186
 	<p>
187 187
 		<input type="radio" name="mode" value="ajax" class="radio"
188 188
 			   id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
189
-			print_unescaped('checked="checked"');
190
-		} ?>>
189
+            print_unescaped('checked="checked"');
190
+        } ?>>
191 191
 		<label for="backgroundjobs_ajax">AJAX</label><br/>
192 192
 		<em><?php p($l->t("Execute one task with each page loaded")); ?></em>
193 193
 	</p>
194 194
 	<p>
195 195
 		<input type="radio" name="mode" value="webcron" class="radio"
196 196
 			   id="backgroundjobs_webcron" <?php if ($_['backgroundjobs_mode'] === "webcron") {
197
-			print_unescaped('checked="checked"');
198
-		} ?>>
197
+            print_unescaped('checked="checked"');
198
+        } ?>>
199 199
 		<label for="backgroundjobs_webcron">Webcron</label><br/>
200 200
 		<em><?php p($l->t("cron.php is registered at a webcron service to call cron.php every 15 minutes over http.")); ?></em>
201 201
 	</p>
202 202
 	<p>
203 203
 		<input type="radio" name="mode" value="cron" class="radio"
204 204
 			   id="backgroundjobs_cron" <?php if ($_['backgroundjobs_mode'] === "cron") {
205
-			print_unescaped('checked="checked"');
206
-		}
207
-		if (!$_['cli_based_cron_possible']) {
208
-			print_unescaped('disabled');
209
-		}?>>
205
+            print_unescaped('checked="checked"');
206
+        }
207
+        if (!$_['cli_based_cron_possible']) {
208
+            print_unescaped('disabled');
209
+        }?>>
210 210
 		<label for="backgroundjobs_cron">Cron</label><br/>
211 211
 		<em><?php p($l->t("Use system's cron service to call the cron.php file every 15 minutes.")); ?>
212 212
 			<?php if($_['cli_based_cron_possible']) {
213
-				p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
214
-			} else {
215
-				print_unescaped(str_replace(
216
-					['{linkstart}', '{linkend}'],
217
-					['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'],
218
-					$l->t('To run this you need the PHP posix extension. See {linkstart}PHP documentation{linkend} for more details.')
219
-				));
220
-		} ?></em>
213
+                p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
214
+            } else {
215
+                print_unescaped(str_replace(
216
+                    ['{linkstart}', '{linkend}'],
217
+                    ['<a href="http://php.net/manual/en/book.posix.php">', ' ↗</a>'],
218
+                    $l->t('To run this you need the PHP posix extension. See {linkstart}PHP documentation{linkend} for more details.')
219
+                ));
220
+        } ?></em>
221 221
 
222 222
 	</p>
223 223
 </div>
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
 ?>
28 28
 
29 29
 <div id="security-warning" class="section">
30
-	<h2><?php p($l->t('Security & setup warnings'));?></h2>
31
-	<p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.'));?></p>
30
+	<h2><?php p($l->t('Security & setup warnings')); ?></h2>
31
+	<p class="settings-hint"><?php p($l->t('It\'s important for the security and performance of your instance that everything is configured correctly. To help you with that we are doing some automatic checks. Please see the Tips & Ticks section and the documentation for more information.')); ?></p>
32 32
 	<ul>
33 33
 		<?php
34 34
 		// is php setup properly to query system environment variables like getenv('PATH')
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 				<?php p($l->t('It was not possible to execute the cronjob via CLI. The following technical errors have appeared:')); ?>
131 131
 				<br>
132 132
 				<ol>
133
-					<?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
133
+					<?php foreach (json_decode($_['cronErrors']) as $error) { if (isset($error->error)) {?>
134 134
 						<li><?php p($error->error) ?> <?php p($error->hint) ?></li>
135 135
 					<?php }};?>
136 136
 				</ol>
@@ -140,22 +140,22 @@  discard block
 block discarded – undo
140 140
 		?>
141 141
 	</ul>
142 142
 
143
-	<div id="postsetupchecks" data-check-wellknown="<?php if($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
143
+	<div id="postsetupchecks" data-check-wellknown="<?php if ($_['checkForWorkingWellKnownSetup']) { p('true'); } else { p('false'); } ?>">
144 144
 		<div class="loading"></div>
145 145
 		<ul class="errors hidden"></ul>
146 146
 		<ul class="warnings hidden"></ul>
147 147
 		<ul class="info hidden"></ul>
148 148
 		<p class="hint hidden">
149
-			<?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="%s">log</a>.', [link_to_docs('admin-install'), \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => 'logging'])] )); ?>
149
+			<?php print_unescaped($l->t('Please double check the <a target="_blank" rel="noreferrer" href="%s">installation guides ↗</a>, and check for any errors or warnings in the <a href="%s">log</a>.', [link_to_docs('admin-install'), \OC::$server->getURLGenerator()->linkToRoute('settings.AdminSettings.index', ['section' => 'logging'])])); ?>
150 150
 		</p>
151 151
 	</div>
152 152
 	<div id="security-warning-state">
153
-		<span class="hidden icon-checkmark"><?php p($l->t('All checks passed.'));?></span>
153
+		<span class="hidden icon-checkmark"><?php p($l->t('All checks passed.')); ?></span>
154 154
 	</div>
155 155
 </div>
156 156
 
157 157
 <div class="section" id="backgroundjobs">
158
-	<h2 class="inlineblock"><?php p($l->t('Cron'));?></h2>
158
+	<h2 class="inlineblock"><?php p($l->t('Cron')); ?></h2>
159 159
 	<?php if ($_['cron_log']): ?>
160 160
 		<p class="cronlog inlineblock">
161 161
 			<?php if ($_['lastcron'] !== false):
@@ -163,13 +163,13 @@  discard block
 block discarded – undo
163 163
 				$absolute_time = OC_Util::formatDate($_['lastcron']);
164 164
 				if (time() - $_['lastcron'] <= 3600): ?>
165 165
 					<span class="status success"></span>
166
-					<span class="crondate" title="<?php p($absolute_time);?>">
167
-					<?php p($l->t("Last cron job execution: %s.", [$relative_time]));?>
166
+					<span class="crondate" title="<?php p($absolute_time); ?>">
167
+					<?php p($l->t("Last cron job execution: %s.", [$relative_time])); ?>
168 168
 				</span>
169 169
 				<?php else: ?>
170 170
 					<span class="status error"></span>
171
-					<span class="crondate" title="<?php p($absolute_time);?>">
172
-					<?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time]));?>
171
+					<span class="crondate" title="<?php p($absolute_time); ?>">
172
+					<?php p($l->t("Last cron job execution: %s. Something seems wrong.", [$relative_time])); ?>
173 173
 				</span>
174 174
 				<?php endif;
175 175
 			else: ?>
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
 		</p>
180 180
 	<?php endif; ?>
181 181
 	<a target="_blank" rel="noreferrer" class="icon-info"
182
-	   title="<?php p($l->t('Open documentation'));?>"
182
+	   title="<?php p($l->t('Open documentation')); ?>"
183 183
 	   href="<?php p(link_to_docs('admin-background-jobs')); ?>"></a>
184 184
 
185
-	<p class="settings-hint"><?php p($l->t('For optimal performance it\'s important to configure background jobs correctly. For bigger instances \'Cron\' is the recommended setting. Please see the documentation for more information.'));?></p>
185
+	<p class="settings-hint"><?php p($l->t('For optimal performance it\'s important to configure background jobs correctly. For bigger instances \'Cron\' is the recommended setting. Please see the documentation for more information.')); ?></p>
186 186
 	<p>
187 187
 		<input type="radio" name="mode" value="ajax" class="radio"
188 188
 			   id="backgroundjobs_ajax" <?php if ($_['backgroundjobs_mode'] === "ajax") {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 		}?>>
210 210
 		<label for="backgroundjobs_cron">Cron</label><br/>
211 211
 		<em><?php p($l->t("Use system's cron service to call the cron.php file every 15 minutes.")); ?>
212
-			<?php if($_['cli_based_cron_possible']) {
212
+			<?php if ($_['cli_based_cron_possible']) {
213 213
 				p($l->t('The cron.php needs to be executed by the system user "%s".', [$_['cli_based_cron_user']]));
214 214
 			} else {
215 215
 				print_unescaped(str_replace(
@@ -224,6 +224,6 @@  discard block
 block discarded – undo
224 224
 
225 225
 <div class="section">
226 226
 	<!-- should be the last part, so Updater can follow if enabled (it has no heading therefore). -->
227
-	<h2><?php p($l->t('Version'));?></h2>
227
+	<h2><?php p($l->t('Version')); ?></h2>
228 228
 	<p><strong><a href="<?php print_unescaped($theme->getBaseUrl()); ?>" rel="noreferrer" target="_blank"><?php p($theme->getTitle()); ?></a> <?php p(OC_Util::getHumanVersion()) ?></strong></p>
229 229
 </div>
Please login to merge, or discard this patch.
settings/templates/admin/tipstricks.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
 	<p class="settings-hint"><?php p($l->t('There are a lot of features and config switches available to optimally customize and use this instance. Here are some pointers for more information.')); ?></p>
32 32
 	<ul>
33 33
 		<?php
34
-		// SQLite database performance issue
35
-		if ($_['databaseOverload']) {
36
-			?>
34
+        // SQLite database performance issue
35
+        if ($_['databaseOverload']) {
36
+            ?>
37 37
 			<li>
38 38
 				<?php p($l->t('SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend.')); ?><br>
39 39
 				<?php p($l->t('This is particularly recommended when using the desktop client for file synchronisation.')); ?><br>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 ?>
28 28
 
29 29
 <div class="section" id="admin-tips">
30
-	<h2><?php p($l->t('Tips & tricks'));?></h2>
30
+	<h2><?php p($l->t('Tips & tricks')); ?></h2>
31 31
 	<p class="settings-hint"><?php p($l->t('There are a lot of features and config switches available to optimally customize and use this instance. Here are some pointers for more information.')); ?></p>
32 32
 	<ul>
33 33
 		<?php
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 			<li>
38 38
 				<?php p($l->t('SQLite is currently being used as the backend database. For larger installations we recommend that you switch to a different database backend.')); ?><br>
39 39
 				<?php p($l->t('This is particularly recommended when using the desktop client for file synchronisation.')); ?><br>
40
-				<?php print_unescaped($l->t('To migrate to another database use the command line tool: \'occ db:convert-type\', or see the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a>.', link_to_docs('admin-db-conversion') )); ?>
40
+				<?php print_unescaped($l->t('To migrate to another database use the command line tool: \'occ db:convert-type\', or see the <a target="_blank" rel="noreferrer" href="%s">documentation ↗</a>.', link_to_docs('admin-db-conversion'))); ?>
41 41
 			</li>
42 42
 		<?php } ?>
43
-		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-backup')); ?>"><?php p($l->t('How to do backups'));?> ↗</a></li>
44
-		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-monitoring')); ?>"><?php p($l->t('Advanced monitoring'));?> ↗</a></li>
45
-		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-performance')); ?>"><?php p($l->t('Performance tuning'));?> ↗</a></li>
46
-		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-config')); ?>"><?php p($l->t('Improving the config.php'));?> ↗</a></li>
47
-		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('developer-theming')); ?>"><?php p($l->t('Theming'));?> ↗</a></li>
48
-		<li><a target="_blank" rel="noreferrer" href="https://scan.nextcloud.com"><?php p($l->t('Check the security of your Nextcloud over our security scan'));?> ↗</a></li>
49
-		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-security')); ?>"><?php p($l->t('Hardening and security guidance'));?> ↗</a></li>
43
+		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-backup')); ?>"><?php p($l->t('How to do backups')); ?> ↗</a></li>
44
+		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-monitoring')); ?>"><?php p($l->t('Advanced monitoring')); ?> ↗</a></li>
45
+		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-performance')); ?>"><?php p($l->t('Performance tuning')); ?> ↗</a></li>
46
+		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-config')); ?>"><?php p($l->t('Improving the config.php')); ?> ↗</a></li>
47
+		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('developer-theming')); ?>"><?php p($l->t('Theming')); ?> ↗</a></li>
48
+		<li><a target="_blank" rel="noreferrer" href="https://scan.nextcloud.com"><?php p($l->t('Check the security of your Nextcloud over our security scan')); ?> ↗</a></li>
49
+		<li><a target="_blank" rel="noreferrer" href="<?php p(link_to_docs('admin-security')); ?>"><?php p($l->t('Hardening and security guidance')); ?> ↗</a></li>
50 50
 	</ul>
51 51
 </div>
Please login to merge, or discard this patch.
apps/federation/templates/settings-admin.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@
 block discarded – undo
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 {?>
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,10 @@
 block discarded – undo
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']) {
15
+    p('checked');
16
+}
17
+?> />
15 18
 		<label for="autoAddServers"><?php p($l->t('Add server automatically once a federated share was created successfully')); ?></label>
16 19
 	</p>
17 20
 
Please login to merge, or discard this patch.
apps/dav/lib/Migration/BuildCalendarSearchIndexBackgroundJob.php 2 patches
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -31,90 +31,90 @@
 block discarded – undo
31 31
 
32 32
 class BuildCalendarSearchIndexBackgroundJob extends QueuedJob {
33 33
 
34
-	/** @var IDBConnection */
35
-	private $db;
36
-
37
-	/** @var CalDavBackend */
38
-	private $calDavBackend;
39
-
40
-	/** @var ILogger */
41
-	private $logger;
42
-
43
-	/** @var IJobList */
44
-	private $jobList;
45
-
46
-	/** @var ITimeFactory */
47
-	private $timeFactory;
48
-
49
-	/**
50
-	 * @param IDBConnection $db
51
-	 * @param CalDavBackend $calDavBackend
52
-	 * @param ILogger $logger
53
-	 * @param IJobList $jobList
54
-	 * @param ITimeFactory $timeFactory
55
-	 */
56
-	public function __construct(IDBConnection $db,
57
-								CalDavBackend $calDavBackend,
58
-								ILogger $logger,
59
-								IJobList $jobList,
60
-								ITimeFactory $timeFactory) {
61
-		$this->db = $db;
62
-		$this->calDavBackend = $calDavBackend;
63
-		$this->logger = $logger;
64
-		$this->jobList = $jobList;
65
-		$this->timeFactory = $timeFactory;
66
-	}
67
-
68
-	public function run($arguments) {
69
-		$offset = $arguments['offset'];
70
-		$stopAt = $arguments['stopAt'];
71
-
72
-		$this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')');
73
-
74
-		$offset = $this->buildIndex($offset, $stopAt);
75
-
76
-		if ($offset >= $stopAt) {
77
-			$this->logger->info('Building calendar index done');
78
-		} else {
79
-			$this->jobList->add(self::class, [
80
-				'offset' => $offset,
81
-				'stopAt' => $stopAt
82
-			]);
83
-			$this->logger->info('New building calendar index job scheduled with offset ' . $offset);
84
-		}
85
-	}
86
-
87
-	/**
88
-	 * @param int $offset
89
-	 * @param int $stopAt
90
-	 * @return int
91
-	 */
92
-	private function buildIndex($offset, $stopAt) {
93
-		$startTime = $this->timeFactory->getTime();
94
-
95
-		$query = $this->db->getQueryBuilder();
96
-		$query->select(['id', 'calendarid', 'objecturi', 'calendardata'])
97
-			->from('calendarobjects')
98
-			->where($query->expr()->lte('id', $query->createNamedParameter($stopAt)))
99
-			->andWhere($query->expr()->gt('id', $query->createNamedParameter($offset)))
100
-			->orderBy('id', 'ASC');
101
-
102
-		$stmt = $query->execute();
103
-		while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
104
-			$offset = $row['id'];
105
-
106
-			$calendarData = $row['calendardata'];
107
-			if (is_resource($calendarData)) {
108
-				$calendarData = stream_get_contents($calendarData);
109
-			}
110
-
111
-			$this->calDavBackend->updateProperties($row['calendarid'], $row['uri'], $calendarData);
112
-
113
-			if (($this->timeFactory->getTime() - $startTime) > 15) {
114
-				return $offset;
115
-			}
116
-		}
117
-
118
-		return $stopAt;
119
-	}
34
+    /** @var IDBConnection */
35
+    private $db;
36
+
37
+    /** @var CalDavBackend */
38
+    private $calDavBackend;
39
+
40
+    /** @var ILogger */
41
+    private $logger;
42
+
43
+    /** @var IJobList */
44
+    private $jobList;
45
+
46
+    /** @var ITimeFactory */
47
+    private $timeFactory;
48
+
49
+    /**
50
+     * @param IDBConnection $db
51
+     * @param CalDavBackend $calDavBackend
52
+     * @param ILogger $logger
53
+     * @param IJobList $jobList
54
+     * @param ITimeFactory $timeFactory
55
+     */
56
+    public function __construct(IDBConnection $db,
57
+                                CalDavBackend $calDavBackend,
58
+                                ILogger $logger,
59
+                                IJobList $jobList,
60
+                                ITimeFactory $timeFactory) {
61
+        $this->db = $db;
62
+        $this->calDavBackend = $calDavBackend;
63
+        $this->logger = $logger;
64
+        $this->jobList = $jobList;
65
+        $this->timeFactory = $timeFactory;
66
+    }
67
+
68
+    public function run($arguments) {
69
+        $offset = $arguments['offset'];
70
+        $stopAt = $arguments['stopAt'];
71
+
72
+        $this->logger->info('Building calendar index (' . $offset .'/' . $stopAt . ')');
73
+
74
+        $offset = $this->buildIndex($offset, $stopAt);
75
+
76
+        if ($offset >= $stopAt) {
77
+            $this->logger->info('Building calendar index done');
78
+        } else {
79
+            $this->jobList->add(self::class, [
80
+                'offset' => $offset,
81
+                'stopAt' => $stopAt
82
+            ]);
83
+            $this->logger->info('New building calendar index job scheduled with offset ' . $offset);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * @param int $offset
89
+     * @param int $stopAt
90
+     * @return int
91
+     */
92
+    private function buildIndex($offset, $stopAt) {
93
+        $startTime = $this->timeFactory->getTime();
94
+
95
+        $query = $this->db->getQueryBuilder();
96
+        $query->select(['id', 'calendarid', 'objecturi', 'calendardata'])
97
+            ->from('calendarobjects')
98
+            ->where($query->expr()->lte('id', $query->createNamedParameter($stopAt)))
99
+            ->andWhere($query->expr()->gt('id', $query->createNamedParameter($offset)))
100
+            ->orderBy('id', 'ASC');
101
+
102
+        $stmt = $query->execute();
103
+        while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
104
+            $offset = $row['id'];
105
+
106
+            $calendarData = $row['calendardata'];
107
+            if (is_resource($calendarData)) {
108
+                $calendarData = stream_get_contents($calendarData);
109
+            }
110
+
111
+            $this->calDavBackend->updateProperties($row['calendarid'], $row['uri'], $calendarData);
112
+
113
+            if (($this->timeFactory->getTime() - $startTime) > 15) {
114
+                return $offset;
115
+            }
116
+        }
117
+
118
+        return $stopAt;
119
+    }
120 120
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'];
Please login to merge, or discard this patch.
apps/dav/lib/Migration/BuildCalendarSearchIndex.php 2 patches
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -30,57 +30,57 @@
 block discarded – undo
30 30
 
31 31
 class BuildCalendarSearchIndex implements IRepairStep {
32 32
 
33
-	/** @var IDBConnection */
34
-	private $db;
33
+    /** @var IDBConnection */
34
+    private $db;
35 35
 
36
-	/** @var IJobList */
37
-	private $jobList;
36
+    /** @var IJobList */
37
+    private $jobList;
38 38
 
39
-	/** @var IConfig */
40
-	private $config;
39
+    /** @var IConfig */
40
+    private $config;
41 41
 
42
-	/**
43
-	 * @param IDBConnection $db
44
-	 * @param IJobList $jobList
45
-	 * @param IConfig $config
46
-	 */
47
-	public function __construct(IDBConnection $db,
48
-								IJobList $jobList,
49
-								IConfig $config) {
50
-		$this->db = $db;
51
-		$this->jobList = $jobList;
52
-		$this->config = $config;
53
-	}
42
+    /**
43
+     * @param IDBConnection $db
44
+     * @param IJobList $jobList
45
+     * @param IConfig $config
46
+     */
47
+    public function __construct(IDBConnection $db,
48
+                                IJobList $jobList,
49
+                                IConfig $config) {
50
+        $this->db = $db;
51
+        $this->jobList = $jobList;
52
+        $this->config = $config;
53
+    }
54 54
 
55
-	/**
56
-	 * @return string
57
-	 */
58
-	public function getName() {
59
-		return 'Registering building of calendar search index as background job';
60
-	}
55
+    /**
56
+     * @return string
57
+     */
58
+    public function getName() {
59
+        return 'Registering building of calendar search index as background job';
60
+    }
61 61
 
62
-	/**
63
-	 * @param IOutput $output
64
-	 */
65
-	public function run(IOutput $output) {
66
-		// only run once
67
-		if ($this->config->getAppValue('dav', 'buildCalendarSearchIndex') === 'yes') {
68
-			$output->info('Repair step already executed');
69
-			return;
70
-		}
62
+    /**
63
+     * @param IOutput $output
64
+     */
65
+    public function run(IOutput $output) {
66
+        // only run once
67
+        if ($this->config->getAppValue('dav', 'buildCalendarSearchIndex') === 'yes') {
68
+            $output->info('Repair step already executed');
69
+            return;
70
+        }
71 71
 
72
-		$query = $this->db->getQueryBuilder();
73
-		$query->select($query->createFunction('MAX(id)'))
74
-			->from('calendarobjects');
75
-		$maxId = (int)$query->execute()->fetchColumn();
72
+        $query = $this->db->getQueryBuilder();
73
+        $query->select($query->createFunction('MAX(id)'))
74
+            ->from('calendarobjects');
75
+        $maxId = (int)$query->execute()->fetchColumn();
76 76
 
77
-		$output->info('Add background job');
78
-		$this->jobList->add(BuildCalendarSearchIndexBackgroundJob::class, [
79
-			'offset' => 0,
80
-			'stopAt' => $maxId
81
-		]);
77
+        $output->info('Add background job');
78
+        $this->jobList->add(BuildCalendarSearchIndexBackgroundJob::class, [
79
+            'offset' => 0,
80
+            'stopAt' => $maxId
81
+        ]);
82 82
 
83
-		// if all were done, no need to redo the repair during next upgrade
84
-		$this->config->setAppValue('dav', 'buildCalendarSearchIndex', 'yes');
85
-	}
83
+        // if all were done, no need to redo the repair during next upgrade
84
+        $this->config->setAppValue('dav', 'buildCalendarSearchIndex', 'yes');
85
+    }
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
 		$query = $this->db->getQueryBuilder();
73 73
 		$query->select($query->createFunction('MAX(id)'))
74 74
 			->from('calendarobjects');
75
-		$maxId = (int)$query->execute()->fetchColumn();
75
+		$maxId = (int) $query->execute()->fetchColumn();
76 76
 
77 77
 		$output->info('Add background job');
78 78
 		$this->jobList->add(BuildCalendarSearchIndexBackgroundJob::class, [
Please login to merge, or discard this patch.
apps/dav/lib/CalDAV/Search/SearchPlugin.php 2 patches
Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -25,135 +25,135 @@
 block discarded – undo
25 25
 use OCA\DAV\CalDAV\CalendarHome;
26 26
 
27 27
 class SearchPlugin extends ServerPlugin {
28
-	const NS_Nextcloud = 'http://nextcloud.com/ns';
29
-
30
-	/**
31
-	 * Reference to SabreDAV server object.
32
-	 *
33
-	 * @var \Sabre\DAV\Server
34
-	 */
35
-	protected $server;
36
-
37
-	/**
38
-	 * This method should return a list of server-features.
39
-	 *
40
-	 * This is for example 'versioning' and is added to the DAV: header
41
-	 * in an OPTIONS response.
42
-	 *
43
-	 * @return string[]
44
-	 */
45
-	public function getFeatures() {
46
-		// May have to be changed to be detected
47
-		return ['nc-calendar-search'];
48
-	}
49
-
50
-	/**
51
-	 * Returns a plugin name.
52
-	 *
53
-	 * Using this name other plugins will be able to access other plugins
54
-	 * using Sabre\DAV\Server::getPlugin
55
-	 *
56
-	 * @return string
57
-	 */
58
-	public function getPluginName() {
59
-		return 'nc-calendar-search';
60
-	}
61
-
62
-	/**
63
-	 * This initializes the plugin.
64
-	 *
65
-	 * This function is called by Sabre\DAV\Server, after
66
-	 * addPlugin is called.
67
-	 *
68
-	 * This method should set up the required event subscriptions.
69
-	 *
70
-	 * @param Server $server
71
-	 */
72
-	public function initialize(Server $server) {
73
-		$this->server = $server;
74
-
75
-		$server->on('report', [$this, 'report']);
76
-
77
-		$server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] =
78
-			'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport';
79
-	}
80
-
81
-	/**
82
-	 * This functions handles REPORT requests specific to CalDAV
83
-	 *
84
-	 * @param string $reportName
85
-	 * @param mixed $report
86
-	 * @param mixed $path
87
-	 * @return bool
88
-	 */
89
-	public function report($reportName, $report, $path) {
90
-		switch ($reportName) {
91
-			case '{' . self::NS_Nextcloud . '}calendar-search':
92
-				$this->server->transactionType = 'report-nc-calendar-search';
93
-				$this->calendarSearch($report);
94
-				return false;
95
-		}
96
-	}
97
-
98
-	/**
99
-	 * Returns a list of reports this plugin supports.
100
-	 *
101
-	 * This will be used in the {DAV:}supported-report-set property.
102
-	 * Note that you still need to subscribe to the 'report' event to actually
103
-	 * implement them
104
-	 *
105
-	 * @param string $uri
106
-	 * @return array
107
-	 */
108
-	public function getSupportedReportSet($uri) {
109
-		$node = $this->server->tree->getNodeForPath($uri);
110
-
111
-		$reports = [];
112
-		if ($node instanceof CalendarHome) {
113
-			$reports[] = '{' . self::NS_Nextcloud . '}calendar-search';
114
-		}
115
-
116
-		return $reports;
117
-	}
118
-
119
-	/**
120
-	 * This function handles the calendar-query REPORT
121
-	 *
122
-	 * This report is used by clients to request calendar objects based on
123
-	 * complex conditions.
124
-	 *
125
-	 * @param Xml\Request\CalendarSearchReport $report
126
-	 * @return void
127
-	 */
128
-	private function calendarSearch($report) {
129
-		$node = $this->server->tree->getNodeForPath($this->server->getRequestUri());
130
-		$depth = $this->server->getHTTPDepth(2);
131
-
132
-		// The default result is an empty array
133
-		$result = [];
134
-
135
-		// If we're dealing with the calendar home, the calendar home itself is
136
-		// responsible for the calendar-query
137
-		if ($node instanceof CalendarHome && $depth == 2) {
138
-
139
-			$nodePaths = $node->calendarSearch($report->filters, $report->limit, $report->offset);
140
-
141
-			foreach ($nodePaths as $path) {
142
-				list($properties) = $this->server->getPropertiesForPath(
143
-					$this->server->getRequestUri() . '/' . $path,
144
-					$report->properties);
145
-				$result[] = $properties;
146
-			}
147
-		}
148
-
149
-		$prefer = $this->server->getHTTPPrefer();
150
-
151
-		$this->server->httpResponse->setStatus(207);
152
-		$this->server->httpResponse->setHeader('Content-Type',
153
-			'application/xml; charset=utf-8');
154
-		$this->server->httpResponse->setHeader('Vary', 'Brief,Prefer');
155
-		$this->server->httpResponse->setBody(
156
-			$this->server->generateMultiStatus($result,
157
-				$prefer['return'] === 'minimal'));
158
-	}
28
+    const NS_Nextcloud = 'http://nextcloud.com/ns';
29
+
30
+    /**
31
+     * Reference to SabreDAV server object.
32
+     *
33
+     * @var \Sabre\DAV\Server
34
+     */
35
+    protected $server;
36
+
37
+    /**
38
+     * This method should return a list of server-features.
39
+     *
40
+     * This is for example 'versioning' and is added to the DAV: header
41
+     * in an OPTIONS response.
42
+     *
43
+     * @return string[]
44
+     */
45
+    public function getFeatures() {
46
+        // May have to be changed to be detected
47
+        return ['nc-calendar-search'];
48
+    }
49
+
50
+    /**
51
+     * Returns a plugin name.
52
+     *
53
+     * Using this name other plugins will be able to access other plugins
54
+     * using Sabre\DAV\Server::getPlugin
55
+     *
56
+     * @return string
57
+     */
58
+    public function getPluginName() {
59
+        return 'nc-calendar-search';
60
+    }
61
+
62
+    /**
63
+     * This initializes the plugin.
64
+     *
65
+     * This function is called by Sabre\DAV\Server, after
66
+     * addPlugin is called.
67
+     *
68
+     * This method should set up the required event subscriptions.
69
+     *
70
+     * @param Server $server
71
+     */
72
+    public function initialize(Server $server) {
73
+        $this->server = $server;
74
+
75
+        $server->on('report', [$this, 'report']);
76
+
77
+        $server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] =
78
+            'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport';
79
+    }
80
+
81
+    /**
82
+     * This functions handles REPORT requests specific to CalDAV
83
+     *
84
+     * @param string $reportName
85
+     * @param mixed $report
86
+     * @param mixed $path
87
+     * @return bool
88
+     */
89
+    public function report($reportName, $report, $path) {
90
+        switch ($reportName) {
91
+            case '{' . self::NS_Nextcloud . '}calendar-search':
92
+                $this->server->transactionType = 'report-nc-calendar-search';
93
+                $this->calendarSearch($report);
94
+                return false;
95
+        }
96
+    }
97
+
98
+    /**
99
+     * Returns a list of reports this plugin supports.
100
+     *
101
+     * This will be used in the {DAV:}supported-report-set property.
102
+     * Note that you still need to subscribe to the 'report' event to actually
103
+     * implement them
104
+     *
105
+     * @param string $uri
106
+     * @return array
107
+     */
108
+    public function getSupportedReportSet($uri) {
109
+        $node = $this->server->tree->getNodeForPath($uri);
110
+
111
+        $reports = [];
112
+        if ($node instanceof CalendarHome) {
113
+            $reports[] = '{' . self::NS_Nextcloud . '}calendar-search';
114
+        }
115
+
116
+        return $reports;
117
+    }
118
+
119
+    /**
120
+     * This function handles the calendar-query REPORT
121
+     *
122
+     * This report is used by clients to request calendar objects based on
123
+     * complex conditions.
124
+     *
125
+     * @param Xml\Request\CalendarSearchReport $report
126
+     * @return void
127
+     */
128
+    private function calendarSearch($report) {
129
+        $node = $this->server->tree->getNodeForPath($this->server->getRequestUri());
130
+        $depth = $this->server->getHTTPDepth(2);
131
+
132
+        // The default result is an empty array
133
+        $result = [];
134
+
135
+        // If we're dealing with the calendar home, the calendar home itself is
136
+        // responsible for the calendar-query
137
+        if ($node instanceof CalendarHome && $depth == 2) {
138
+
139
+            $nodePaths = $node->calendarSearch($report->filters, $report->limit, $report->offset);
140
+
141
+            foreach ($nodePaths as $path) {
142
+                list($properties) = $this->server->getPropertiesForPath(
143
+                    $this->server->getRequestUri() . '/' . $path,
144
+                    $report->properties);
145
+                $result[] = $properties;
146
+            }
147
+        }
148
+
149
+        $prefer = $this->server->getHTTPPrefer();
150
+
151
+        $this->server->httpResponse->setStatus(207);
152
+        $this->server->httpResponse->setHeader('Content-Type',
153
+            'application/xml; charset=utf-8');
154
+        $this->server->httpResponse->setHeader('Vary', 'Brief,Prefer');
155
+        $this->server->httpResponse->setBody(
156
+            $this->server->generateMultiStatus($result,
157
+                $prefer['return'] === 'minimal'));
158
+    }
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
 		$server->on('report', [$this, 'report']);
76 76
 
77
-		$server->xml->elementMap['{' . self::NS_Nextcloud . '}calendar-search'] =
77
+		$server->xml->elementMap['{'.self::NS_Nextcloud.'}calendar-search'] =
78 78
 			'OCA\\DAV\\CalDAV\\Search\\Xml\\Request\\CalendarSearchReport';
79 79
 	}
80 80
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 */
89 89
 	public function report($reportName, $report, $path) {
90 90
 		switch ($reportName) {
91
-			case '{' . self::NS_Nextcloud . '}calendar-search':
91
+			case '{'.self::NS_Nextcloud.'}calendar-search':
92 92
 				$this->server->transactionType = 'report-nc-calendar-search';
93 93
 				$this->calendarSearch($report);
94 94
 				return false;
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
 		$reports = [];
112 112
 		if ($node instanceof CalendarHome) {
113
-			$reports[] = '{' . self::NS_Nextcloud . '}calendar-search';
113
+			$reports[] = '{'.self::NS_Nextcloud.'}calendar-search';
114 114
 		}
115 115
 
116 116
 		return $reports;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
 			foreach ($nodePaths as $path) {
142 142
 				list($properties) = $this->server->getPropertiesForPath(
143
-					$this->server->getRequestUri() . '/' . $path,
143
+					$this->server->getRequestUri().'/'.$path,
144 144
 					$report->properties);
145 145
 				$result[] = $properties;
146 146
 			}
Please login to merge, or discard this patch.
apps/sharebymail/templates/settings-admin.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 	<p class="settings-hint"><?php p($l->t('Allows users to share a personalized link to a file or folder by putting in an email address.')); ?></p>
12 12
 
13 13
 	<p>
14
-		<input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> />
14
+		<input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> />
15 15
 		<label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/>
16
-		<input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> />
16
+		<input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> />
17 17
 		<label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label>
18 18
 	</p>
19 19
 
Please login to merge, or discard this patch.
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,15 @@
 block discarded – undo
11 11
 	<p class="settings-hint"><?php p($l->t('Allows users to share a personalized link to a file or folder by putting in an email address.')); ?></p>
12 12
 
13 13
 	<p>
14
-		<input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> />
14
+		<input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) {
15
+    p('checked');
16
+}
17
+?> />
15 18
 		<label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/>
16
-		<input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> />
19
+		<input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) {
20
+    p('checked');
21
+}
22
+?> />
17 23
 		<label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label>
18 24
 	</p>
19 25
 
Please login to merge, or discard this patch.
settings/templates/admin/additional-mail.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
 <div class="section" id="mail_general_settings">
54 54
 	<form id="mail_general_settings_form" class="mail_settings">
55
-		<h2><?php p($l->t('Email server'));?></h2>
55
+		<h2><?php p($l->t('Email server')); ?></h2>
56 56
 		<a target="_blank" rel="noreferrer" class="icon-info"
57
-		   title="<?php p($l->t('Open documentation'));?>"
57
+		   title="<?php p($l->t('Open documentation')); ?>"
58 58
 		   href="<?php p(link_to_docs('admin-email')); ?>"></a>
59 59
 		<p class="settings-hint"><?php p($l->t('It is important to set up this server to be able to send emails, like for password reset and notifications.')); ?></p>
60 60
 		<p><span id="mail_settings_msg" class="msg"></span></p>
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 						$selected = 'selected="selected"';
69 69
 					endif; ?>
70 70
 					<option value="<?php p($smtpmode[0])?>" <?php p($selected) ?>><?php p($smtpmode[1]) ?></option>
71
-				<?php endforeach;?>
71
+				<?php endforeach; ?>
72 72
 			</select>
73 73
 
74 74
 			<label id="mail_smtpsecure_label" for="mail_smtpsecure"
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 						$selected = 'selected="selected"';
84 84
 					endif; ?>
85 85
 					<option value="<?php p($secure)?>" <?php p($selected) ?>><?php p($name) ?></option>
86
-				<?php endforeach;?>
86
+				<?php endforeach; ?>
87 87
 			</select>
88 88
 		</p>
89 89
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 						$selected = 'selected="selected"';
105 105
 					endif; ?>
106 106
 					<option value="<?php p($authtype)?>" <?php p($selected) ?>><?php p($name) ?></option>
107
-				<?php endforeach;?>
107
+				<?php endforeach; ?>
108 108
 			</select>
109 109
 
110 110
 			<input type="checkbox" name="mail_smtpauth" id="mail_smtpauth" class="checkbox" value="1"
Please login to merge, or discard this patch.