1
0

personal.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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();