You are here

function role_expire_process_default_role_duration_for_user in Role Expire 6

Same name and namespace in other branches
  1. 7 role_expire.module \role_expire_process_default_role_duration_for_user()
1 call to role_expire_process_default_role_duration_for_user()
role_expire_user in ./role_expire.module
Implementation of hook_user().

File

./role_expire.module, line 449
Role Expire module

Code

function role_expire_process_default_role_duration_for_user($role_id, $uid) {

  // Does a default expiry exist?.
  $role_day_period = role_expire_get_default_duration($role_id);
  if ($role_day_period) {
    $user_role_expiry = role_expire_get_user_role_expiry_time($uid, $role_id);

    // If the expiry is empty then we act!.
    if (!$user_role_expiry) {

      // Add the current date to the role day period and save it back to the role_expire row.
      role_expire_write_record($uid, $role_id, mktime(0, 0, 0, date("m"), date("d") + $role_day_period, date("Y")));
    }
  }
}