From fdb2b748c0f49aa586ac6ee1fc963f39ec7ec0ca Mon Sep 17 00:00:00 2001 From: Eric Rasmussen <ericrasmussen1@gmail.com> Date: Thu, 23 Aug 2012 16:58:00 -0500 Subject: [PATCH] [gh-447] Don't show global administrators on admin/people --- sites/all/modules/unl/unl.module | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sites/all/modules/unl/unl.module b/sites/all/modules/unl/unl.module index 869d2d42e..514ebfc16 100644 --- a/sites/all/modules/unl/unl.module +++ b/sites/all/modules/unl/unl.module @@ -1508,8 +1508,10 @@ function unl_query_alter(QueryAlterableInterface $query) { } // If we actually find a users table if ($usersTableAlias) { - // Join it with the users_roles tables so that only users with roles are seleceted. - $query->join('users_roles', 'unl_distinct_prefix_r', $usersTableAlias . '.uid = unl_distinct_prefix_r.uid'); + // Join it with the users_roles tables so that only users with roles are seleceted AND role is not admin. + $query->join('users_roles', 'unl_distinct_prefix_r', + $usersTableAlias.'.uid = unl_distinct_prefix_r.uid' + .' AND unl_distinct_prefix_r.rid != '.unl_shared_variable_get('user_admin_role', 0)); } } } @@ -1517,8 +1519,7 @@ function unl_query_alter(QueryAlterableInterface $query) { /** * Implementation of hook_filter_info() */ -function unl_filter_info() -{ +function unl_filter_info() { return array( 'unl_embed' => array( 'title' => 'UNL Node Embed', @@ -1540,8 +1541,7 @@ function unl_filter_info() * * Replace any instances of [[node:X]] in the $text with the content of node X's body. */ -function unl_filter_embed_process($text, $filter, $format, $langcode, $cache, $cache_id) -{ +function unl_filter_embed_process($text, $filter, $format, $langcode, $cache, $cache_id) { static $processed_hashes = array(); $text_hash = hash('sha256', $text); -- GitLab