diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2012-08-09 14:25:09 +0200 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2012-08-09 14:25:09 +0200 |
commit | a969c23e59e26f2d82a1f8626444a59ae003c30e (patch) | |
tree | fa451b00e444d5b8394148d1ea69055f60b33fd5 /apps/files_encryption/js | |
parent | 800942ece74ac336c4a9213228f14406d7e494f7 (diff) | |
download | nextcloud-server-a969c23e59e26f2d82a1f8626444a59ae003c30e.tar.gz nextcloud-server-a969c23e59e26f2d82a1f8626444a59ae003c30e.zip |
disable admin choice of encryption mode once a decision was taken
Diffstat (limited to 'apps/files_encryption/js')
-rw-r--r-- | apps/files_encryption/js/settings-personal.js | 2 | ||||
-rw-r--r-- | apps/files_encryption/js/settings.js | 19 |
2 files changed, 16 insertions, 5 deletions
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js index f335cf7f880..d70f9318e5d 100644 --- a/apps/files_encryption/js/settings-personal.js +++ b/apps/files_encryption/js/settings-personal.js @@ -22,7 +22,7 @@ $(document).ready(function(){ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'server', newpasswd: data[0].value, oldpasswd: data[1].value }, function(result) { if (result.status != 'success') { document.getElementById(prevmode+'_encryption').checked = true; - OC.dialogs.alert(t('encryption', 'Please check your passwords and try again'), t('encryption', 'Could not change encryption password to login password')) + OC.dialogs.alert(t('encryption', 'Please check your passwords and try again'), t('encryption', 'Could not change your file encryption password to your login password')) } }); }); diff --git a/apps/files_encryption/js/settings.js b/apps/files_encryption/js/settings.js index 19ff27a3b26..60563bde859 100644 --- a/apps/files_encryption/js/settings.js +++ b/apps/files_encryption/js/settings.js @@ -23,13 +23,24 @@ $(document).ready(function(){ ,server=$('input[value="server"]:checked').val() ,user=$('input[value="user"]:checked').val() ,none=$('input[value="none"]:checked').val() - if (client) + ,disable=false + if (client) { OC.AppConfig.setValue('files_encryption','mode','client'); - else if (server) + disable = true; + } else if (server) { OC.AppConfig.setValue('files_encryption','mode','server'); - else if (user) + disable = true; + } else if (user) { OC.AppConfig.setValue('files_encryption','mode','user'); - else + disable = true; + } else { OC.AppConfig.setValue('files_encryption','mode','none'); + } + if (disable) { + document.getElementById('server_encryption').disabled = true; + document.getElementById('client_encryption').disabled = true; + document.getElementById('user_encryption').disabled = true; + document.getElementById('none_encryption').disabled = true; + } }) })
\ No newline at end of file |