mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Removed deprecated event and handlers. (blocked user login)
This commit is contained in:
@@ -17,7 +17,6 @@ use Exception;
|
||||
use FireflyConfig;
|
||||
use FireflyIII\Events\BlockedUseOfDomain;
|
||||
use FireflyIII\Events\BlockedUseOfEmail;
|
||||
use FireflyIII\Events\BlockedUserLogin;
|
||||
use FireflyIII\Events\ConfirmedUser;
|
||||
use FireflyIII\Events\DeletedUser;
|
||||
use FireflyIII\Events\LockedOutUser;
|
||||
@@ -82,46 +81,6 @@ class UserEventHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param BlockedUserLogin $event
|
||||
*
|
||||
* @deprecated
|
||||
* @return bool
|
||||
*/
|
||||
public function reportBlockedUser(BlockedUserLogin $event): bool
|
||||
{
|
||||
$user = $event->user;
|
||||
$owner = env('SITE_OWNER');
|
||||
$email = $user->email;
|
||||
$ipAddress = $event->ipAddress;
|
||||
/** @var Configuration $sendmail */
|
||||
$sendmail = FireflyConfig::get('mail_for_blocked_login', config('firefly.configuration.mail_for_blocked_login'));
|
||||
Log::debug(sprintf('Now in reportBlockedUser for email address %s', $email));
|
||||
Log::error(sprintf('User #%d (%s) has their accout blocked (blocked_code is "%s") but tried to login.', $user->id, $email, $user->blocked_code));
|
||||
if (is_null($sendmail) || (!is_null($sendmail) && $sendmail->data === false)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// send email message:
|
||||
try {
|
||||
Mail::send(
|
||||
['emails.blocked-login-html', 'emails.blocked-login-text'],
|
||||
[
|
||||
'user_id' => $user->id,
|
||||
'user_address' => $email,
|
||||
'ip' => $ipAddress,
|
||||
'code' => $user->blocked_code,
|
||||
], function (Message $message) use ($owner, $user) {
|
||||
$message->to($owner, $owner)->subject('Blocked login attempt of blocked user');
|
||||
}
|
||||
);
|
||||
} catch (Swift_TransportException $e) {
|
||||
Log::error($e->getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LockedOutUser $event
|
||||
*
|
||||
|
Reference in New Issue
Block a user