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.
|
|
|
|
*
|
2014-05-19 19:50:53 +04:00
|
|
|
* check migration status
|
2013-11-26 02:49:05 +04:00
|
|
|
*/
|
2014-12-03 18:52:44 +03:00
|
|
|
|
|
|
|
use OCA\Files_Encryption\Util;
|
2013-11-26 02:49:05 +04:00
|
|
|
|
|
|
|
\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
|
|
|
|
2014-02-11 15:44:06 +04:00
|
|
|
$migrationStatus = Util::MIGRATION_COMPLETED;
|
2013-11-26 02:49:05 +04:00
|
|
|
|
2013-11-28 16:26:31 +04:00
|
|
|
if ($loginname !== '' && $password !== '') {
|
|
|
|
$username = \OCP\User::checkPassword($loginname, $password);
|
|
|
|
if ($username) {
|
2014-05-12 18:30:39 +04:00
|
|
|
$util = new Util(new \OC\Files\View('/'), $username);
|
2014-02-11 15:44:06 +04:00
|
|
|
$migrationStatus = $util->getMigrationStatus();
|
2013-11-26 02:49:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-11 15:44:06 +04:00
|
|
|
\OCP\JSON::success(array('data' => array('migrationStatus' => $migrationStatus)));
|