You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

getMigrationStatus.php 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * @author Arthur Schiwon <blizzz@owncloud.com>
  4. * @author Björn Schießle <schiessle@owncloud.com>
  5. * @author Joas Schilling <nickvergessen@owncloud.com>
  6. * @author Lukas Reschke <lukas@owncloud.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Thomas Müller <thomas.mueller@tmit.eu>
  9. *
  10. * @copyright Copyright (c) 2015, ownCloud, Inc.
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. use OCA\Files_Encryption\Util;
  27. \OCP\JSON::checkAppEnabled('files_encryption');
  28. $loginname = isset($_POST['user']) ? (string)$_POST['user'] : '';
  29. $password = isset($_POST['password']) ? (string)$_POST['password'] : '';
  30. $migrationStatus = Util::MIGRATION_COMPLETED;
  31. if ($loginname !== '' && $password !== '') {
  32. $username = \OCP\User::checkPassword($loginname, $password);
  33. if ($username) {
  34. $util = new Util(new \OC\Files\View('/'), $username);
  35. $migrationStatus = $util->getMigrationStatus();
  36. }
  37. }
  38. \OCP\JSON::success(array('data' => array('migrationStatus' => $migrationStatus)));