Merge pull request #6048 from owncloud/encryption_initial_enc_indicator
show a message at the log-in screen if inital encryption take placeremotes/origin/stable6
commit
54b24ca88d
@ -0,0 +1,27 @@
|
||||
<?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($_POST['user']) ? $_POST['user'] : '';
|
||||
$password = isset($_POST['password']) ? $_POST['password'] : '';
|
||||
|
||||
$migrationCompleted = true;
|
||||
|
||||
if ($user !== '' && $password !== '') {
|
||||
if (\OCP\User::checkPassword($user, $password)) {
|
||||
$util = new Util(new \OC_FilesystemView('/'), $user);
|
||||
if ($util->getMigrationStatus() !== Util::MIGRATION_COMPLETED) {
|
||||
$migrationCompleted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\OCP\JSON::success(array('data' => array('migrationCompleted' => $migrationCompleted)));
|
||||
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$('form[name="login"]').on('submit', function() {
|
||||
var user = $('#user').val();
|
||||
var password = $('#password').val();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: OC.linkTo('files_encryption', 'ajax/getMigrationStatus.php'),
|
||||
dataType: 'json',
|
||||
data: {user: user, password: password},
|
||||
async: false,
|
||||
success: function(response) {
|
||||
if (response.data.migrationCompleted === false) {
|
||||
var message = t('files_encryption', 'Initial encryption started... This can take some time. Please wait.');
|
||||
$('#messageText').text(message);
|
||||
$('#message').removeClass('hidden').addClass('update');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Reference in New Issue