diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2013-11-25 23:49:05 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2013-11-25 23:49:05 +0100 |
commit | d6fb2afa8580b7d12b1f0cfc2bb8fb29e01a087f (patch) | |
tree | 7630a7591b2ef45117326eba2d9cb33d39bbaec1 /apps/files_encryption/ajax | |
parent | 5310a5924b18849c85b482819c350d72a6d0c67c (diff) | |
download | nextcloud-server-d6fb2afa8580b7d12b1f0cfc2bb8fb29e01a087f.tar.gz nextcloud-server-d6fb2afa8580b7d12b1f0cfc2bb8fb29e01a087f.zip |
show a message at the log-in screen if inital encryption take place
Diffstat (limited to 'apps/files_encryption/ajax')
-rw-r--r-- | apps/files_encryption/ajax/getMigrationStatus.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/apps/files_encryption/ajax/getMigrationStatus.php b/apps/files_encryption/ajax/getMigrationStatus.php new file mode 100644 index 00000000000..e6d2f3dea6c --- /dev/null +++ b/apps/files_encryption/ajax/getMigrationStatus.php @@ -0,0 +1,28 @@ +<?php +/** + * Copyright (c) 2013, Bjoern Schiessle <schiessle@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + * + * @brief check migration status + */ +use OCA\Encryption\Util; + +\OCP\JSON::checkAppEnabled('files_encryption'); + +$user = isset($_GET['user']) ? $_GET['user'] : ''; +$password = isset($_GET['password']) ? $_GET['password'] : ''; + +$migrationCompleted = true; + +if ($user !== '' && $password !== '') { + if (\OCP\User::checkPassword($user, $password)) { + error_log("password ok"); + $util = new Util(new \OC_FilesystemView('/'), $user); + if ($util->getMigrationStatus($user) !== Util::MIGRATION_COMPLETED) { + $migrationCompleted = false; + } + } +} + +\OCP\JSON::success(array('data' => array('migrationCompleted' => $migrationCompleted))); |