2013-11-26 02:49:05 +04:00
|
|
|
<?php
|
|
|
|
/**
|
2015-02-23 13:28:53 +03:00
|
|
|
* @author Arthur Schiwon <blizzz@owncloud.com>
|
|
|
|
* @author Bjoern Schiessle <schiessle@owncloud.com>
|
|
|
|
* @author Joas Schilling <nickvergessen@gmx.de>
|
|
|
|
* @author Lukas Reschke <lukas@owncloud.com>
|
|
|
|
* @author Thomas Müller <thomas.mueller@tmit.eu>
|
|
|
|
*
|
|
|
|
* @copyright Copyright (c) 2015, ownCloud, Inc.
|
|
|
|
* @license AGPL-3.0
|
|
|
|
*
|
|
|
|
* This code is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License, version 3,
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3,
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
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');
|
|
|
|
|
2015-02-13 15:33:20 +03:00
|
|
|
$loginname = isset($_POST['user']) ? (string)$_POST['user'] : '';
|
|
|
|
$password = isset($_POST['password']) ? (string)$_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)));
|