You are here

function smart_ip_set_user_data in Smart IP 7

Same name and namespace in other branches
  1. 6.2 smart_ip.module \smart_ip_set_user_data()
  2. 6 smart_ip.module \smart_ip_set_user_data()
  3. 7.2 smart_ip.module \smart_ip_set_user_data()

Set the $user data

2 calls to smart_ip_set_user_data()
smart_ip_admin_settings_submit in includes/smart_ip.admin.inc
Process Forms submitted by IP to Country administration page
smart_ip_set_location_data in ./smart_ip.module
Set the user's location information

File

./smart_ip.module, line 625
Determines country, geo location (longitude/latitude), region, city and postal code of the user, based on IP address

Code

function smart_ip_set_user_data($account, $location) {
  if ($account->uid != 0) {
    $user_obj = user_load($account->uid);
    user_save($user_obj, array(
      'data' => array(
        'geoip_location' => $location,
      ),
    ));
  }
}