2014-05-28 13:13:07 -04:00
|
|
|
<?php
|
2025-02-13 04:35:13 -05:00
|
|
|
|
2014-05-28 13:13:07 -04:00
|
|
|
/**
|
2024-05-27 04:08:53 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2014-05-28 13:13:07 -04:00
|
|
|
*/
|
2025-05-28 07:26:07 -04:00
|
|
|
namespace OC\Core\AppInfo;
|
2014-05-28 13:13:07 -04:00
|
|
|
|
2019-05-28 11:56:01 -04:00
|
|
|
use OC\Authentication\Events\RemoteWipeFinished;
|
|
|
|
|
use OC\Authentication\Events\RemoteWipeStarted;
|
|
|
|
|
use OC\Authentication\Listeners\RemoteWipeActivityListener;
|
2019-07-02 08:58:48 -04:00
|
|
|
use OC\Authentication\Listeners\RemoteWipeEmailListener;
|
2019-05-28 11:56:01 -04:00
|
|
|
use OC\Authentication\Listeners\RemoteWipeNotificationsListener;
|
2021-04-27 09:43:34 -04:00
|
|
|
use OC\Authentication\Listeners\UserDeletedFilesCleanupListener;
|
2020-01-08 04:51:44 -05:00
|
|
|
use OC\Authentication\Listeners\UserDeletedStoreCleanupListener;
|
2020-06-15 10:09:39 -04:00
|
|
|
use OC\Authentication\Listeners\UserDeletedTokenCleanupListener;
|
2021-06-16 11:03:33 -04:00
|
|
|
use OC\Authentication\Listeners\UserDeletedWebAuthnCleanupListener;
|
2019-04-03 10:00:46 -04:00
|
|
|
use OC\Authentication\Notifications\Notifier as AuthenticationNotifier;
|
2025-05-28 06:39:22 -04:00
|
|
|
use OC\Core\Listener\AddMissingIndicesListener;
|
|
|
|
|
use OC\Core\Listener\AddMissingPrimaryKeyListener;
|
2022-10-22 06:49:11 -04:00
|
|
|
use OC\Core\Listener\BeforeTemplateRenderedListener;
|
2025-09-01 04:35:04 -04:00
|
|
|
use OC\Core\Listener\PasswordUpdatedListener;
|
2020-12-02 04:07:34 -05:00
|
|
|
use OC\Core\Notification\CoreNotifier;
|
2022-04-19 07:05:38 -04:00
|
|
|
use OC\TagManager;
|
2016-04-25 08:10:55 -04:00
|
|
|
use OCP\AppFramework\App;
|
2025-05-28 06:39:22 -04:00
|
|
|
use OCP\AppFramework\Bootstrap\IBootContext;
|
|
|
|
|
use OCP\AppFramework\Bootstrap\IBootstrap;
|
|
|
|
|
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
2023-08-14 11:47:10 -04:00
|
|
|
use OCP\AppFramework\Http\Events\BeforeLoginTemplateRenderedEvent;
|
2022-10-22 06:49:11 -04:00
|
|
|
use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent;
|
2023-07-19 17:48:11 -04:00
|
|
|
use OCP\DB\Events\AddMissingIndicesEvent;
|
2023-07-19 17:10:13 -04:00
|
|
|
use OCP\DB\Events\AddMissingPrimaryKeyEvent;
|
2021-04-27 09:43:34 -04:00
|
|
|
use OCP\User\Events\BeforeUserDeletedEvent;
|
2025-09-01 04:35:04 -04:00
|
|
|
use OCP\User\Events\PasswordUpdatedEvent;
|
2020-01-08 04:51:44 -05:00
|
|
|
use OCP\User\Events\UserDeletedEvent;
|
2016-04-25 08:10:55 -04:00
|
|
|
use OCP\Util;
|
2014-05-28 13:13:07 -04:00
|
|
|
|
2014-10-20 13:05:48 -04:00
|
|
|
/**
|
|
|
|
|
* Class Application
|
|
|
|
|
*
|
|
|
|
|
* @package OC\Core
|
|
|
|
|
*/
|
2025-05-28 06:39:22 -04:00
|
|
|
class Application extends App implements IBootstrap {
|
2014-05-28 13:13:07 -04:00
|
|
|
|
2025-05-28 06:39:22 -04:00
|
|
|
public const APP_ID = 'core';
|
2016-08-28 08:22:29 -04:00
|
|
|
|
2025-05-28 06:39:22 -04:00
|
|
|
/**
|
|
|
|
|
* Application constructor.
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(array $urlParams = []) {
|
|
|
|
|
parent::__construct(self::APP_ID, $urlParams);
|
|
|
|
|
}
|
2023-07-19 17:10:13 -04:00
|
|
|
|
2025-05-28 06:39:22 -04:00
|
|
|
public function register(IRegistrationContext $context): void {
|
|
|
|
|
$context->registerService('defaultMailAddress', function () {
|
|
|
|
|
return Util::getDefaultEmailAddress('lostpassword-noreply');
|
2023-07-19 17:10:13 -04:00
|
|
|
});
|
2020-11-10 03:34:57 -05:00
|
|
|
|
2025-05-28 06:39:22 -04:00
|
|
|
// register notifier
|
|
|
|
|
$context->registerNotifierService(CoreNotifier::class);
|
|
|
|
|
$context->registerNotifierService(AuthenticationNotifier::class);
|
|
|
|
|
|
|
|
|
|
// register event listeners
|
|
|
|
|
$context->registerEventListener(AddMissingIndicesEvent::class, AddMissingIndicesListener::class);
|
|
|
|
|
$context->registerEventListener(AddMissingPrimaryKeyEvent::class, AddMissingPrimaryKeyListener::class);
|
|
|
|
|
$context->registerEventListener(BeforeTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
|
|
|
|
|
$context->registerEventListener(BeforeLoginTemplateRenderedEvent::class, BeforeTemplateRenderedListener::class);
|
|
|
|
|
$context->registerEventListener(RemoteWipeStarted::class, RemoteWipeActivityListener::class);
|
|
|
|
|
$context->registerEventListener(RemoteWipeStarted::class, RemoteWipeNotificationsListener::class);
|
|
|
|
|
$context->registerEventListener(RemoteWipeStarted::class, RemoteWipeEmailListener::class);
|
|
|
|
|
$context->registerEventListener(RemoteWipeFinished::class, RemoteWipeActivityListener::class);
|
|
|
|
|
$context->registerEventListener(RemoteWipeFinished::class, RemoteWipeNotificationsListener::class);
|
|
|
|
|
$context->registerEventListener(RemoteWipeFinished::class, RemoteWipeEmailListener::class);
|
|
|
|
|
$context->registerEventListener(UserDeletedEvent::class, UserDeletedStoreCleanupListener::class);
|
|
|
|
|
$context->registerEventListener(UserDeletedEvent::class, UserDeletedTokenCleanupListener::class);
|
|
|
|
|
$context->registerEventListener(BeforeUserDeletedEvent::class, UserDeletedFilesCleanupListener::class);
|
|
|
|
|
$context->registerEventListener(UserDeletedEvent::class, UserDeletedFilesCleanupListener::class);
|
|
|
|
|
$context->registerEventListener(UserDeletedEvent::class, UserDeletedWebAuthnCleanupListener::class);
|
2025-09-01 04:35:04 -04:00
|
|
|
$context->registerEventListener(PasswordUpdatedEvent::class, PasswordUpdatedListener::class);
|
2022-04-04 17:15:00 -04:00
|
|
|
|
2022-04-19 07:05:38 -04:00
|
|
|
// Tags
|
2025-05-28 06:39:22 -04:00
|
|
|
$context->registerEventListener(UserDeletedEvent::class, TagManager::class);
|
2025-05-12 12:40:35 -04:00
|
|
|
|
|
|
|
|
// config lexicon
|
|
|
|
|
$context->registerConfigLexicon(ConfigLexicon::class);
|
2025-08-16 17:43:14 -04:00
|
|
|
|
|
|
|
|
$context->registerCapability(Capabilities::class);
|
2025-05-28 06:39:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function boot(IBootContext $context): void {
|
|
|
|
|
// ...
|
2014-10-20 13:05:48 -04:00
|
|
|
}
|
2025-05-28 06:39:22 -04:00
|
|
|
|
2014-05-28 13:13:07 -04:00
|
|
|
}
|