You are here

function rules_user_login in Rules 8.3

Same name and namespace in other branches
  1. 7.2 modules/events.inc \rules_user_login()

Implements hook_user_login().

2 calls to rules_user_login()
EventIntegrationTest::testMultipleEvents in tests/src/Kernel/EventIntegrationTest.php
Test that rules config supports multiple events.
EventIntegrationTest::testUserLoginEvent in tests/src/Kernel/EventIntegrationTest.php
Test that the user login hook triggers the Rules event listener.
3 string references to 'rules_user_login'
EventIntegrationTest::testMultipleEvents in tests/src/Kernel/EventIntegrationTest.php
Test that rules config supports multiple events.
EventIntegrationTest::testUserLoginEvent in tests/src/Kernel/EventIntegrationTest.php
Test that the user login hook triggers the Rules event listener.
UserLoginTest::testUserLoginEvent in tests/src/Unit/Integration/Event/UserLoginTest.php
Tests the event metadata.

File

./rules.module, line 97
Hook implementations for the Rules module.

Code

function rules_user_login($account) {

  // Set the account twice on the event: as the main subject but also in the
  // list of arguments.
  $event = new UserLoginEvent($account);
  $event_dispatcher = \Drupal::service('event_dispatcher');
  $event_dispatcher
    ->dispatch(UserLoginEvent::EVENT_NAME, $event);
}