Completed
Pull Request — master (#9293)
by Blizzz
20:13
created
settings/Controller/LogSettingsController.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -39,28 +39,28 @@
 block discarded – undo
39 39
  */
40 40
 class LogSettingsController extends Controller {
41 41
 
42
-	/** @var Log */
43
-	private $log;
42
+    /** @var Log */
43
+    private $log;
44 44
 
45
-	public function __construct(string $appName, IRequest $request, ILogger $logger) {
46
-		parent::__construct($appName, $request);
47
-		$this->log = $logger;
48
-	}
45
+    public function __construct(string $appName, IRequest $request, ILogger $logger) {
46
+        parent::__construct($appName, $request);
47
+        $this->log = $logger;
48
+    }
49 49
 
50
-	/**
51
-	 * download logfile
52
-	 *
53
-	 * @NoCSRFRequired
54
-	 *
55
-	 * @return StreamResponse
56
-	 */
57
-	public function download() {
58
-		if(!$this->log instanceof Log) {
59
-			throw new \UnexpectedValueException('Log file not available');
60
-		}
61
-		$resp = new StreamResponse($this->log->getLogPath());
62
-		$resp->addHeader('Content-Type', 'application/octet-stream');
63
-		$resp->addHeader('Content-Disposition', 'attachment; filename="nextcloud.log"');
64
-		return $resp;
65
-	}
50
+    /**
51
+     * download logfile
52
+     *
53
+     * @NoCSRFRequired
54
+     *
55
+     * @return StreamResponse
56
+     */
57
+    public function download() {
58
+        if(!$this->log instanceof Log) {
59
+            throw new \UnexpectedValueException('Log file not available');
60
+        }
61
+        $resp = new StreamResponse($this->log->getLogPath());
62
+        $resp->addHeader('Content-Type', 'application/octet-stream');
63
+        $resp->addHeader('Content-Disposition', 'attachment; filename="nextcloud.log"');
64
+        return $resp;
65
+    }
66 66
 }
Please login to merge, or discard this patch.
lib/private/Log/Errorlog.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
 
30 30
 class Errorlog implements IWriter {
31 31
 
32
-	/**
33
-	 * write a message in the log
34
-	 * @param string $app
35
-	 * @param string $message
36
-	 * @param int $level
37
-	 */
38
-	public function write(string $app, $message, int $level) {
39
-		error_log('[owncloud]['.$app.']['.$level.'] '.$message);
40
-	}
32
+    /**
33
+     * write a message in the log
34
+     * @param string $app
35
+     * @param string $message
36
+     * @param int $level
37
+     */
38
+    public function write(string $app, $message, int $level) {
39
+        error_log('[owncloud]['.$app.']['.$level.'] '.$message);
40
+    }
41 41
 }
42 42
 
Please login to merge, or discard this patch.
lib/public/Log/ILogFactory.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@
 block discarded – undo
32 32
  * @since 14.0.0
33 33
  */
34 34
 interface ILogFactory {
35
-	/**
36
-	 * @param string $type - one of: file, errorlog, syslog
37
-	 * @return IWriter
38
-	 * @since 14.0.0
39
-	 */
40
-	public function get(string $type): IWriter;
35
+    /**
36
+     * @param string $type - one of: file, errorlog, syslog
37
+     * @return IWriter
38
+     * @since 14.0.0
39
+     */
40
+    public function get(string $type): IWriter;
41 41
 
42
-	/**
43
-	 * @param string $path
44
-	 * @return ILogger
45
-	 * @since 14.0.0
46
-	 */
47
-	public function getCustomLogger(string $path): ILogger;
42
+    /**
43
+     * @param string $path
44
+     * @return ILogger
45
+     * @since 14.0.0
46
+     */
47
+    public function getCustomLogger(string $path): ILogger;
48 48
 }
Please login to merge, or discard this patch.
lib/public/Log/IWriter.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
  * @since 14.0.0
31 31
  */
32 32
 interface IWriter {
33
-	/**
34
-	 * @since 14.0.0
35
-	 */
36
-	public function write(string $app, $message, int $level);
33
+    /**
34
+     * @since 14.0.0
35
+     */
36
+    public function write(string $app, $message, int $level);
37 37
 }
Please login to merge, or discard this patch.
lib/public/IServerContainer.php 1 patch
Indentation   +488 added lines, -488 removed lines patch added patch discarded remove patch
@@ -58,492 +58,492 @@
 block discarded – undo
58 58
  */
59 59
 interface IServerContainer extends IContainer {
60 60
 
61
-	/**
62
-	 * The calendar manager will act as a broker between consumers for calendar information and
63
-	 * providers which actual deliver the calendar information.
64
-	 *
65
-	 * @return \OCP\Calendar\IManager
66
-	 * @since 13.0.0
67
-	 */
68
-	public function getCalendarManager();
69
-
70
-	/**
71
-	 * The contacts manager will act as a broker between consumers for contacts information and
72
-	 * providers which actual deliver the contact information.
73
-	 *
74
-	 * @return \OCP\Contacts\IManager
75
-	 * @since 6.0.0
76
-	 */
77
-	public function getContactsManager();
78
-
79
-	/**
80
-	 * The current request object holding all information about the request currently being processed
81
-	 * is returned from this method.
82
-	 * In case the current execution was not initiated by a web request null is returned
83
-	 *
84
-	 * @return \OCP\IRequest
85
-	 * @since 6.0.0
86
-	 */
87
-	public function getRequest();
88
-
89
-	/**
90
-	 * Returns the preview manager which can create preview images for a given file
91
-	 *
92
-	 * @return \OCP\IPreview
93
-	 * @since 6.0.0
94
-	 */
95
-	public function getPreviewManager();
96
-
97
-	/**
98
-	 * Returns the tag manager which can get and set tags for different object types
99
-	 *
100
-	 * @see \OCP\ITagManager::load()
101
-	 * @return \OCP\ITagManager
102
-	 * @since 6.0.0
103
-	 */
104
-	public function getTagManager();
105
-
106
-	/**
107
-	 * Returns the root folder of ownCloud's data directory
108
-	 *
109
-	 * @return \OCP\Files\IRootFolder
110
-	 * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
111
-	 */
112
-	public function getRootFolder();
113
-
114
-	/**
115
-	 * Returns a view to ownCloud's files folder
116
-	 *
117
-	 * @param string $userId user ID
118
-	 * @return \OCP\Files\Folder
119
-	 * @since 6.0.0 - parameter $userId was added in 8.0.0
120
-	 * @see getUserFolder in \OCP\Files\IRootFolder
121
-	 */
122
-	public function getUserFolder($userId = null);
123
-
124
-	/**
125
-	 * Returns an app-specific view in ownClouds data directory
126
-	 *
127
-	 * @return \OCP\Files\Folder
128
-	 * @since 6.0.0
129
-	 * @deprecated 9.2.0 use IAppData
130
-	 */
131
-	public function getAppFolder();
132
-
133
-	/**
134
-	 * Returns a user manager
135
-	 *
136
-	 * @return \OCP\IUserManager
137
-	 * @since 8.0.0
138
-	 */
139
-	public function getUserManager();
140
-
141
-	/**
142
-	 * Returns a group manager
143
-	 *
144
-	 * @return \OCP\IGroupManager
145
-	 * @since 8.0.0
146
-	 */
147
-	public function getGroupManager();
148
-
149
-	/**
150
-	 * Returns the user session
151
-	 *
152
-	 * @return \OCP\IUserSession
153
-	 * @since 6.0.0
154
-	 */
155
-	public function getUserSession();
156
-
157
-	/**
158
-	 * Returns the navigation manager
159
-	 *
160
-	 * @return \OCP\INavigationManager
161
-	 * @since 6.0.0
162
-	 */
163
-	public function getNavigationManager();
164
-
165
-	/**
166
-	 * Returns the config manager
167
-	 *
168
-	 * @return \OCP\IConfig
169
-	 * @since 6.0.0
170
-	 */
171
-	public function getConfig();
172
-
173
-	/**
174
-	 * Returns a Crypto instance
175
-	 *
176
-	 * @return \OCP\Security\ICrypto
177
-	 * @since 8.0.0
178
-	 */
179
-	public function getCrypto();
180
-
181
-	/**
182
-	 * Returns a Hasher instance
183
-	 *
184
-	 * @return \OCP\Security\IHasher
185
-	 * @since 8.0.0
186
-	 */
187
-	public function getHasher();
188
-
189
-	/**
190
-	 * Returns a SecureRandom instance
191
-	 *
192
-	 * @return \OCP\Security\ISecureRandom
193
-	 * @since 8.1.0
194
-	 */
195
-	public function getSecureRandom();
196
-
197
-	/**
198
-	 * Returns a CredentialsManager instance
199
-	 *
200
-	 * @return \OCP\Security\ICredentialsManager
201
-	 * @since 9.0.0
202
-	 */
203
-	public function getCredentialsManager();
204
-
205
-	/**
206
-	 * Returns the app config manager
207
-	 *
208
-	 * @return \OCP\IAppConfig
209
-	 * @since 7.0.0
210
-	 */
211
-	public function getAppConfig();
212
-
213
-	/**
214
-	 * @return \OCP\L10N\IFactory
215
-	 * @since 8.2.0
216
-	 */
217
-	public function getL10NFactory();
218
-
219
-	/**
220
-	 * get an L10N instance
221
-	 * @param string $app appid
222
-	 * @param string $lang
223
-	 * @return \OCP\IL10N
224
-	 * @since 6.0.0 - parameter $lang was added in 8.0.0
225
-	 */
226
-	public function getL10N($app, $lang = null);
227
-
228
-	/**
229
-	 * @return \OC\Encryption\Manager
230
-	 * @since 8.1.0
231
-	 */
232
-	public function getEncryptionManager();
233
-
234
-	/**
235
-	 * @return \OC\Encryption\File
236
-	 * @since 8.1.0
237
-	 */
238
-	public function getEncryptionFilesHelper();
239
-
240
-	/**
241
-	 * @return \OCP\Encryption\Keys\IStorage
242
-	 * @since 8.1.0
243
-	 */
244
-	public function getEncryptionKeyStorage();
245
-
246
-	/**
247
-	 * Returns the URL generator
248
-	 *
249
-	 * @return \OCP\IURLGenerator
250
-	 * @since 6.0.0
251
-	 */
252
-	public function getURLGenerator();
253
-
254
-	/**
255
-	 * Returns an ICache instance
256
-	 *
257
-	 * @return \OCP\ICache
258
-	 * @since 6.0.0
259
-	 */
260
-	public function getCache();
261
-
262
-	/**
263
-	 * Returns an \OCP\CacheFactory instance
264
-	 *
265
-	 * @return \OCP\ICacheFactory
266
-	 * @since 7.0.0
267
-	 */
268
-	public function getMemCacheFactory();
269
-
270
-	/**
271
-	 * Returns the current session
272
-	 *
273
-	 * @return \OCP\ISession
274
-	 * @since 6.0.0
275
-	 */
276
-	public function getSession();
277
-
278
-	/**
279
-	 * Returns the activity manager
280
-	 *
281
-	 * @return \OCP\Activity\IManager
282
-	 * @since 6.0.0
283
-	 */
284
-	public function getActivityManager();
285
-
286
-	/**
287
-	 * Returns the current session
288
-	 *
289
-	 * @return \OCP\IDBConnection
290
-	 * @since 6.0.0
291
-	 */
292
-	public function getDatabaseConnection();
293
-
294
-	/**
295
-	 * Returns an avatar manager, used for avatar functionality
296
-	 *
297
-	 * @return \OCP\IAvatarManager
298
-	 * @since 6.0.0
299
-	 */
300
-	public function getAvatarManager();
301
-
302
-	/**
303
-	 * Returns an job list for controlling background jobs
304
-	 *
305
-	 * @return \OCP\BackgroundJob\IJobList
306
-	 * @since 7.0.0
307
-	 */
308
-	public function getJobList();
309
-
310
-	/**
311
-	 * Returns a logger instance
312
-	 *
313
-	 * @return \OCP\ILogger
314
-	 * @since 8.0.0
315
-	 */
316
-	public function getLogger();
317
-
318
-	/**
319
-	 * returns a log factory instance
320
-	 *
321
-	 * @return ILogFactory
322
-	 * @since 14.0.0
323
-	 */
324
-	public function getLogFactory();
325
-
326
-	/**
327
-	 * Returns a router for generating and matching urls
328
-	 *
329
-	 * @return \OCP\Route\IRouter
330
-	 * @since 7.0.0
331
-	 */
332
-	public function getRouter();
333
-
334
-	/**
335
-	 * Returns a search instance
336
-	 *
337
-	 * @return \OCP\ISearch
338
-	 * @since 7.0.0
339
-	 */
340
-	public function getSearch();
341
-
342
-	/**
343
-	 * Get the certificate manager for the user
344
-	 *
345
-	 * @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
346
-	 * @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
347
-	 * @since 8.0.0
348
-	 */
349
-	public function getCertificateManager($userId = null);
350
-
351
-	/**
352
-	 * Create a new event source
353
-	 *
354
-	 * @return \OCP\IEventSource
355
-	 * @since 8.0.0
356
-	 */
357
-	public function createEventSource();
358
-
359
-	/**
360
-	 * Returns an instance of the HTTP client service
361
-	 *
362
-	 * @return \OCP\Http\Client\IClientService
363
-	 * @since 8.1.0
364
-	 */
365
-	public function getHTTPClientService();
366
-
367
-	/**
368
-	 * Get the active event logger
369
-	 *
370
-	 * @return \OCP\Diagnostics\IEventLogger
371
-	 * @since 8.0.0
372
-	 */
373
-	public function getEventLogger();
374
-
375
-	/**
376
-	 * Get the active query logger
377
-	 *
378
-	 * The returned logger only logs data when debug mode is enabled
379
-	 *
380
-	 * @return \OCP\Diagnostics\IQueryLogger
381
-	 * @since 8.0.0
382
-	 */
383
-	public function getQueryLogger();
384
-
385
-	/**
386
-	 * Get the manager for temporary files and folders
387
-	 *
388
-	 * @return \OCP\ITempManager
389
-	 * @since 8.0.0
390
-	 */
391
-	public function getTempManager();
392
-
393
-	/**
394
-	 * Get the app manager
395
-	 *
396
-	 * @return \OCP\App\IAppManager
397
-	 * @since 8.0.0
398
-	 */
399
-	public function getAppManager();
400
-
401
-	/**
402
-	 * Get the webroot
403
-	 *
404
-	 * @return string
405
-	 * @since 8.0.0
406
-	 */
407
-	public function getWebRoot();
408
-
409
-	/**
410
-	 * @return \OCP\Files\Config\IMountProviderCollection
411
-	 * @since 8.0.0
412
-	 */
413
-	public function getMountProviderCollection();
414
-
415
-	/**
416
-	 * Get the IniWrapper
417
-	 *
418
-	 * @return \bantu\IniGetWrapper\IniGetWrapper
419
-	 * @since 8.0.0
420
-	 */
421
-	public function getIniWrapper();
422
-	/**
423
-	 * @return \OCP\Command\IBus
424
-	 * @since 8.1.0
425
-	 */
426
-	public function getCommandBus();
427
-
428
-	/**
429
-	 * Creates a new mailer
430
-	 *
431
-	 * @return \OCP\Mail\IMailer
432
-	 * @since 8.1.0
433
-	 */
434
-	public function getMailer();
435
-
436
-	/**
437
-	 * Get the locking provider
438
-	 *
439
-	 * @return \OCP\Lock\ILockingProvider
440
-	 * @since 8.1.0
441
-	 */
442
-	public function getLockingProvider();
443
-
444
-	/**
445
-	 * @return \OCP\Files\Mount\IMountManager
446
-	 * @since 8.2.0
447
-	 */
448
-	public function getMountManager();
449
-
450
-	/**
451
-	 * Get the MimeTypeDetector
452
-	 *
453
-	 * @return \OCP\Files\IMimeTypeDetector
454
-	 * @since 8.2.0
455
-	 */
456
-	public function getMimeTypeDetector();
457
-
458
-	/**
459
-	 * Get the MimeTypeLoader
460
-	 *
461
-	 * @return \OCP\Files\IMimeTypeLoader
462
-	 * @since 8.2.0
463
-	 */
464
-	public function getMimeTypeLoader();
465
-
466
-	/**
467
-	 * Get the EventDispatcher
468
-	 *
469
-	 * @return EventDispatcherInterface
470
-	 * @since 8.2.0
471
-	 */
472
-	public function getEventDispatcher();
473
-
474
-	/**
475
-	 * Get the Notification Manager
476
-	 *
477
-	 * @return \OCP\Notification\IManager
478
-	 * @since 9.0.0
479
-	 */
480
-	public function getNotificationManager();
481
-
482
-	/**
483
-	 * @return \OCP\Comments\ICommentsManager
484
-	 * @since 9.0.0
485
-	 */
486
-	public function getCommentsManager();
487
-
488
-	/**
489
-	 * Returns the system-tag manager
490
-	 *
491
-	 * @return \OCP\SystemTag\ISystemTagManager
492
-	 *
493
-	 * @since 9.0.0
494
-	 */
495
-	public function getSystemTagManager();
496
-
497
-	/**
498
-	 * Returns the system-tag object mapper
499
-	 *
500
-	 * @return \OCP\SystemTag\ISystemTagObjectMapper
501
-	 *
502
-	 * @since 9.0.0
503
-	 */
504
-	public function getSystemTagObjectMapper();
505
-
506
-	/**
507
-	 * Returns the share manager
508
-	 *
509
-	 * @return \OCP\Share\IManager
510
-	 * @since 9.0.0
511
-	 */
512
-	public function getShareManager();
513
-
514
-	/**
515
-	 * @return IContentSecurityPolicyManager
516
-	 * @since 9.0.0
517
-	 */
518
-	public function getContentSecurityPolicyManager();
519
-
520
-	/**
521
-	 * @return \OCP\IDateTimeZone
522
-	 * @since 8.0.0
523
-	 */
524
-	public function getDateTimeZone();
525
-
526
-	/**
527
-	 * @return \OCP\IDateTimeFormatter
528
-	 * @since 8.0.0
529
-	 */
530
-	public function getDateTimeFormatter();
531
-
532
-	/**
533
-	 * @return \OCP\Federation\ICloudIdManager
534
-	 * @since 12.0.0
535
-	 */
536
-	public function getCloudIdManager();
537
-
538
-	/**
539
-	 * @return \OCP\Remote\Api\IApiFactory
540
-	 * @since 13.0.0
541
-	 */
542
-	public function getRemoteApiFactory();
543
-
544
-	/**
545
-	 * @return \OCP\Remote\IInstanceFactory
546
-	 * @since 13.0.0
547
-	 */
548
-	public function getRemoteInstanceFactory();
61
+    /**
62
+     * The calendar manager will act as a broker between consumers for calendar information and
63
+     * providers which actual deliver the calendar information.
64
+     *
65
+     * @return \OCP\Calendar\IManager
66
+     * @since 13.0.0
67
+     */
68
+    public function getCalendarManager();
69
+
70
+    /**
71
+     * The contacts manager will act as a broker between consumers for contacts information and
72
+     * providers which actual deliver the contact information.
73
+     *
74
+     * @return \OCP\Contacts\IManager
75
+     * @since 6.0.0
76
+     */
77
+    public function getContactsManager();
78
+
79
+    /**
80
+     * The current request object holding all information about the request currently being processed
81
+     * is returned from this method.
82
+     * In case the current execution was not initiated by a web request null is returned
83
+     *
84
+     * @return \OCP\IRequest
85
+     * @since 6.0.0
86
+     */
87
+    public function getRequest();
88
+
89
+    /**
90
+     * Returns the preview manager which can create preview images for a given file
91
+     *
92
+     * @return \OCP\IPreview
93
+     * @since 6.0.0
94
+     */
95
+    public function getPreviewManager();
96
+
97
+    /**
98
+     * Returns the tag manager which can get and set tags for different object types
99
+     *
100
+     * @see \OCP\ITagManager::load()
101
+     * @return \OCP\ITagManager
102
+     * @since 6.0.0
103
+     */
104
+    public function getTagManager();
105
+
106
+    /**
107
+     * Returns the root folder of ownCloud's data directory
108
+     *
109
+     * @return \OCP\Files\IRootFolder
110
+     * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
111
+     */
112
+    public function getRootFolder();
113
+
114
+    /**
115
+     * Returns a view to ownCloud's files folder
116
+     *
117
+     * @param string $userId user ID
118
+     * @return \OCP\Files\Folder
119
+     * @since 6.0.0 - parameter $userId was added in 8.0.0
120
+     * @see getUserFolder in \OCP\Files\IRootFolder
121
+     */
122
+    public function getUserFolder($userId = null);
123
+
124
+    /**
125
+     * Returns an app-specific view in ownClouds data directory
126
+     *
127
+     * @return \OCP\Files\Folder
128
+     * @since 6.0.0
129
+     * @deprecated 9.2.0 use IAppData
130
+     */
131
+    public function getAppFolder();
132
+
133
+    /**
134
+     * Returns a user manager
135
+     *
136
+     * @return \OCP\IUserManager
137
+     * @since 8.0.0
138
+     */
139
+    public function getUserManager();
140
+
141
+    /**
142
+     * Returns a group manager
143
+     *
144
+     * @return \OCP\IGroupManager
145
+     * @since 8.0.0
146
+     */
147
+    public function getGroupManager();
148
+
149
+    /**
150
+     * Returns the user session
151
+     *
152
+     * @return \OCP\IUserSession
153
+     * @since 6.0.0
154
+     */
155
+    public function getUserSession();
156
+
157
+    /**
158
+     * Returns the navigation manager
159
+     *
160
+     * @return \OCP\INavigationManager
161
+     * @since 6.0.0
162
+     */
163
+    public function getNavigationManager();
164
+
165
+    /**
166
+     * Returns the config manager
167
+     *
168
+     * @return \OCP\IConfig
169
+     * @since 6.0.0
170
+     */
171
+    public function getConfig();
172
+
173
+    /**
174
+     * Returns a Crypto instance
175
+     *
176
+     * @return \OCP\Security\ICrypto
177
+     * @since 8.0.0
178
+     */
179
+    public function getCrypto();
180
+
181
+    /**
182
+     * Returns a Hasher instance
183
+     *
184
+     * @return \OCP\Security\IHasher
185
+     * @since 8.0.0
186
+     */
187
+    public function getHasher();
188
+
189
+    /**
190
+     * Returns a SecureRandom instance
191
+     *
192
+     * @return \OCP\Security\ISecureRandom
193
+     * @since 8.1.0
194
+     */
195
+    public function getSecureRandom();
196
+
197
+    /**
198
+     * Returns a CredentialsManager instance
199
+     *
200
+     * @return \OCP\Security\ICredentialsManager
201
+     * @since 9.0.0
202
+     */
203
+    public function getCredentialsManager();
204
+
205
+    /**
206
+     * Returns the app config manager
207
+     *
208
+     * @return \OCP\IAppConfig
209
+     * @since 7.0.0
210
+     */
211
+    public function getAppConfig();
212
+
213
+    /**
214
+     * @return \OCP\L10N\IFactory
215
+     * @since 8.2.0
216
+     */
217
+    public function getL10NFactory();
218
+
219
+    /**
220
+     * get an L10N instance
221
+     * @param string $app appid
222
+     * @param string $lang
223
+     * @return \OCP\IL10N
224
+     * @since 6.0.0 - parameter $lang was added in 8.0.0
225
+     */
226
+    public function getL10N($app, $lang = null);
227
+
228
+    /**
229
+     * @return \OC\Encryption\Manager
230
+     * @since 8.1.0
231
+     */
232
+    public function getEncryptionManager();
233
+
234
+    /**
235
+     * @return \OC\Encryption\File
236
+     * @since 8.1.0
237
+     */
238
+    public function getEncryptionFilesHelper();
239
+
240
+    /**
241
+     * @return \OCP\Encryption\Keys\IStorage
242
+     * @since 8.1.0
243
+     */
244
+    public function getEncryptionKeyStorage();
245
+
246
+    /**
247
+     * Returns the URL generator
248
+     *
249
+     * @return \OCP\IURLGenerator
250
+     * @since 6.0.0
251
+     */
252
+    public function getURLGenerator();
253
+
254
+    /**
255
+     * Returns an ICache instance
256
+     *
257
+     * @return \OCP\ICache
258
+     * @since 6.0.0
259
+     */
260
+    public function getCache();
261
+
262
+    /**
263
+     * Returns an \OCP\CacheFactory instance
264
+     *
265
+     * @return \OCP\ICacheFactory
266
+     * @since 7.0.0
267
+     */
268
+    public function getMemCacheFactory();
269
+
270
+    /**
271
+     * Returns the current session
272
+     *
273
+     * @return \OCP\ISession
274
+     * @since 6.0.0
275
+     */
276
+    public function getSession();
277
+
278
+    /**
279
+     * Returns the activity manager
280
+     *
281
+     * @return \OCP\Activity\IManager
282
+     * @since 6.0.0
283
+     */
284
+    public function getActivityManager();
285
+
286
+    /**
287
+     * Returns the current session
288
+     *
289
+     * @return \OCP\IDBConnection
290
+     * @since 6.0.0
291
+     */
292
+    public function getDatabaseConnection();
293
+
294
+    /**
295
+     * Returns an avatar manager, used for avatar functionality
296
+     *
297
+     * @return \OCP\IAvatarManager
298
+     * @since 6.0.0
299
+     */
300
+    public function getAvatarManager();
301
+
302
+    /**
303
+     * Returns an job list for controlling background jobs
304
+     *
305
+     * @return \OCP\BackgroundJob\IJobList
306
+     * @since 7.0.0
307
+     */
308
+    public function getJobList();
309
+
310
+    /**
311
+     * Returns a logger instance
312
+     *
313
+     * @return \OCP\ILogger
314
+     * @since 8.0.0
315
+     */
316
+    public function getLogger();
317
+
318
+    /**
319
+     * returns a log factory instance
320
+     *
321
+     * @return ILogFactory
322
+     * @since 14.0.0
323
+     */
324
+    public function getLogFactory();
325
+
326
+    /**
327
+     * Returns a router for generating and matching urls
328
+     *
329
+     * @return \OCP\Route\IRouter
330
+     * @since 7.0.0
331
+     */
332
+    public function getRouter();
333
+
334
+    /**
335
+     * Returns a search instance
336
+     *
337
+     * @return \OCP\ISearch
338
+     * @since 7.0.0
339
+     */
340
+    public function getSearch();
341
+
342
+    /**
343
+     * Get the certificate manager for the user
344
+     *
345
+     * @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
346
+     * @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
347
+     * @since 8.0.0
348
+     */
349
+    public function getCertificateManager($userId = null);
350
+
351
+    /**
352
+     * Create a new event source
353
+     *
354
+     * @return \OCP\IEventSource
355
+     * @since 8.0.0
356
+     */
357
+    public function createEventSource();
358
+
359
+    /**
360
+     * Returns an instance of the HTTP client service
361
+     *
362
+     * @return \OCP\Http\Client\IClientService
363
+     * @since 8.1.0
364
+     */
365
+    public function getHTTPClientService();
366
+
367
+    /**
368
+     * Get the active event logger
369
+     *
370
+     * @return \OCP\Diagnostics\IEventLogger
371
+     * @since 8.0.0
372
+     */
373
+    public function getEventLogger();
374
+
375
+    /**
376
+     * Get the active query logger
377
+     *
378
+     * The returned logger only logs data when debug mode is enabled
379
+     *
380
+     * @return \OCP\Diagnostics\IQueryLogger
381
+     * @since 8.0.0
382
+     */
383
+    public function getQueryLogger();
384
+
385
+    /**
386
+     * Get the manager for temporary files and folders
387
+     *
388
+     * @return \OCP\ITempManager
389
+     * @since 8.0.0
390
+     */
391
+    public function getTempManager();
392
+
393
+    /**
394
+     * Get the app manager
395
+     *
396
+     * @return \OCP\App\IAppManager
397
+     * @since 8.0.0
398
+     */
399
+    public function getAppManager();
400
+
401
+    /**
402
+     * Get the webroot
403
+     *
404
+     * @return string
405
+     * @since 8.0.0
406
+     */
407
+    public function getWebRoot();
408
+
409
+    /**
410
+     * @return \OCP\Files\Config\IMountProviderCollection
411
+     * @since 8.0.0
412
+     */
413
+    public function getMountProviderCollection();
414
+
415
+    /**
416
+     * Get the IniWrapper
417
+     *
418
+     * @return \bantu\IniGetWrapper\IniGetWrapper
419
+     * @since 8.0.0
420
+     */
421
+    public function getIniWrapper();
422
+    /**
423
+     * @return \OCP\Command\IBus
424
+     * @since 8.1.0
425
+     */
426
+    public function getCommandBus();
427
+
428
+    /**
429
+     * Creates a new mailer
430
+     *
431
+     * @return \OCP\Mail\IMailer
432
+     * @since 8.1.0
433
+     */
434
+    public function getMailer();
435
+
436
+    /**
437
+     * Get the locking provider
438
+     *
439
+     * @return \OCP\Lock\ILockingProvider
440
+     * @since 8.1.0
441
+     */
442
+    public function getLockingProvider();
443
+
444
+    /**
445
+     * @return \OCP\Files\Mount\IMountManager
446
+     * @since 8.2.0
447
+     */
448
+    public function getMountManager();
449
+
450
+    /**
451
+     * Get the MimeTypeDetector
452
+     *
453
+     * @return \OCP\Files\IMimeTypeDetector
454
+     * @since 8.2.0
455
+     */
456
+    public function getMimeTypeDetector();
457
+
458
+    /**
459
+     * Get the MimeTypeLoader
460
+     *
461
+     * @return \OCP\Files\IMimeTypeLoader
462
+     * @since 8.2.0
463
+     */
464
+    public function getMimeTypeLoader();
465
+
466
+    /**
467
+     * Get the EventDispatcher
468
+     *
469
+     * @return EventDispatcherInterface
470
+     * @since 8.2.0
471
+     */
472
+    public function getEventDispatcher();
473
+
474
+    /**
475
+     * Get the Notification Manager
476
+     *
477
+     * @return \OCP\Notification\IManager
478
+     * @since 9.0.0
479
+     */
480
+    public function getNotificationManager();
481
+
482
+    /**
483
+     * @return \OCP\Comments\ICommentsManager
484
+     * @since 9.0.0
485
+     */
486
+    public function getCommentsManager();
487
+
488
+    /**
489
+     * Returns the system-tag manager
490
+     *
491
+     * @return \OCP\SystemTag\ISystemTagManager
492
+     *
493
+     * @since 9.0.0
494
+     */
495
+    public function getSystemTagManager();
496
+
497
+    /**
498
+     * Returns the system-tag object mapper
499
+     *
500
+     * @return \OCP\SystemTag\ISystemTagObjectMapper
501
+     *
502
+     * @since 9.0.0
503
+     */
504
+    public function getSystemTagObjectMapper();
505
+
506
+    /**
507
+     * Returns the share manager
508
+     *
509
+     * @return \OCP\Share\IManager
510
+     * @since 9.0.0
511
+     */
512
+    public function getShareManager();
513
+
514
+    /**
515
+     * @return IContentSecurityPolicyManager
516
+     * @since 9.0.0
517
+     */
518
+    public function getContentSecurityPolicyManager();
519
+
520
+    /**
521
+     * @return \OCP\IDateTimeZone
522
+     * @since 8.0.0
523
+     */
524
+    public function getDateTimeZone();
525
+
526
+    /**
527
+     * @return \OCP\IDateTimeFormatter
528
+     * @since 8.0.0
529
+     */
530
+    public function getDateTimeFormatter();
531
+
532
+    /**
533
+     * @return \OCP\Federation\ICloudIdManager
534
+     * @since 12.0.0
535
+     */
536
+    public function getCloudIdManager();
537
+
538
+    /**
539
+     * @return \OCP\Remote\Api\IApiFactory
540
+     * @since 13.0.0
541
+     */
542
+    public function getRemoteApiFactory();
543
+
544
+    /**
545
+     * @return \OCP\Remote\IInstanceFactory
546
+     * @since 13.0.0
547
+     */
548
+    public function getRemoteInstanceFactory();
549 549
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/AppInfo/Application.php 1 patch
Indentation   +199 added lines, -199 removed lines patch added patch discarded remove patch
@@ -53,203 +53,203 @@
 block discarded – undo
53 53
 
54 54
 class Application extends App {
55 55
 
56
-	/** @var ILogger */
57
-	protected $logger;
58
-
59
-	public function __construct() {
60
-		parent::__construct('admin_audit');
61
-		$this->initLogger();
62
-	}
63
-
64
-	public function initLogger() {
65
-		$c = $this->getContainer()->getServer();
66
-
67
-		$logFile = $c->getConfig()->getAppValue('admin_audit', 'logfile', null);
68
-		if($logFile === null) {
69
-			$this->logger = $c->getLogger();
70
-			return;
71
-		}
72
-		$this->logger = $c->getLogFactory()->getCustomLogger($logFile);
73
-
74
-	}
75
-
76
-	public function register() {
77
-		$this->registerHooks();
78
-	}
79
-
80
-	/**
81
-	 * Register hooks in order to log them
82
-	 */
83
-	protected function registerHooks() {
84
-		$this->userManagementHooks();
85
-		$this->groupHooks();
86
-		$this->authHooks();
87
-
88
-		$this->consoleHooks();
89
-		$this->appHooks();
90
-
91
-		$this->sharingHooks();
92
-
93
-		$this->fileHooks();
94
-		$this->trashbinHooks();
95
-		$this->versionsHooks();
96
-
97
-		$this->securityHooks();
98
-	}
99
-
100
-	protected function userManagementHooks() {
101
-		$userActions = new UserManagement($this->logger);
102
-
103
-		Util::connectHook('OC_User', 'post_createUser',	$userActions, 'create');
104
-		Util::connectHook('OC_User', 'post_deleteUser',	$userActions, 'delete');
105
-		Util::connectHook('OC_User', 'changeUser',	$userActions, 'change');
106
-
107
-		/** @var IUserSession|Session $userSession */
108
-		$userSession = $this->getContainer()->getServer()->getUserSession();
109
-		$userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
110
-		$userSession->listen('\OC\User', 'assignedUserId', [$userActions, 'assign']);
111
-		$userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']);
112
-	}
113
-
114
-	protected function groupHooks()  {
115
-		$groupActions = new GroupManagement($this->logger);
116
-
117
-		/** @var IGroupManager|Manager $groupManager */
118
-		$groupManager = $this->getContainer()->getServer()->getGroupManager();
119
-		$groupManager->listen('\OC\Group', 'postRemoveUser',  [$groupActions, 'removeUser']);
120
-		$groupManager->listen('\OC\Group', 'postAddUser',  [$groupActions, 'addUser']);
121
-		$groupManager->listen('\OC\Group', 'postDelete',  [$groupActions, 'deleteGroup']);
122
-		$groupManager->listen('\OC\Group', 'postCreate',  [$groupActions, 'createGroup']);
123
-	}
124
-
125
-	protected function sharingHooks() {
126
-		$shareActions = new Sharing($this->logger);
127
-
128
-		Util::connectHook(Share::class, 'post_shared', $shareActions, 'shared');
129
-		Util::connectHook(Share::class, 'post_unshare', $shareActions, 'unshare');
130
-		Util::connectHook(Share::class, 'post_update_permissions', $shareActions, 'updatePermissions');
131
-		Util::connectHook(Share::class, 'post_update_password', $shareActions, 'updatePassword');
132
-		Util::connectHook(Share::class, 'post_set_expiration_date', $shareActions, 'updateExpirationDate');
133
-		Util::connectHook(Share::class, 'share_link_access', $shareActions, 'shareAccessed');
134
-	}
135
-
136
-	protected function authHooks() {
137
-		$authActions = new Auth($this->logger);
138
-
139
-		Util::connectHook('OC_User', 'pre_login', $authActions, 'loginAttempt');
140
-		Util::connectHook('OC_User', 'post_login', $authActions, 'loginSuccessful');
141
-		Util::connectHook('OC_User', 'logout', $authActions, 'logout');
142
-	}
143
-
144
-	protected function appHooks() {
145
-
146
-		$eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
147
-		$eventDispatcher->addListener(ManagerEvent::EVENT_APP_ENABLE, function(ManagerEvent $event) {
148
-			$appActions = new AppManagement($this->logger);
149
-			$appActions->enableApp($event->getAppID());
150
-		});
151
-		$eventDispatcher->addListener(ManagerEvent::EVENT_APP_ENABLE_FOR_GROUPS, function(ManagerEvent $event) {
152
-			$appActions = new AppManagement($this->logger);
153
-			$appActions->enableAppForGroups($event->getAppID(), $event->getGroups());
154
-		});
155
-		$eventDispatcher->addListener(ManagerEvent::EVENT_APP_DISABLE, function(ManagerEvent $event) {
156
-			$appActions = new AppManagement($this->logger);
157
-			$appActions->disableApp($event->getAppID());
158
-		});
159
-
160
-	}
161
-
162
-	protected function consoleHooks() {
163
-		$eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
164
-		$eventDispatcher->addListener(ConsoleEvent::EVENT_RUN, function(ConsoleEvent $event) {
165
-			$appActions = new Console($this->logger);
166
-			$appActions->runCommand($event->getArguments());
167
-		});
168
-	}
169
-
170
-	protected function fileHooks() {
171
-		$fileActions = new Files($this->logger);
172
-		$eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
173
-		$eventDispatcher->addListener(
174
-			IPreview::EVENT,
175
-			function(GenericEvent $event) use ($fileActions) {
176
-				/** @var File $file */
177
-				$file = $event->getSubject();
178
-				$fileActions->preview([
179
-					'path' => substr($file->getInternalPath(), 5),
180
-					'width' => $event->getArguments()['width'],
181
-					'height' => $event->getArguments()['height'],
182
-					'crop' => $event->getArguments()['crop'],
183
-					'mode'  => $event->getArguments()['mode']
184
-				]);
185
-			}
186
-		);
187
-
188
-		Util::connectHook(
189
-			Filesystem::CLASSNAME,
190
-			Filesystem::signal_post_rename,
191
-			$fileActions,
192
-			'rename'
193
-		);
194
-		Util::connectHook(
195
-			Filesystem::CLASSNAME,
196
-			Filesystem::signal_post_create,
197
-			$fileActions,
198
-			'create'
199
-		);
200
-		Util::connectHook(
201
-			Filesystem::CLASSNAME,
202
-			Filesystem::signal_post_copy,
203
-			$fileActions,
204
-			'copy'
205
-		);
206
-		Util::connectHook(
207
-			Filesystem::CLASSNAME,
208
-			Filesystem::signal_post_write,
209
-			$fileActions,
210
-			'write'
211
-		);
212
-		Util::connectHook(
213
-			Filesystem::CLASSNAME,
214
-			Filesystem::signal_post_update,
215
-			$fileActions,
216
-			'update'
217
-		);
218
-		Util::connectHook(
219
-			Filesystem::CLASSNAME,
220
-			Filesystem::signal_read,
221
-			$fileActions,
222
-			'read'
223
-		);
224
-		Util::connectHook(
225
-			Filesystem::CLASSNAME,
226
-			Filesystem::signal_delete,
227
-			$fileActions,
228
-			'delete'
229
-		);
230
-	}
231
-
232
-	protected function versionsHooks() {
233
-		$versionsActions = new Versions($this->logger);
234
-		Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
235
-		Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete');
236
-	}
237
-
238
-	protected function trashbinHooks() {
239
-		$trashActions = new Trashbin($this->logger);
240
-		Util::connectHook('\OCP\Trashbin', 'preDelete', $trashActions, 'delete');
241
-		Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', $trashActions, 'restore');
242
-	}
243
-
244
-	protected function securityHooks() {
245
-		$eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
246
-		$eventDispatcher->addListener(IProvider::EVENT_SUCCESS, function(GenericEvent $event) {
247
-			$security = new Security($this->logger);
248
-			$security->twofactorSuccess($event->getSubject(), $event->getArguments());
249
-		});
250
-		$eventDispatcher->addListener(IProvider::EVENT_FAILED, function(GenericEvent $event) {
251
-			$security = new Security($this->logger);
252
-			$security->twofactorFailed($event->getSubject(), $event->getArguments());
253
-		});
254
-	}
56
+    /** @var ILogger */
57
+    protected $logger;
58
+
59
+    public function __construct() {
60
+        parent::__construct('admin_audit');
61
+        $this->initLogger();
62
+    }
63
+
64
+    public function initLogger() {
65
+        $c = $this->getContainer()->getServer();
66
+
67
+        $logFile = $c->getConfig()->getAppValue('admin_audit', 'logfile', null);
68
+        if($logFile === null) {
69
+            $this->logger = $c->getLogger();
70
+            return;
71
+        }
72
+        $this->logger = $c->getLogFactory()->getCustomLogger($logFile);
73
+
74
+    }
75
+
76
+    public function register() {
77
+        $this->registerHooks();
78
+    }
79
+
80
+    /**
81
+     * Register hooks in order to log them
82
+     */
83
+    protected function registerHooks() {
84
+        $this->userManagementHooks();
85
+        $this->groupHooks();
86
+        $this->authHooks();
87
+
88
+        $this->consoleHooks();
89
+        $this->appHooks();
90
+
91
+        $this->sharingHooks();
92
+
93
+        $this->fileHooks();
94
+        $this->trashbinHooks();
95
+        $this->versionsHooks();
96
+
97
+        $this->securityHooks();
98
+    }
99
+
100
+    protected function userManagementHooks() {
101
+        $userActions = new UserManagement($this->logger);
102
+
103
+        Util::connectHook('OC_User', 'post_createUser',	$userActions, 'create');
104
+        Util::connectHook('OC_User', 'post_deleteUser',	$userActions, 'delete');
105
+        Util::connectHook('OC_User', 'changeUser',	$userActions, 'change');
106
+
107
+        /** @var IUserSession|Session $userSession */
108
+        $userSession = $this->getContainer()->getServer()->getUserSession();
109
+        $userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
110
+        $userSession->listen('\OC\User', 'assignedUserId', [$userActions, 'assign']);
111
+        $userSession->listen('\OC\User', 'postUnassignedUserId', [$userActions, 'unassign']);
112
+    }
113
+
114
+    protected function groupHooks()  {
115
+        $groupActions = new GroupManagement($this->logger);
116
+
117
+        /** @var IGroupManager|Manager $groupManager */
118
+        $groupManager = $this->getContainer()->getServer()->getGroupManager();
119
+        $groupManager->listen('\OC\Group', 'postRemoveUser',  [$groupActions, 'removeUser']);
120
+        $groupManager->listen('\OC\Group', 'postAddUser',  [$groupActions, 'addUser']);
121
+        $groupManager->listen('\OC\Group', 'postDelete',  [$groupActions, 'deleteGroup']);
122
+        $groupManager->listen('\OC\Group', 'postCreate',  [$groupActions, 'createGroup']);
123
+    }
124
+
125
+    protected function sharingHooks() {
126
+        $shareActions = new Sharing($this->logger);
127
+
128
+        Util::connectHook(Share::class, 'post_shared', $shareActions, 'shared');
129
+        Util::connectHook(Share::class, 'post_unshare', $shareActions, 'unshare');
130
+        Util::connectHook(Share::class, 'post_update_permissions', $shareActions, 'updatePermissions');
131
+        Util::connectHook(Share::class, 'post_update_password', $shareActions, 'updatePassword');
132
+        Util::connectHook(Share::class, 'post_set_expiration_date', $shareActions, 'updateExpirationDate');
133
+        Util::connectHook(Share::class, 'share_link_access', $shareActions, 'shareAccessed');
134
+    }
135
+
136
+    protected function authHooks() {
137
+        $authActions = new Auth($this->logger);
138
+
139
+        Util::connectHook('OC_User', 'pre_login', $authActions, 'loginAttempt');
140
+        Util::connectHook('OC_User', 'post_login', $authActions, 'loginSuccessful');
141
+        Util::connectHook('OC_User', 'logout', $authActions, 'logout');
142
+    }
143
+
144
+    protected function appHooks() {
145
+
146
+        $eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
147
+        $eventDispatcher->addListener(ManagerEvent::EVENT_APP_ENABLE, function(ManagerEvent $event) {
148
+            $appActions = new AppManagement($this->logger);
149
+            $appActions->enableApp($event->getAppID());
150
+        });
151
+        $eventDispatcher->addListener(ManagerEvent::EVENT_APP_ENABLE_FOR_GROUPS, function(ManagerEvent $event) {
152
+            $appActions = new AppManagement($this->logger);
153
+            $appActions->enableAppForGroups($event->getAppID(), $event->getGroups());
154
+        });
155
+        $eventDispatcher->addListener(ManagerEvent::EVENT_APP_DISABLE, function(ManagerEvent $event) {
156
+            $appActions = new AppManagement($this->logger);
157
+            $appActions->disableApp($event->getAppID());
158
+        });
159
+
160
+    }
161
+
162
+    protected function consoleHooks() {
163
+        $eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
164
+        $eventDispatcher->addListener(ConsoleEvent::EVENT_RUN, function(ConsoleEvent $event) {
165
+            $appActions = new Console($this->logger);
166
+            $appActions->runCommand($event->getArguments());
167
+        });
168
+    }
169
+
170
+    protected function fileHooks() {
171
+        $fileActions = new Files($this->logger);
172
+        $eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
173
+        $eventDispatcher->addListener(
174
+            IPreview::EVENT,
175
+            function(GenericEvent $event) use ($fileActions) {
176
+                /** @var File $file */
177
+                $file = $event->getSubject();
178
+                $fileActions->preview([
179
+                    'path' => substr($file->getInternalPath(), 5),
180
+                    'width' => $event->getArguments()['width'],
181
+                    'height' => $event->getArguments()['height'],
182
+                    'crop' => $event->getArguments()['crop'],
183
+                    'mode'  => $event->getArguments()['mode']
184
+                ]);
185
+            }
186
+        );
187
+
188
+        Util::connectHook(
189
+            Filesystem::CLASSNAME,
190
+            Filesystem::signal_post_rename,
191
+            $fileActions,
192
+            'rename'
193
+        );
194
+        Util::connectHook(
195
+            Filesystem::CLASSNAME,
196
+            Filesystem::signal_post_create,
197
+            $fileActions,
198
+            'create'
199
+        );
200
+        Util::connectHook(
201
+            Filesystem::CLASSNAME,
202
+            Filesystem::signal_post_copy,
203
+            $fileActions,
204
+            'copy'
205
+        );
206
+        Util::connectHook(
207
+            Filesystem::CLASSNAME,
208
+            Filesystem::signal_post_write,
209
+            $fileActions,
210
+            'write'
211
+        );
212
+        Util::connectHook(
213
+            Filesystem::CLASSNAME,
214
+            Filesystem::signal_post_update,
215
+            $fileActions,
216
+            'update'
217
+        );
218
+        Util::connectHook(
219
+            Filesystem::CLASSNAME,
220
+            Filesystem::signal_read,
221
+            $fileActions,
222
+            'read'
223
+        );
224
+        Util::connectHook(
225
+            Filesystem::CLASSNAME,
226
+            Filesystem::signal_delete,
227
+            $fileActions,
228
+            'delete'
229
+        );
230
+    }
231
+
232
+    protected function versionsHooks() {
233
+        $versionsActions = new Versions($this->logger);
234
+        Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
235
+        Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete');
236
+    }
237
+
238
+    protected function trashbinHooks() {
239
+        $trashActions = new Trashbin($this->logger);
240
+        Util::connectHook('\OCP\Trashbin', 'preDelete', $trashActions, 'delete');
241
+        Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', $trashActions, 'restore');
242
+    }
243
+
244
+    protected function securityHooks() {
245
+        $eventDispatcher = $this->getContainer()->getServer()->getEventDispatcher();
246
+        $eventDispatcher->addListener(IProvider::EVENT_SUCCESS, function(GenericEvent $event) {
247
+            $security = new Security($this->logger);
248
+            $security->twofactorSuccess($event->getSubject(), $event->getArguments());
249
+        });
250
+        $eventDispatcher->addListener(IProvider::EVENT_FAILED, function(GenericEvent $event) {
251
+            $security = new Security($this->logger);
252
+            $security->twofactorFailed($event->getSubject(), $event->getArguments());
253
+        });
254
+    }
255 255
 }
Please login to merge, or discard this patch.
lib/public/Log/IFileBased.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 namespace OCP\Log;
25 25
 
26 26
 interface IFileBased {
27
-	public function getLogFilePath();
27
+    public function getLogFilePath();
28 28
 
29
-	public function getEntries($limit=50, $offset=0);
29
+    public function getEntries($limit=50, $offset=0);
30 30
 }
Please login to merge, or discard this patch.
core/ajax/update.php 1 patch
Indentation   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 use Symfony\Component\EventDispatcher\GenericEvent;
34 34
 
35 35
 if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
36
-	@set_time_limit(0);
36
+    @set_time_limit(0);
37 37
 }
38 38
 
39 39
 require_once '../../lib/base.php';
@@ -47,188 +47,188 @@  discard block
 block discarded – undo
47 47
 $eventSource->send('success', (string)$l->t('Preparing update'));
48 48
 
49 49
 class FeedBackHandler {
50
-	/** @var integer */
51
-	private $progressStateMax = 100;
52
-	/** @var integer */
53
-	private $progressStateStep = 0;
54
-	/** @var string */
55
-	private $currentStep;
56
-	/** @var \OCP\IEventSource */
57
-	private $eventSource;
58
-	/** @var \OCP\IL10N */
59
-	private $l10n;
60
-
61
-	public function __construct(\OCP\IEventSource $eventSource, \OCP\IL10N $l10n) {
62
-		$this->eventSource = $eventSource;
63
-		$this->l10n = $l10n;
64
-	}
65
-
66
-	public function handleRepairFeedback($event) {
67
-		if (!$event instanceof GenericEvent) {
68
-			return;
69
-		}
70
-
71
-		switch ($event->getSubject()) {
72
-			case '\OC\Repair::startProgress':
73
-				$this->progressStateMax = $event->getArgument(0);
74
-				$this->progressStateStep = 0;
75
-				$this->currentStep = $event->getArgument(1);
76
-				break;
77
-			case '\OC\Repair::advance':
78
-				$this->progressStateStep += $event->getArgument(0);
79
-				$desc = $event->getArgument(1);
80
-				if (empty($desc)) {
81
-					$desc = $this->currentStep;
82
-				}
83
-				$this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc]));
84
-				break;
85
-			case '\OC\Repair::finishProgress':
86
-				$this->progressStateMax = $this->progressStateStep;
87
-				$this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep]));
88
-				break;
89
-			case '\OC\Repair::step':
90
-				break;
91
-			case '\OC\Repair::info':
92
-				break;
93
-			case '\OC\Repair::warning':
94
-				$this->eventSource->send('notice', (string)$this->l10n->t('Repair warning: ') . $event->getArgument(0));
95
-				break;
96
-			case '\OC\Repair::error':
97
-				$this->eventSource->send('notice', (string)$this->l10n->t('Repair error: ') . $event->getArgument(0));
98
-				break;
99
-		}
100
-	}
50
+    /** @var integer */
51
+    private $progressStateMax = 100;
52
+    /** @var integer */
53
+    private $progressStateStep = 0;
54
+    /** @var string */
55
+    private $currentStep;
56
+    /** @var \OCP\IEventSource */
57
+    private $eventSource;
58
+    /** @var \OCP\IL10N */
59
+    private $l10n;
60
+
61
+    public function __construct(\OCP\IEventSource $eventSource, \OCP\IL10N $l10n) {
62
+        $this->eventSource = $eventSource;
63
+        $this->l10n = $l10n;
64
+    }
65
+
66
+    public function handleRepairFeedback($event) {
67
+        if (!$event instanceof GenericEvent) {
68
+            return;
69
+        }
70
+
71
+        switch ($event->getSubject()) {
72
+            case '\OC\Repair::startProgress':
73
+                $this->progressStateMax = $event->getArgument(0);
74
+                $this->progressStateStep = 0;
75
+                $this->currentStep = $event->getArgument(1);
76
+                break;
77
+            case '\OC\Repair::advance':
78
+                $this->progressStateStep += $event->getArgument(0);
79
+                $desc = $event->getArgument(1);
80
+                if (empty($desc)) {
81
+                    $desc = $this->currentStep;
82
+                }
83
+                $this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $desc]));
84
+                break;
85
+            case '\OC\Repair::finishProgress':
86
+                $this->progressStateMax = $this->progressStateStep;
87
+                $this->eventSource->send('success', (string)$this->l10n->t('[%d / %d]: %s', [$this->progressStateStep, $this->progressStateMax, $this->currentStep]));
88
+                break;
89
+            case '\OC\Repair::step':
90
+                break;
91
+            case '\OC\Repair::info':
92
+                break;
93
+            case '\OC\Repair::warning':
94
+                $this->eventSource->send('notice', (string)$this->l10n->t('Repair warning: ') . $event->getArgument(0));
95
+                break;
96
+            case '\OC\Repair::error':
97
+                $this->eventSource->send('notice', (string)$this->l10n->t('Repair error: ') . $event->getArgument(0));
98
+                break;
99
+        }
100
+    }
101 101
 }
