register_command.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @author Arthur Schiwon <blizzz@owncloud.com>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. * @author Thomas Müller <thomas.mueller@tmit.eu>
  6. *
  7. * @copyright Copyright (c) 2015, ownCloud, Inc.
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. use OCA\user_ldap\lib\Helper;
  24. use OCA\user_ldap\lib\LDAP;
  25. use OCA\user_ldap\User_Proxy;
  26. use OCA\User_LDAP\Mapping\UserMapping;
  27. use OCA\User_LDAP\lib\User\DeletedUsersIndex;
  28. $dbConnection = \OC::$server->getDatabaseConnection();
  29. $userMapping = new UserMapping($dbConnection);
  30. $helper = new Helper();
  31. $ocConfig = \OC::$server->getConfig();
  32. $uBackend = new User_Proxy(
  33. $helper->getServerConfigurationPrefixes(true),
  34. new LDAP(),
  35. $ocConfig
  36. );
  37. $deletedUsersIndex = new DeletedUsersIndex(
  38. $ocConfig, $dbConnection, $userMapping
  39. );
  40. $application->add(new OCA\user_ldap\Command\ShowConfig($helper));
  41. $application->add(new OCA\user_ldap\Command\SetConfig());
  42. $application->add(new OCA\user_ldap\Command\TestConfig());
  43. $application->add(new OCA\user_ldap\Command\CreateEmptyConfig($helper));
  44. $application->add(new OCA\user_ldap\Command\DeleteConfig($helper));
  45. $application->add(new OCA\user_ldap\Command\Search($ocConfig));
  46. $application->add(new OCA\user_ldap\Command\ShowRemnants(
  47. $deletedUsersIndex, \OC::$server->getDateTimeFormatter())
  48. );
  49. $application->add(new OCA\user_ldap\Command\CheckUser(
  50. $uBackend, $helper, $deletedUsersIndex, $userMapping)
  51. );