Remove Firefly III's ability to encrypt data in the database.

This commit is contained in:
James Cole
2019-01-31 19:56:09 +01:00
parent d56bd85328
commit 4307bf3b83
26 changed files with 166 additions and 742 deletions

View File

@@ -23,7 +23,6 @@ declare(strict_types=1);
namespace FireflyIII\Models;
use Carbon\Carbon;
use Crypt;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@@ -101,37 +100,6 @@ class Budget extends Model
return $this->hasMany(BudgetLimit::class);
}
/**
* @codeCoverageIgnore
*
* @param $value
*
* @return string|null
* @throws \Illuminate\Contracts\Encryption\DecryptException
*/
public function getNameAttribute($value): ?string
{
if ($this->encrypted) {
return Crypt::decrypt($value);
}
return $value;
}
/**
* @codeCoverageIgnore
*
* @param $value
*
* @throws \Illuminate\Contracts\Encryption\EncryptException
*/
public function setNameAttribute($value): void
{
$encrypt = config('firefly.encryption');
$this->attributes['name'] = $encrypt ? Crypt::encrypt($value) : $value;
$this->attributes['encrypted'] = $encrypt;
}
/**
* @codeCoverageIgnore
* @return BelongsToMany