inizio sistemazione tag mailing list
This commit is contained in:
@@ -53,11 +53,13 @@ class CalendarioConnessione extends Model
|
||||
return $config;
|
||||
}
|
||||
|
||||
public function encryptAndSetConfig(array $config): void
|
||||
public function encryptAndSetConfig(array $config, array $existingConfig = []): void
|
||||
{
|
||||
foreach (['username', 'password', 'client_secret', 'refresh_token', 'api_key'] as $field) {
|
||||
if (isset($config[$field]) && $config[$field] !== '' && !str_starts_with($config[$field], 'eyJpdiI')) {
|
||||
if (!empty($config[$field]) && !str_starts_with($config[$field], 'eyJpdiI')) {
|
||||
$config[$field] = Crypt::encryptString($config[$field]);
|
||||
} elseif (empty($config[$field]) && !empty($existingConfig[$field])) {
|
||||
$config[$field] = $existingConfig[$field];
|
||||
}
|
||||
}
|
||||
$this->config = $config;
|
||||
|
||||
Reference in New Issue
Block a user