102 102
 
103 103
 if (\OCP\Util::needUpgrade()) {
104 104
 
105
-	$config = \OC::$server->getSystemConfig();
106
-	if ($config->getValue('upgrade.disable-web', false)) {
107
-		$eventSource->send('failure', (string)$l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
108
-		$eventSource->close();
109
-		exit();
110
-	}
111
-
112
-	// if a user is currently logged in, their session must be ignored to
113
-	// avoid side effects
114
-	\OC_User::setIncognitoMode(true);
115
-
116
-	$logger = \OC::$server->getLogger();
117
-	$config = \OC::$server->getConfig();
118
-	$updater = new \OC\Updater(
119
-			$config,
120
-			\OC::$server->getIntegrityCodeChecker(),
121
-			$logger,
122
-			\OC::$server->query(\OC\Installer::class)
123
-	);
124
-	$incompatibleApps = [];
125
-
126
-	$dispatcher = \OC::$server->getEventDispatcher();
127
-	$dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($eventSource, $l) {
128
-		if ($event instanceof GenericEvent) {
129
-			$eventSource->send('success', (string)$l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()]));
130
-		}
131
-	});
132
-	$dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($eventSource, $l) {
133
-		if ($event instanceof GenericEvent) {
134
-			$eventSource->send('success', (string)$l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()]));
135
-		}
136
-	});
137
-	$feedBack = new FeedBackHandler($eventSource, $l);
138
-	$dispatcher->addListener('\OC\Repair::startProgress', [$feedBack, 'handleRepairFeedback']);
139
-	$dispatcher->addListener('\OC\Repair::advance', [$feedBack, 'handleRepairFeedback']);
140
-	$dispatcher->addListener('\OC\Repair::finishProgress', [$feedBack, 'handleRepairFeedback']);
141
-	$dispatcher->addListener('\OC\Repair::step', [$feedBack, 'handleRepairFeedback']);
142
-	$dispatcher->addListener('\OC\Repair::info', [$feedBack, 'handleRepairFeedback']);
143
-	$dispatcher->addListener('\OC\Repair::warning', [$feedBack, 'handleRepairFeedback']);
144
-	$dispatcher->addListener('\OC\Repair::error', [$feedBack, 'handleRepairFeedback']);
145
-
146
-	$updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) {
147
-		$eventSource->send('success', (string)$l->t('Turned on maintenance mode'));
148
-	});
149
-	$updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) {
150
-		$eventSource->send('success', (string)$l->t('Turned off maintenance mode'));
151
-	});
152
-	$updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) {
153
-		$eventSource->send('success', (string)$l->t('Maintenance mode is kept active'));
154
-	});
155
-	$updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($eventSource, $l) {
156
-		$eventSource->send('success', (string)$l->t('Updating database schema'));
157
-	});
158
-	$updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
159
-		$eventSource->send('success', (string)$l->t('Updated database'));
160
-	});
161
-	$updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($eventSource, $l) {
162
-		$eventSource->send('success', (string)$l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)'));
163
-	});
164
-	$updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use ($eventSource, $l) {
165
-		$eventSource->send('success', (string)$l->t('Checked database schema update'));
166
-	});
167
-	$updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) {
168
-		$eventSource->send('success', (string)$l->t('Checking updates of apps'));
169
-	});
170
-	$updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) {
171
-		$eventSource->send('success', (string)$l->t('Checking for update of app "%s" in appstore', [$app]));
172
-	});
173
-	$updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) {
174
-		$eventSource->send('success', (string)$l->t('Update app "%s" from appstore', [$app]));
175
-	});
176
-	$updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) {
177
-		$eventSource->send('success', (string)$l->t('Checked for update of app "%s" in appstore', [$app]));
178
-	});
179
-	$updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) {
180
-		$eventSource->send('success', (string)$l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
181
-	});
182
-	$updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($eventSource, $l) {
183
-		$eventSource->send('success', (string)$l->t('Checked database schema update for apps'));
184
-	});
185
-	$updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) {
186
-		$eventSource->send('success', (string)$l->t('Updated "%s" to %s', array($app, $version)));
187
-	});
188
-	$updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) {
189
-		$incompatibleApps[]= $app;
190
-	});
191
-	$updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config) {
192
-		$eventSource->send('failure', $message);
193
-		$eventSource->close();
194
-		$config->setSystemValue('maintenance', false);
195
-	});
196
-	$updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) {
197
-		$eventSource->send('success', (string)$l->t('Set log level to debug'));
198
-	});
199
-	$updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) {
200
-		$eventSource->send('success', (string)$l->t('Reset log level'));
201
-	});
202
-	$updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($eventSource, $l) {
203
-		$eventSource->send('success', (string)$l->t('Starting code integrity check'));
204
-	});
205
-	$updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($eventSource, $l) {
206
-		$eventSource->send('success', (string)$l->t('Finished code integrity check'));
207
-	});
208
-
209
-	try {
210
-		$updater->upgrade();
211
-	} catch (\Exception $e) {
212
-		\OC::$server->getLogger()->logException($e, [
213
-			'level' => ILogger::ERROR,
214
-			'app' => 'update',
215
-		]);
216
-		$eventSource->send('failure', get_class($e) . ': ' . $e->getMessage());
217
-		$eventSource->close();
218
-		exit();
219
-	}
220
-
221
-	$disabledApps = [];
222
-	foreach ($incompatibleApps as $app) {
223
-		$disabledApps[$app] = (string) $l->t('%s (incompatible)', [$app]);
224
-	}
225
-
226
-	if (!empty($disabledApps)) {
227
-		$eventSource->send('notice',
228
-			(string)$l->t('Following apps have been disabled: %s', [implode(', ', $disabledApps)]));
229
-	}
105
+    $config = \OC::$server->getSystemConfig();
106
+    if ($config->getValue('upgrade.disable-web', false)) {
107
+        $eventSource->send('failure', (string)$l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
108
+        $eventSource->close();
109
+        exit();
110
+    }
111
+
112
+    // if a user is currently logged in, their session must be ignored to
113
+    // avoid side effects
114
+    \OC_User::setIncognitoMode(true);
115
+
116
+    $logger = \OC::$server->getLogger();
117
+    $config = \OC::$server->getConfig();
118
+    $updater = new \OC\Updater(
119
+            $config,
120
+            \OC::$server->getIntegrityCodeChecker(),
121
+            $logger,
122
+            \OC::$server->query(\OC\Installer::class)
123
+    );
124
+    $incompatibleApps = [];
125
+
126
+    $dispatcher = \OC::$server->getEventDispatcher();
127
+    $dispatcher->addListener('\OC\DB\Migrator::executeSql', function($event) use ($eventSource, $l) {
128
+        if ($event instanceof GenericEvent) {
129
+            $eventSource->send('success', (string)$l->t('[%d / %d]: %s', [$event[0], $event[1], $event->getSubject()]));
130
+        }
131
+    });
132
+    $dispatcher->addListener('\OC\DB\Migrator::checkTable', function($event) use ($eventSource, $l) {
133
+        if ($event instanceof GenericEvent) {
134
+            $eventSource->send('success', (string)$l->t('[%d / %d]: Checking table %s', [$event[0], $event[1], $event->getSubject()]));
135
+        }
136
+    });
137
+    $feedBack = new FeedBackHandler($eventSource, $l);
138
+    $dispatcher->addListener('\OC\Repair::startProgress', [$feedBack, 'handleRepairFeedback']);
139
+    $dispatcher->addListener('\OC\Repair::advance', [$feedBack, 'handleRepairFeedback']);
140
+    $dispatcher->addListener('\OC\Repair::finishProgress', [$feedBack, 'handleRepairFeedback']);
141
+    $dispatcher->addListener('\OC\Repair::step', [$feedBack, 'handleRepairFeedback']);
142
+    $dispatcher->addListener('\OC\Repair::info', [$feedBack, 'handleRepairFeedback']);
143
+    $dispatcher->addListener('\OC\Repair::warning', [$feedBack, 'handleRepairFeedback']);
144
+    $dispatcher->addListener('\OC\Repair::error', [$feedBack, 'handleRepairFeedback']);
145
+
146
+    $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use ($eventSource, $l) {
147
+        $eventSource->send('success', (string)$l->t('Turned on maintenance mode'));
148
+    });
149
+    $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use ($eventSource, $l) {
150
+        $eventSource->send('success', (string)$l->t('Turned off maintenance mode'));
151
+    });
152
+    $updater->listen('\OC\Updater', 'maintenanceActive', function () use ($eventSource, $l) {
153
+        $eventSource->send('success', (string)$l->t('Maintenance mode is kept active'));
154
+    });
155
+    $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($eventSource, $l) {
156
+        $eventSource->send('success', (string)$l->t('Updating database schema'));
157
+    });
158
+    $updater->listen('\OC\Updater', 'dbUpgrade', function () use ($eventSource, $l) {
159
+        $eventSource->send('success', (string)$l->t('Updated database'));
160
+    });
161
+    $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($eventSource, $l) {
162
+        $eventSource->send('success', (string)$l->t('Checking whether the database schema can be updated (this can take a long time depending on the database size)'));
163
+    });
164
+    $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use ($eventSource, $l) {
165
+        $eventSource->send('success', (string)$l->t('Checked database schema update'));
166
+    });
167
+    $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($eventSource, $l) {
168
+        $eventSource->send('success', (string)$l->t('Checking updates of apps'));
169
+    });
170
+    $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use ($eventSource, $l) {
171
+        $eventSource->send('success', (string)$l->t('Checking for update of app "%s" in appstore', [$app]));
172
+    });
173
+    $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use ($eventSource, $l) {
174
+        $eventSource->send('success', (string)$l->t('Update app "%s" from appstore', [$app]));
175
+    });
176
+    $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use ($eventSource, $l) {
177
+        $eventSource->send('success', (string)$l->t('Checked for update of app "%s" in appstore', [$app]));
178
+    });
179
+    $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($eventSource, $l) {
180
+        $eventSource->send('success', (string)$l->t('Checking whether the database schema for %s can be updated (this can take a long time depending on the database size)', [$app]));
181
+    });
182
+    $updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($eventSource, $l) {
183
+        $eventSource->send('success', (string)$l->t('Checked database schema update for apps'));
184
+    });
185
+    $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($eventSource, $l) {
186
+        $eventSource->send('success', (string)$l->t('Updated "%s" to %s', array($app, $version)));
187
+    });
188
+    $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use (&$incompatibleApps) {
189
+        $incompatibleApps[]= $app;
190
+    });
191
+    $updater->listen('\OC\Updater', 'failure', function ($message) use ($eventSource, $config) {
192
+        $eventSource->send('failure', $message);
193
+        $eventSource->close();
194
+        $config->setSystemValue('maintenance', false);
195
+    });
196
+    $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) {
197
+        $eventSource->send('success', (string)$l->t('Set log level to debug'));
198
+    });
199
+    $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($eventSource, $l) {
200
+        $eventSource->send('success', (string)$l->t('Reset log level'));
201
+    });
202
+    $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($eventSource, $l) {
203
+        $eventSource->send('success', (string)$l->t('Starting code integrity check'));
204
+    });
205
+    $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($eventSource, $l) {
206
+        $eventSource->send('success', (string)$l->t('Finished code integrity check'));
207
+    });
208
+
209
+    try {
210
+        $updater->upgrade();
211
+    } catch (\Exception $e) {
212
+        \OC::$server->getLogger()->logException($e, [
213
+            'level' => ILogger::ERROR,
214
+            'app' => 'update',
215
+        ]);
216
+        $eventSource->send('failure', get_class($e) . ': ' . $e->getMessage());
217
+        $eventSource->close();
218
+        exit();
219
+    }
220
+
221
+    $disabledApps = [];
222
+    foreach ($incompatibleApps as $app) {
223
+        $disabledApps[$app] = (string) $l->t('%s (incompatible)', [$app]);
224
+    }
225
+
226
+    if (!empty($disabledApps)) {
227
+        $eventSource->send('notice',
228
+            (string)$l->t('Following apps have been disabled: %s', [implode(', ', $disabledApps)]));
229
+    }
230 230
 } else {
231
-	$eventSource->send('notice', (string)$l->t('Already up to date'));
231
+    $eventSource->send('notice', (string)$l->t('Already up to date'));
232 232
 }
