Commit b6de30a9 authored by chirag shah's avatar chirag shah Committed by Rakesh James
Browse files

Issue #2855245 by chishah92, rakesh.gectcr: Hooks provided by login frequency

parent e5701799
Loading
Loading
Loading
Loading
+36
Changes for login_frequency.api.php: 36 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

/**
 * @file
 * Hooks provided by the Login frequency module.
 */

/**
 * Override whether a login request should be tracked or not.
 *
 * @param bool $track
 *   Boolean indicating whether to track.
 * @param object $account
 *   The user object on which the operation is being performed.
 *
 * @see login_frequency_user_login()
 * @return bool $track
 */
function hook_login_frequency_track_login_alter(&$track, $account) {
  return FALSE;
}

/**
 * Modify custom data stored with the tracked login frequency.
 *
 * @param array $login_data
 *   Associative array of custom data that will be stored with the login.
 * @param object $account
 *   The user object on which the operation is about to be recorded.
 *
 * @see login_frequency_login_data()
 */
function hook_login_frequency_login_data_alter(array &$login_data, $account) {
  // Store a random number between 1 and 10 with the tracked login.
  $data['ip-address'] = '127.0.0.1';
}