register_command.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. * @author Roger Szabo <roger.szabo@web.de>
  10. * @author Vinicius Cubas Brand <vinicius@eita.org.br>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. use OCA\User_LDAP\Helper;
  28. use OCA\User_LDAP\LDAP;
  29. use OCA\User_LDAP\User_Proxy;
  30. use OCA\User_LDAP\Mapping\UserMapping;
  31. use OCA\User_LDAP\User\DeletedUsersIndex;
  32. $dbConnection = \OC::$server->getDatabaseConnection();
  33. $userMapping = new UserMapping($dbConnection);
  34. $helper = new Helper(\OC::$server->getConfig());
  35. $ocConfig = \OC::$server->getConfig();
  36. $uBackend = new User_Proxy(
  37. $helper->getServerConfigurationPrefixes(true),
  38. new LDAP(),
  39. $ocConfig,
  40. \OC::$server->getNotificationManager(),
  41. \OC::$server->getUserSession(),
  42. \OC::$server->query('LDAPUserPluginManager')
  43. );
  44. $deletedUsersIndex = new DeletedUsersIndex(
  45. $ocConfig, $dbConnection, $userMapping
  46. );
  47. $application->add(new OCA\User_LDAP\Command\ShowConfig($helper));
  48. $application->add(new OCA\User_LDAP\Command\SetConfig());
  49. $application->add(new OCA\User_LDAP\Command\TestConfig());
  50. $application->add(new OCA\User_LDAP\Command\CreateEmptyConfig($helper));
  51. $application->add(new OCA\User_LDAP\Command\DeleteConfig($helper));
  52. $application->add(new OCA\User_LDAP\Command\Search($ocConfig));
  53. $application->add(new OCA\User_LDAP\Command\ShowRemnants(
  54. $deletedUsersIndex, \OC::$server->getDateTimeFormatter())
  55. );
  56. $application->add(new OCA\User_LDAP\Command\CheckUser(
  57. $uBackend, $helper, $deletedUsersIndex, $userMapping)
  58. );