2012-02-22 21:20:46 +00:00
|
|
|
/**
|
2013-05-01 17:18:31 +00:00
|
|
|
* Copyright (c) 2013, Sam Tuke <samtuke@owncloud.com>, Robin Appelman
|
|
|
|
* <icewind1991@gmail.com>
|
2012-02-22 21:20:46 +00:00
|
|
|
* This file is licensed under the Affero General Public License version 3 or later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2013-03-29 20:11:29 +00:00
|
|
|
// Trigger ajax on recoveryAdmin status change
|
|
|
|
$( 'input:radio[name="adminEnableRecovery"]' ).change(
|
|
|
|
function() {
|
2013-04-10 15:37:03 +00:00
|
|
|
|
2013-05-01 17:18:31 +00:00
|
|
|
var recoveryStatus = $( this ).val();
|
2013-05-04 14:14:38 +00:00
|
|
|
var recoveryPassword = $( '#recoveryPassword' ).val();
|
2013-04-10 15:37:03 +00:00
|
|
|
|
2013-05-04 14:14:38 +00:00
|
|
|
if ( '' == recoveryPassword ) {
|
|
|
|
|
|
|
|
// FIXME: add proper OC notification
|
2013-05-13 15:26:21 +00:00
|
|
|
alert( 'You must set a recovery account password first' );
|
2013-05-04 14:14:38 +00:00
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$.post(
|
|
|
|
OC.filePath( 'files_encryption', 'ajax', 'adminrecovery.php' )
|
|
|
|
, { adminEnableRecovery: recoveryStatus, recoveryPassword: recoveryPassword }
|
|
|
|
, function( data ) {
|
|
|
|
alert( data );
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
2013-03-29 20:11:29 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
2012-02-22 21:20:46 +00:00
|
|
|
function blackListChange(){
|
2013-05-01 17:18:31 +00:00
|
|
|
var blackList=$( '#encryption_blacklist' ).val().join( ',' );
|
|
|
|
OC.AppConfig.setValue( 'files_encryption', 'type_blacklist', blackList );
|
2012-02-22 21:20:46 +00:00
|
|
|
}
|
|
|
|
})
|