You are here

function _advuser_get_roles_query_fragment in Advanced User 5

Construct a db query 'where' clause fragment so we can get a list of users to notify TODO: this needs cleanup. There should be a way to gather a list of users who are in roles.

1 call to _advuser_get_roles_query_fragment()
_advuser_dbquery_users_to_notify in ./advuser.module

File

./advuser.module, line 803

Code

function _advuser_get_roles_query_fragment($roles) {

  // TODO: this needs to be cleaned up.
  if (is_array($roles)) {
    foreach ((array) $roles as $role_k => $role_v) {
      if ($role_v > 0) {
        if ($role_v == DRUPAL_AUTHENTICATED_RID) {
          $role_where = ' OR 1';
        }
        else {
          $role_where = ' OR ur.rid = ' . $role_v;
        }
      }
    }
  }
  return $role_where;
}