encryption converted to module

This commit is contained in:
azivner
2017-11-04 18:18:55 -04:00
parent b44c685f23
commit e7f0187b29
9 changed files with 428 additions and 396 deletions

View File

@@ -86,19 +86,17 @@ settings.addModule((function() {
success: result => {
if (result.success) {
// encryption password changed so current encryption session is invalid and needs to be cleared
resetEncryptionSession();
encryption.resetEncryptionSession();
glob.encryptedDataKey = result.new_encrypted_data_key;
encryption.setEncryptedDataKey(result.new_encrypted_data_key);
alert("Password has been changed.");
$("#settings-dialog").dialog('close');
message("Password has been changed.");
}
else {
alert(result.message);
message(result.message);
}
},
error: () => alert("Error occurred during changing password.")
error: () => error("Error occurred during changing password.")
});
return false;
@@ -122,7 +120,7 @@ settings.addModule((function() {
const encryptionTimeout = encryptionTimeoutEl.val();
settings.saveSettings(settingName, encryptionTimeout).then(() => {
glob.encryptionSessionTimeout = encryptionTimeout;
encryption.setEncryptionSessionTimeout(encryptionTimeout);
});
return false;