Listener for the login event.

@param \Illuminate\Auth\Events\Login $event The event that was fired.

@return bool
6987
public function onLogin(Login $event)
    {
        $ip = $this->request->getClientIp();

        $this->updateFields($this->auth, $ip);
    }
67948
public function onSuccessActivate(Event $event)
    {
        /** @var User|bool $user */
        $user = $event->getData('user');
        $this->_getMailer($user)->sendActivationMessage();
    }
958954
public function handle($event)
    {
        $eventName = $this->getEventName($event);

        if ($this->listenerIsRegistered($eventName))
        {
            return call_user_func([$this, 'when'.$eventName], $event);
        }
    }
182658
public function resolve($event)
    {
        if ($event instanceof UserEvent) {
            return $this->getEventDetailsArray($event->getUser()->getUsername());
        }

        return null;
    }
1343445
public function onBeforeSend(Event $event)
    {
        /** @var $request Request */
        $request = $event['request'];

        $id = $this->signatureCredentials->getMacId();
        $ts = $this->timeProvider->getCurrentTime()->getTimestamp();
        $nonce = $this->randomProvider->generateStringForRanges($this->nonceLength, self::$characterRanges);
        $ext = $this->extensionProvider->getExtensionParameters($request, $this->signatureCredentials, $ts, $nonce);
        $ext = http_build_query($ext, null, '&');
        $mac = $this->algorithmManager->generateMac($request, $this->signatureCredentials, $ts, $nonce, $ext);

        $params = array(
            'id' => $id,
            'ts' => $ts,
            'nonce' => $nonce,
            'ext' => $ext,
            'mac' => $mac,
        );

        $list = array();
        foreach ($params as $key => $value) {
            $list[] = $key . '="' . $value . '"';
        }
        $header = 'MAC ' . implode(', ', $list);

        $request->setHeader('Authorization', $header);
    }
1118459
public static function observer(Log_Event $event)
  {
    foreach (self::getWriters() as $writer) {
      /* @var $writer JooS_Log_Interface */
      $writer->write($event->message);
    }
    
    return true;
  }
239683
public function handle(Logout $event)
    {
        if ($event->user) {
            $user = $event->user;
            $ip = $this->request->ip();
            $userAgent = $this->request->userAgent();
            $authenticationLog = $user->authentications()->whereIpAddress($ip)->whereUserAgent($userAgent)->first();

            if (! $authenticationLog) {
                $authenticationLog = new AuthenticationLog([
                    'ip_address' => $ip,
                    'user_agent' => $userAgent,
                ]);
            }

            $authenticationLog->logout_at = Carbon::now();

            $user->authentications()->save($authenticationLog);
        }
    }
718740
public function onInitConfirmation($event)
    {
        $sender = $event->sender;
        /* @var $sender static */
        if (!$sender->confirmationAttribute || empty($sender->confirmationAttribute)) {
            return;
        }
        $sender->confirmation = static::$confirmFalse;
        $sender->confirmCode = '';
    }
379588
private function listenTo($event = null) {
        if ($event === null && $this->getEventInvoker()) {
            $event = $this->getEventInvoker()['id'];
        }
        return !$this->listen || in_array($event, $this->listen);
    }
191293
protected function is_event_ignored(\core\event\base $event) {
        if ((!CLI_SCRIPT or PHPUNIT_TEST) and !$this->logguests) {
            // Always log inside CLI scripts because we do not login there.
            if (!isloggedin() or isguestuser()) {
                return true;
            }
        }
        return false;
    }
972990
public function hasListener($listener, $event = null): bool
    {
        if ($event) {
            if ($event instanceof EventInterface) {
                $event = $event->getName();
            }

            if (isset($this->listeners[$event])) {
                return $this->listeners[$event]->has($listener);
            }
        } else {
            foreach ($this->listeners as $queue) {
                if ($queue->has($listener)) {
                    return true;
                }
            }
        }

        return false;
    }
838529
public function removeListener($listener, $event = null): bool
    {
        if ($event) {
            if ($event instanceof EventInterface) {
                $event = $event->getName();
            }

            // 存在对这个事件的监听队列
            if (isset($this->listeners[$event])) {
                $this->listeners[$event]->remove($listener);
            }
        } else {
            foreach ($this->listeners as $queue) {
                /**  @var $queue ListenerQueue */
                $queue->remove($listener);
            }
        }

        return true;
    }
817563
public function listen($event, $callback)
    {
        if (!isset($this->events[$event])) {
            $this->events[$event] = [];
        }

        $this->events[$event][] = $callback;
        return true;
    }
274190
public function listenersOfEvent(Event $event)
    {
        $event_name = get_class($event);

        return isset($this->listeners[$event_name]) ? $this->listeners[$event_name] : [];
    }
667618
public function trigger($event, $args = array())
	{
		if (!($event instanceof Event))
		{
			if (isset($this->events[$event]))
			{
				$event = $this->events[$event];
			}
			else
			{
				$event = new Event($event);
			}
		}

		// If a listener group was specified
		// lazy load the listeners.
		if ($group = $event->getGroup())
		{
			$this->addListeners($group);
		}

		// Attach any incoming aruments
		foreach ((array) $args as $name => $arg)
		{
			$event->addArgument($name, $arg);
		}

		// Are there any listeners for this event?
		if (isset($this->listeners[$event->getName()]))
		{
			foreach ($this->listeners[$event->getName()] as $listener)
			{
				// Call the event listener
				if ($listener instanceof Closure)
				{
					$response = call_user_func($listener, $event);
				}
				else
				{
					$response = call_user_func(array($listener, $event->getName()), $event);
				}

				// Attach response
				if (!is_null($response))
				{
					$event->addResponse($response);
				}

				// Is propagation stopped?
				if ($event->isStopped())
				{
					break;
				}
			}
		}

		return $event->getResponse();
	}
634033
public function fire($event)
    {
        $this->dispatch("$event.before");
        $this->dispatch($event);
        $this->dispatch("$event.after");

        return $this;
    }
81418
public function canTrigger(Event $event)
    {
        $if = $this->_evaluateCondition('if', $event);
        $unless = $this->_evaluateCondition('unless', $event);

        return $if && !$unless;
    }