Index: invite.module =================================================================== --- invite.module +++ invite.module @@ -721,9 +721,8 @@ } $role_limit = 0; - foreach (user_roles(0, 'send invitations') as $role) { - $role_no_space = str_replace(' ', '_', $role); - if (in_array($role, $account->roles)) { + foreach (array_keys(user_roles(0, 'send invitations')) as $role_id) { + if (isset($account->roles[$role_id])) { $role_max = variable_get('invite_maxnum_'. $role_no_space, INVITE_UNLIMITED); if ($role_max == INVITE_UNLIMITED) { return INVITE_UNLIMITED;