mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Code for #456
This commit is contained in:
@@ -16,9 +16,11 @@ namespace FireflyIII\Handlers\Events;
|
||||
use Exception;
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Events\ConfirmedUser;
|
||||
use FireflyIII\Events\DeletedUser;
|
||||
use FireflyIII\Events\RegisteredUser;
|
||||
use FireflyIII\Events\RequestedNewPassword;
|
||||
use FireflyIII\Events\ResentConfirmation;
|
||||
use FireflyIII\Models\Configuration;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Mail\Message;
|
||||
@@ -75,6 +77,28 @@ class UserEventHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param DeletedUser $event
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function saveEmailAddress(DeletedUser $event): bool
|
||||
{
|
||||
$email = hash('sha256', $event->email);
|
||||
Log::debug(sprintf('Hash of email is %s', $email));
|
||||
/** @var Configuration $configuration */
|
||||
$configuration = FireflyConfig::get('deleted_users', []);
|
||||
$content = $configuration->data;
|
||||
if (!is_array($content)) {
|
||||
$content = [];
|
||||
}
|
||||
$content[] = $email;
|
||||
$configuration->data = $content;
|
||||
$configuration->save();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will send a newly registered user a confirmation message, urging him or her to activate their account.
|
||||
*
|
||||
@@ -194,7 +218,6 @@ class UserEventHandler
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param string $ipAddress
|
||||
|
Reference in New Issue
Block a user