diff options
author | Björn Schießle <schiessle@owncloud.com> | 2013-06-03 15:27:31 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2013-06-03 15:27:31 +0200 |
commit | b5820af3cc713bc8c373d28bb6b6ff69a70545b8 (patch) | |
tree | 80ff4134b226b9708195f04a49ad8461929ea22a /apps/files_encryption/js | |
parent | b02f4dc62c797f11818d245015e76b49636afbf0 (diff) | |
download | nextcloud-server-b5820af3cc713bc8c373d28bb6b6ff69a70545b8.tar.gz nextcloud-server-b5820af3cc713bc8c373d28bb6b6ff69a70545b8.zip |
let user update private key password in case it was changed from outside, e.g. external auth back-ends
Diffstat (limited to 'apps/files_encryption/js')
-rw-r--r-- | apps/files_encryption/js/settings-personal.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js index 312b672ad46..46105176c29 100644 --- a/apps/files_encryption/js/settings-personal.js +++ b/apps/files_encryption/js/settings-personal.js @@ -57,4 +57,34 @@ $(document).ready(function(){ } ); + + // update private key password + + $('input:password[name="changePrivateKeyPassword"]').keyup(function(event) { + var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val(); + var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val(); + if (newPrivateKeyPassword != '' && oldPrivateKeyPassword != '' ) { + $('button:button[name="submitChangePrivateKeyPassword"]').removeAttr("disabled"); + } else { + $('button:button[name="submitChangePrivateKeyPassword"]').attr("disabled", "true"); + } + }); + + $('button:button[name="submitChangePrivateKeyPassword"]').click(function() { + var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val(); + var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val(); + OC.msg.startSaving('#encryption .msg'); + $.post( + OC.filePath( 'files_encryption', 'ajax', 'updatePrivateKeyPassword.php' ) + , { oldPassword: oldPrivateKeyPassword, newPassword: newPrivateKeyPassword } + , function( data ) { + if (data.status == "error") { + OC.msg.finishedSaving('#encryption .msg', data); + } else { + OC.msg.finishedSaving('#encryption .msg', data); + } + } + ); + }); + });
\ No newline at end of file |