summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/js/settings-admin.js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/js/settings-admin.js')
-rw-r--r--apps/files_encryption/js/settings-admin.js24
1 files changed, 17 insertions, 7 deletions
diff --git a/apps/files_encryption/js/settings-admin.js b/apps/files_encryption/js/settings-admin.js
index 48b5598d524..8e9c8c22306 100644
--- a/apps/files_encryption/js/settings-admin.js
+++ b/apps/files_encryption/js/settings-admin.js
@@ -19,14 +19,24 @@ $(document).ready(function(){
function() {
var recoveryStatus = $( this ).val();
+ var recoveryPassword = $( '#recoveryPassword' ).val();
- $.post(
- OC.filePath( 'files_encryption', 'ajax', 'adminrecovery.php' )
- , { adminEnableRecovery: recoveryStatus, recoveryPassword: 'password' }
- , function( data ) {
- alert( data );
- }
- );
+ if ( '' == recoveryPassword ) {
+
+ // FIXME: add proper OC notification
+ alert( 'You must set a recovery account password first' );
+
+ } else {
+
+ $.post(
+ OC.filePath( 'files_encryption', 'ajax', 'adminrecovery.php' )
+ , { adminEnableRecovery: recoveryStatus, recoveryPassword: recoveryPassword }
+ , function( data ) {
+ alert( data );
+ }
+ );
+
+ }
}
);