You are here

function role_expire_get_user_role_expiry_time in Role Expire 7

Same name and namespace in other branches
  1. 6 role_expire.module \role_expire_get_user_role_expiry_time()

API function; Get expiration time of a user role.

Parameters

$uid: User ID.

$rid: Role ID.

Return value

Array with the expiration time.

4 calls to role_expire_get_user_role_expiry_time()
role_expire_add_expiration_input in ./role_expire.module
Add form elements to the given form that accept the role expiration times.
role_expire_process_default_role_duration_for_user in ./role_expire.module
Sets the default role duration for the current user/role combination.
role_expire_rules_action_extend_role_expire in ./role_expire.rules.inc
Action: Extend expire time for role. Defaults to the current time.
role_expire_rules_action_set_role_expire_to_longest in ./role_expire.rules.inc
Action: Set expire time for role to longest attached to this user. Defaults to the current time.

File

./role_expire.module, line 24
Role Expire module

Code

function role_expire_get_user_role_expiry_time($uid, $rid) {
  $result = db_query("SELECT expiry_timestamp FROM {role_expire} WHERE uid = :uid AND rid = :rid", array(
    ':uid' => $uid,
    ':rid' => $rid,
  ))
    ->fetchField();
  return !empty($result) ? $result : '';
}