mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 12:24:50 +00:00
3.2.5 will once again be capable of encrypting journal descriptions (and more, in the future).
This commit is contained in:
@@ -49,6 +49,15 @@ class ChangesFor325 extends Migration
|
||||
// don't care either.
|
||||
}
|
||||
|
||||
// allow journal descriptions to be encrypted.
|
||||
Schema::table(
|
||||
'transaction_journals', function (Blueprint $table) {
|
||||
$table->boolean('encrypted');
|
||||
|
||||
}
|
||||
);
|
||||
DB::update('ALTER TABLE `transaction_journals` MODIFY `description` VARCHAR(1024)');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,6 +82,15 @@ class TransactionJournal extends Eloquent
|
||||
return ['created_at', 'updated_at', 'date'];
|
||||
}
|
||||
|
||||
public function getDescriptionAttribute($value)
|
||||
{
|
||||
if ($this->encrypted) {
|
||||
return Crypt::decrypt($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
@@ -198,6 +207,12 @@ class TransactionJournal extends Eloquent
|
||||
);
|
||||
}
|
||||
|
||||
public function setDescriptionAttribute($value)
|
||||
{
|
||||
$this->attributes['description'] = Crypt::encrypt($value);
|
||||
$this->attributes['encrypted'] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user