diff options
Diffstat (limited to 'apps/user_ldap/appinfo')
-rw-r--r-- | apps/user_ldap/appinfo/app.php | 19 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/register_command.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/routes.php | 11 |
3 files changed, 28 insertions, 5 deletions
diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php index 6f930ea39f0..cbdcafc58d6 100644 --- a/apps/user_ldap/appinfo/app.php +++ b/apps/user_ldap/appinfo/app.php @@ -31,6 +31,18 @@ $helper = new \OCA\User_LDAP\Helper(\OC::$server->getConfig()); $configPrefixes = $helper->getServerConfigurationPrefixes(true); $ldapWrapper = new OCA\User_LDAP\LDAP(); $ocConfig = \OC::$server->getConfig(); +$notificationManager = \OC::$server->getNotificationManager(); +$notificationManager->registerNotifier(function() { + return new \OCA\User_LDAP\Notification\Notifier( + \OC::$server->getL10NFactory() + ); +}, function() { + $l = \OC::$server->getL10N('user_ldap'); + return [ + 'id' => 'user_ldap', + 'name' => $l->t('LDAP user and group backend'), + ]; +}); if(count($configPrefixes) === 1) { $dbc = \OC::$server->getDatabaseConnection(); $userManager = new OCA\User_LDAP\User\Manager($ocConfig, @@ -39,18 +51,19 @@ if(count($configPrefixes) === 1) { \OC::$server->getAvatarManager(), new \OCP\Image(), $dbc, - \OC::$server->getUserManager() + \OC::$server->getUserManager(), + $notificationManager ); $connector = new OCA\User_LDAP\Connection($ldapWrapper, $configPrefixes[0]); $ldapAccess = new OCA\User_LDAP\Access($connector, $ldapWrapper, $userManager, $helper); $ldapAccess->setUserMapper(new OCA\User_LDAP\Mapping\UserMapping($dbc)); $ldapAccess->setGroupMapper(new OCA\User_LDAP\Mapping\GroupMapping($dbc)); - $userBackend = new OCA\User_LDAP\User_LDAP($ldapAccess, $ocConfig); + $userBackend = new OCA\User_LDAP\User_LDAP($ldapAccess, $ocConfig, $notificationManager); $groupBackend = new \OCA\User_LDAP\Group_LDAP($ldapAccess); } else if(count($configPrefixes) > 1) { $userBackend = new OCA\User_LDAP\User_Proxy( - $configPrefixes, $ldapWrapper, $ocConfig + $configPrefixes, $ldapWrapper, $ocConfig, $notificationManager ); $groupBackend = new OCA\User_LDAP\Group_Proxy($configPrefixes, $ldapWrapper); } diff --git a/apps/user_ldap/appinfo/register_command.php b/apps/user_ldap/appinfo/register_command.php index 41083f8d12a..3ae8bdbfc13 100644 --- a/apps/user_ldap/appinfo/register_command.php +++ b/apps/user_ldap/appinfo/register_command.php @@ -35,7 +35,8 @@ $ocConfig = \OC::$server->getConfig(); $uBackend = new User_Proxy( $helper->getServerConfigurationPrefixes(true), new LDAP(), - $ocConfig + $ocConfig, + \OC::$server->getNotificationManager() ); $deletedUsersIndex = new DeletedUsersIndex( $ocConfig, $dbConnection, $userMapping diff --git a/apps/user_ldap/appinfo/routes.php b/apps/user_ldap/appinfo/routes.php index 45b43c21409..af355173b1b 100644 --- a/apps/user_ldap/appinfo/routes.php +++ b/apps/user_ldap/appinfo/routes.php @@ -21,7 +21,6 @@ * */ -/** @var $this \OCP\Route\IRouter */ $this->create('user_ldap_ajax_clearMappings', 'ajax/clearMappings.php') ->actionInclude('user_ldap/ajax/clearMappings.php'); $this->create('user_ldap_ajax_deleteConfiguration', 'ajax/deleteConfiguration.php') @@ -46,3 +45,13 @@ $application->registerRoutes($this, [ ['name' => 'ConfigAPI#delete', 'url' => '/api/v1/config/{configID}', 'verb' => 'DELETE'], ] ]); + +$application = new OCA\User_LDAP\AppInfo\Application(); +$application->registerRoutes($this, [ + 'routes' => [ + ['name' => 'renewPassword#tryRenewPassword', 'url' => '/renewpassword', 'verb' => 'POST'], + ['name' => 'renewPassword#showRenewPasswordForm', 'url' => '/renewpassword/{user}', 'verb' => 'GET'], + ['name' => 'renewPassword#cancel', 'url' => '/renewpassword/cancel', 'verb' => 'GET'], + ['name' => 'renewPassword#showLoginFormInvalidPassword', 'url' => '/renewpassword/invalidlogin/{user}', 'verb' => 'GET'], + ] +]); |