aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/js/settings-personal.js
diff options
context:
space:
mode:
authorTheSFReader <TheSFReader@gmail.com>2013-01-25 17:15:02 +0100
committerTheSFReader <TheSFReader@gmail.com>2013-01-25 17:15:02 +0100
commit2aead5727ed99c9b9af3a2ba653a27cf794e1278 (patch)
treeec76080267f85324c6cecd34d149bc1537de3eba /apps/files_encryption/js/settings-personal.js
parent9f5847b739c20a0b2de3672459445f08300ef790 (diff)
parent688fe0baa89f0150f3c8123c64d7cff5caa0511b (diff)
downloadnextcloud-server-2aead5727ed99c9b9af3a2ba653a27cf794e1278.tar.gz
nextcloud-server-2aead5727ed99c9b9af3a2ba653a27cf794e1278.zip
Merge remote-tracking branch 'refs/remotes/upstream/master'
Diffstat (limited to 'apps/files_encryption/js/settings-personal.js')
-rw-r--r--apps/files_encryption/js/settings-personal.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js
new file mode 100644
index 00000000000..1a53e99d2b4
--- /dev/null
+++ b/apps/files_encryption/js/settings-personal.js
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2012, 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(){
+ $('input[name=encryption_mode]').change(function(){
+ var prevmode = document.getElementById('prev_encryption_mode').value
+ var client=$('input[value="client"]:checked').val()
+ ,server=$('input[value="server"]:checked').val()
+ ,user=$('input[value="user"]:checked').val()
+ ,none=$('input[value="none"]:checked').val()
+ if (client) {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'client' });
+ if (prevmode == 'server') {
+ OC.dialogs.info(t('encryption', 'Please switch to your ownCloud client and change your encryption password to complete the conversion.'), t('encryption', 'switched to client side encryption'));
+ }
+ } else if (server) {
+ if (prevmode == 'client') {
+ OC.dialogs.form([{text:'Login password', name:'newpasswd', type:'password'},{text:'Encryption password used on the client', name:'oldpasswd', type:'password'}],t('encryption', 'Change encryption password to login password'), function(data) {
+ $.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 your file encryption password to your login password'))
+ } else {
+ console.log("alles super");
+ }
+ }, true);
+ });
+ } else {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'server' });
+ }
+ } else {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'none' });
+ }
+ })
+}) \ No newline at end of file