Encryption is optional (but on by default) and a command to switch from one to the other

This commit is contained in:
James Cole
2017-01-14 17:13:57 +01:00
parent 30bc4ccfa7
commit 5bbaaece38
10 changed files with 94 additions and 19 deletions

View File

@@ -371,8 +371,9 @@ class TransactionJournal extends TransactionJournalSupport
*/
public function setDescriptionAttribute($value)
{
$this->attributes['description'] = $value;
$this->attributes['encrypted'] = false;
$encrypt = config('firefly.encryption');
$this->attributes['description'] = $encrypt ? Crypt::encrypt($value) : $value;
$this->attributes['encrypted'] = $encrypt;
}
/**