Small addition to the filters section of views_user.inc. May be slow for site with many users, but no more so than author username filter. Patch attached.

CommentFileSizeAuthor
views_user.patch907 bytesngstigator

Comments

Roman S’s picture

Until the patch makes it into Views, this can be accomplished with hook_views_tables_alter(). Something along the lines of this:


function mymodule_views_tables_alter(&$table_data) {
  $table_data['users']['filters']['status'] = array(
    'name' => t('Node: Author is Active'),
    'operator' => 'views_handler_operator_eqneq',
    'list' => array(0 => t('blocked'), 1 => t('active')),
    'help' => t('This allows you to filter by whether or not the node author is active.')
  );
}

Don't forget the clear the cache_views table in order for the new filter to appear in the list.

ngstigator’s picture

thanks for your suggestion, but i did originally implement my code in a custom module, and thought that it would be useful enough to be committed.

sun’s picture

Status: Needs review » Needs work

I believe we do not use the term 'active' in Drupal.

Roman S’s picture

sun - what do you mean? The two statuses available for users are active and blocked (per admin/user/user). The code above is similar to the Active filter created by Usernode.

merlinofchaos’s picture

Status: Needs work » Needs review

Yea, Views 2 uses the same terminology. Patch looks reasonable to me.

esmerel’s picture

Status: Needs review » Closed (won't fix)

At this time, only security fixes will be made to the 5.x version of Views.