2013-11-26 02:49:05 +04:00
|
|
|
/**
|
|
|
|
* 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(){
|
2013-11-28 00:58:38 +04:00
|
|
|
$('form[name="login"]').on('submit', function() {
|
2013-11-26 02:49:05 +04:00
|
|
|
var user = $('#user').val();
|
|
|
|
var password = $('#password').val();
|
|
|
|
$.ajax({
|
2013-11-26 14:38:49 +04:00
|
|
|
type: 'POST',
|
2013-11-26 02:49:05 +04:00
|
|
|
url: OC.linkTo('files_encryption', 'ajax/getMigrationStatus.php'),
|
|
|
|
dataType: 'json',
|
|
|
|
data: {user: user, password: password},
|
|
|
|
async: false,
|
|
|
|
success: function(response) {
|
2014-02-11 15:44:06 +04:00
|
|
|
if (response.data.migrationStatus === OC.Encryption.MIGRATION_OPEN) {
|
2013-11-26 02:49:05 +04:00
|
|
|
var message = t('files_encryption', 'Initial encryption started... This can take some time. Please wait.');
|
2013-11-28 01:42:03 +04:00
|
|
|
$('#messageText').text(message);
|
2013-11-28 02:07:19 +04:00
|
|
|
$('#message').removeClass('hidden').addClass('update');
|
2014-02-11 15:44:06 +04:00
|
|
|
} else if (response.data.migrationStatus === OC.Encryption.MIGRATION_IN_PROGRESS) {
|
|
|
|
var message = t('files_encryption', 'Initial encryption running... Please try again later.');
|
|
|
|
$('#messageText').text(message);
|
|
|
|
$('#message').removeClass('hidden').addClass('update');
|
2013-11-26 02:49:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|