233 233
 
234 234
 $eventSource->send('done', '');
Please login to merge, or discard this patch.
core/Controller/SetupController.php 1 patch
Indentation   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -33,97 +33,97 @@
 block discarded – undo
33 33
 use OCP\ILogger;
34 34
 
35 35
 class SetupController {
36
-	/** @var Setup */
37
-	protected $setupHelper;
38
-	/** @var string */
39
-	private $autoConfigFile;
36
+    /** @var Setup */
37
+    protected $setupHelper;
38
+    /** @var string */
39
+    private $autoConfigFile;
40 40
 
41
-	/**
42
-	 * @param Setup $setupHelper
43
-	 */
44
-	function __construct(Setup $setupHelper) {
45
-		$this->autoConfigFile = \OC::$configDir.'autoconfig.php';
46
-		$this->setupHelper = $setupHelper;
47
-	}
41
+    /**
42
+     * @param Setup $setupHelper
43
+     */
44
+    function __construct(Setup $setupHelper) {
45
+        $this->autoConfigFile = \OC::$configDir.'autoconfig.php';
46
+        $this->setupHelper = $setupHelper;
47
+    }
48 48
 
49
-	/**
50
-	 * @param $post
51
-	 */
52
-	public function run($post) {
53
-		// Check for autosetup:
54
-		$post = $this->loadAutoConfig($post);
55
-		$opts = $this->setupHelper->getSystemInfo();
49
+    /**
50
+     * @param $post
51
+     */
52
+    public function run($post) {
53
+        // Check for autosetup:
54
+        $post = $this->loadAutoConfig($post);
55
+        $opts = $this->setupHelper->getSystemInfo();
56 56
 
57
-		// convert 'abcpassword' to 'abcpass'
58
-		if (isset($post['adminpassword'])) {
59
-			$post['adminpass'] = $post['adminpassword'];
60
-		}
61
-		if (isset($post['dbpassword'])) {
62
-			$post['dbpass'] = $post['dbpassword'];
63
-		}
57
+        // convert 'abcpassword' to 'abcpass'
58
+        if (isset($post['adminpassword'])) {
59
+            $post['adminpass'] = $post['adminpassword'];
60
+        }
61
+        if (isset($post['dbpassword'])) {
62
+            $post['dbpass'] = $post['dbpassword'];
63
+        }
64 64
 
65
-		if(isset($post['install']) AND $post['install']=='true') {
66
-			// We have to launch the installation process :
67
-			$e = $this->setupHelper->install($post);
68
-			$errors = array('errors' => $e);
65
+        if(isset($post['install']) AND $post['install']=='true') {
66
+            // We have to launch the installation process :
67
+            $e = $this->setupHelper->install($post);
68
+            $errors = array('errors' => $e);
69 69
 
70
-			if(count($e) > 0) {
71
-				$options = array_merge($opts, $post, $errors);
72
-				$this->display($options);
73
-			} else {
74
-				$this->finishSetup();
75
-			}
76
-		} else {
77
-			$options = array_merge($opts, $post);
78
-			$this->display($options);
79
-		}
80
-	}
70
+            if(count($e) > 0) {
71
+                $options = array_merge($opts, $post, $errors);
72
+                $this->display($options);
73
+            } else {
74
+                $this->finishSetup();
75
+            }
76
+        } else {
77
+            $options = array_merge($opts, $post);
78
+            $this->display($options);
79
+        }
80
+    }
81 81
 
82
-	public function display($post) {
83
-		$defaults = array(
84
-			'adminlogin' => '',
85
-			'adminpass' => '',
86
-			'dbuser' => '',
87
-			'dbpass' => '',
88
-			'dbname' => '',
89
-			'dbtablespace' => '',
90
-			'dbhost' => 'localhost',
91
-			'dbtype' => '',
92
-		);
93
-		$parameters = array_merge($defaults, $post);
82
+    public function display($post) {
83
+        $defaults = array(
84
+            'adminlogin' => '',
85
+            'adminpass' => '',
86
+            'dbuser' => '',
87
+            'dbpass' => '',
88
+            'dbname' => '',
89
+            'dbtablespace' => '',
90
+            'dbhost' => 'localhost',
91
+            'dbtype' => '',
92
+        );
93
+        $parameters = array_merge($defaults, $post);
94 94
 
95
-		\OC_Util::addVendorScript('strengthify/jquery.strengthify');
96
-		\OC_Util::addVendorStyle('strengthify/strengthify');
97
-		\OC_Util::addScript('setup');
98
-		\OC_Template::printGuestPage('', 'installation', $parameters);
99
-	}
95
+        \OC_Util::addVendorScript('strengthify/jquery.strengthify');
96
+        \OC_Util::addVendorStyle('strengthify/strengthify');
97
+        \OC_Util::addScript('setup');
98
+        \OC_Template::printGuestPage('', 'installation', $parameters);
99
+    }
100 100
 
101
-	public function finishSetup() {
102
-		if( file_exists( $this->autoConfigFile )) {
103
-			unlink($this->autoConfigFile);
104
-		}
105
-		\OC::$server->getIntegrityCodeChecker()->runInstanceVerification();
106
-		\OC_Util::redirectToDefaultPage();
107
-	}
101
+    public function finishSetup() {
102
+        if( file_exists( $this->autoConfigFile )) {
103
+            unlink($this->autoConfigFile);
104
+        }
105
+        \OC::$server->getIntegrityCodeChecker()->runInstanceVerification();
106
+        \OC_Util::redirectToDefaultPage();
107
+    }
108 108
 
109
-	public function loadAutoConfig($post) {
110
-		if( file_exists($this->autoConfigFile)) {
111
-			\OCP\Util::writeLog('core', 'Autoconfig file found, setting up ownCloud…', ILogger::INFO);
112
-			$AUTOCONFIG = array();
113
-			include $this->autoConfigFile;
114
-			$post = array_merge ($post, $AUTOCONFIG);
115
-		}
109
+    public function loadAutoConfig($post) {
110
+        if( file_exists($this->autoConfigFile)) {
111
+            \OCP\Util::writeLog('core', 'Autoconfig file found, setting up ownCloud…', ILogger::INFO);
112
+            $AUTOCONFIG = array();
113
+            include $this->autoConfigFile;
114
+            $post = array_merge ($post, $AUTOCONFIG);
115
+        }
116 116
 
117
-		$dbIsSet = isset($post['dbtype']);
118
-		$directoryIsSet = isset($post['directory']);
119
-		$adminAccountIsSet = isset($post['adminlogin']);
117
+        $dbIsSet = isset($post['dbtype']);
118
+        $directoryIsSet = isset($post['directory']);
119
+        $adminAccountIsSet = isset($post['adminlogin']);
120 120
 
121
-		if ($dbIsSet AND $directoryIsSet AND $adminAccountIsSet) {
122
-			$post['install'] = 'true';
123
-		}
124
-		$post['dbIsSet'] = $dbIsSet;
125
-		$post['directoryIsSet'] = $directoryIsSet;
121
+        if ($dbIsSet AND $directoryIsSet AND $adminAccountIsSet) {
122
+            $post['install'] = 'true';
123
+        }
124
+        $post['dbIsSet'] = $dbIsSet;
125
+        $post['directoryIsSet'] = $directoryIsSet;
126 126
 
127
-		return $post;
128
-	}
127
+        return $post;
128
+    }
129 129
 }
Please login to merge, or discard this patch.