mirror of
https://github.com/freescout-helpdesk/freescout.git
synced 2024-11-26 04:12:31 +01:00
36 lines
628 B
PHP
36 lines
628 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Listeners;
|
||
|
|
||
|
use App\User;
|
||
|
use Illuminate\Auth\Events\Login;
|
||
|
|
||
|
class ActivateUser
|
||
|
{
|
||
|
/**
|
||
|
* Create the event listener.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function __construct()
|
||
|
{
|
||
|
//
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Handle the event.
|
||
|
*
|
||
|
* @param Login $event
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function handle(Login $event)
|
||
|
{
|
||
|
if ($event->user->invite_state != User::INVITE_STATE_ACTIVATED) {
|
||
|
$event->user->invite_state = User::INVITE_STATE_ACTIVATED;
|
||
|
$event->user->invite_hash = '';
|
||
|
$event->user->save();
|
||
|
}
|
||
|
}
|
||
|
}
|