parent
3bc5c1c3cf
commit
55962c5f5a
2 changed files with 17 additions and 14 deletions
|
@ -12,17 +12,20 @@ $(document).ready(function(){
|
||||||
$( 'input:radio[name="adminEnableRecovery"]' ).change(
|
$( 'input:radio[name="adminEnableRecovery"]' ).change(
|
||||||
function() {
|
function() {
|
||||||
var recoveryStatus = $( this ).val();
|
var recoveryStatus = $( this ).val();
|
||||||
var oldStatus = (1+parseInt(recoveryStatus)) % 2;
|
var oldStatus = (1+parseInt(recoveryStatus, 10)) % 2;
|
||||||
var recoveryPassword = $( '#encryptionRecoveryPassword' ).val();
|
var recoveryPassword = $( '#encryptionRecoveryPassword' ).val();
|
||||||
var confirmPassword = $( '#repeatEncryptionRecoveryPassword' ).val();
|
var confirmPassword = $( '#repeatEncryptionRecoveryPassword' ).val();
|
||||||
OC.msg.startSaving('#encryptionSetRecoveryKey .msg');
|
OC.msg.startSaving('#encryptionSetRecoveryKey .msg');
|
||||||
$.post(
|
$.post(
|
||||||
OC.generateUrl('/apps/encryption/ajax/adminRecovery')
|
OC.generateUrl('/apps/encryption/ajax/adminRecovery'),
|
||||||
, { adminEnableRecovery: recoveryStatus, recoveryPassword: recoveryPassword, confirmPassword: confirmPassword }
|
{ adminEnableRecovery: recoveryStatus,
|
||||||
, function( result ) {
|
recoveryPassword: recoveryPassword,
|
||||||
|
confirmPassword: confirmPassword },
|
||||||
|
function( result ) {
|
||||||
OC.msg.finishedSaving('#encryptionSetRecoveryKey .msg', result);
|
OC.msg.finishedSaving('#encryptionSetRecoveryKey .msg', result);
|
||||||
if (result.status === "error") {
|
if (result.status === "error") {
|
||||||
$('input:radio[name="adminEnableRecovery"][value="'+oldStatus.toString()+'"]').attr("checked", "true");
|
$('input:radio[name="adminEnableRecovery"][value="'+oldStatus.toString()+'"]')
|
||||||
|
.attr("checked", "true");
|
||||||
} else {
|
} else {
|
||||||
if (recoveryStatus === "0") {
|
if (recoveryStatus === "0") {
|
||||||
$('p[name="changeRecoveryPasswordBlock"]').addClass("hidden");
|
$('p[name="changeRecoveryPasswordBlock"]').addClass("hidden");
|
||||||
|
@ -44,9 +47,9 @@ $(document).ready(function(){
|
||||||
var confirmNewPassword = $('#repeatedNewEncryptionRecoveryPassword').val();
|
var confirmNewPassword = $('#repeatedNewEncryptionRecoveryPassword').val();
|
||||||
OC.msg.startSaving('#encryptionChangeRecoveryKey .msg');
|
OC.msg.startSaving('#encryptionChangeRecoveryKey .msg');
|
||||||
$.post(
|
$.post(
|
||||||
OC.generateUrl('/apps/encryption/ajax/changeRecoveryPassword')
|
OC.generateUrl('/apps/encryption/ajax/changeRecoveryPassword'),
|
||||||
, { oldPassword: oldRecoveryPassword, newPassword: newRecoveryPassword, confirmPassword: confirmNewPassword }
|
{ oldPassword: oldRecoveryPassword, newPassword: newRecoveryPassword, confirmPassword: confirmNewPassword },
|
||||||
, function( data ) {
|
function( data ) {
|
||||||
OC.msg.finishedSaving('#encryptionChangeRecoveryKey .msg', data);
|
OC.msg.finishedSaving('#encryptionChangeRecoveryKey .msg', data);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* See the COPYING-README file.
|
* See the COPYING-README file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function updatePrivateKeyPasswd() {
|
function updatePrivateKeyPassword() {
|
||||||
var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
|
var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
|
||||||
var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
|
var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
|
||||||
OC.msg.startSaving('#encryption .msg');
|
OC.msg.startSaving('#encryption .msg');
|
||||||
|
@ -26,9 +26,9 @@ $(document).ready(function(){
|
||||||
var recoveryStatus = $( this ).val();
|
var recoveryStatus = $( this ).val();
|
||||||
OC.msg.startAction('#userEnableRecovery .msg', 'Updating recovery keys. This can take some time...');
|
OC.msg.startAction('#userEnableRecovery .msg', 'Updating recovery keys. This can take some time...');
|
||||||
$.post(
|
$.post(
|
||||||
OC.generateUrl('/apps/encryption/ajax/userSetRecovery')
|
OC.generateUrl('/apps/encryption/ajax/userSetRecovery'),
|
||||||
, { userEnableRecovery: recoveryStatus }
|
{ userEnableRecovery: recoveryStatus },
|
||||||
, function( data ) {
|
function( data ) {
|
||||||
OC.msg.finishedAction('#userEnableRecovery .msg', data);
|
OC.msg.finishedAction('#userEnableRecovery .msg', data);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -45,7 +45,7 @@ $(document).ready(function(){
|
||||||
if (newPrivateKeyPassword !== '' && oldPrivateKeyPassword !== '' ) {
|
if (newPrivateKeyPassword !== '' && oldPrivateKeyPassword !== '' ) {
|
||||||
$('button:button[name="submitChangePrivateKeyPassword"]').removeAttr("disabled");
|
$('button:button[name="submitChangePrivateKeyPassword"]').removeAttr("disabled");
|
||||||
if(event.which === 13) {
|
if(event.which === 13) {
|
||||||
updatePrivateKeyPasswd();
|
updatePrivateKeyPassword();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$('button:button[name="submitChangePrivateKeyPassword"]').attr("disabled", "true");
|
$('button:button[name="submitChangePrivateKeyPassword"]').attr("disabled", "true");
|
||||||
|
@ -53,7 +53,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
$('button:button[name="submitChangePrivateKeyPassword"]').click(function() {
|
$('button:button[name="submitChangePrivateKeyPassword"]').click(function() {
|
||||||
updatePrivateKeyPasswd();
|
updatePrivateKeyPassword();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue