personal.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Michael Gapczynski <GapczynskiM@gmail.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Robin McCorkell <robin@mccorkell.me.uk>
  10. * @author Vincent Petry <pvince81@owncloud.com>
  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\Files_External\Service\BackendService;
  28. // we must use the same container
  29. $appContainer = \OC_Mount_Config::$app->getContainer();
  30. $backendService = $appContainer->query('OCA\Files_External\Service\BackendService');
  31. $userStoragesService = $appContainer->query('OCA\Files_External\Service\UserStoragesService');
  32. $globalAuth = $appContainer->query('OCA\Files_External\Lib\Auth\Password\GlobalAuth');
  33. $tmpl = new OCP\Template('files_external', 'settings');
  34. $tmpl->assign('encryptionEnabled', \OC::$server->getEncryptionManager()->isEnabled());
  35. $tmpl->assign('visibilityType', BackendService::VISIBILITY_PERSONAL);
  36. $tmpl->assign('storages', $userStoragesService->getStorages());
  37. $tmpl->assign('dependencies', OC_Mount_Config::dependencyMessage($backendService->getBackends()));
  38. $tmpl->assign('backends', $backendService->getAvailableBackends());
  39. $tmpl->assign('authMechanisms', $backendService->getAuthMechanisms());
  40. $uid = \OC::$server->getUserSession()->getUser()->getUID();
  41. $tmpl->assign('globalCredentials', $globalAuth->getAuth($uid));
  42. $tmpl->assign('globalCredentialsUid', $uid);
  43. $tmpl->assign('allowUserMounting', $backendService->isUserMountingAllowed());
  44. return $tmpl->fetchPage();