2013-11-26 02:49:05 +04:00
|
|
|
<?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');
|
|
|
|
|
2013-11-28 16:26:31 +04:00
|
|
|
$loginname = isset($_POST['user']) ? $_POST['user'] : '';
|
2013-11-26 14:38:49 +04:00
|
|
|
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
2013-11-26 02:49:05 +04:00
|
|
|
|
|
|
|
$migrationCompleted = true;
|
|
|
|
|
2013-11-28 16:26:31 +04:00
|
|
|
if ($loginname !== '' && $password !== '') {
|
|
|
|
$username = \OCP\User::checkPassword($loginname, $password);
|
|
|
|
if ($username) {
|
|
|
|
$util = new Util(new \OC_FilesystemView('/'), $username);
|
2013-11-27 18:35:32 +04:00
|
|
|
if ($util->getMigrationStatus() !== Util::MIGRATION_COMPLETED) {
|
2013-11-26 02:49:05 +04:00
|
|
|
$migrationCompleted = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
\OCP\JSON::success(array('data' => array('migrationCompleted' => $migrationCompleted)));
|