Created
January 15, 2014 18:34
-
-
Save shadcn/8441724 to your computer and use it in GitHub Desktop.
Drupal: function to find users with only authenticated role.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Helper function to find users with authenticated role only. | |
*/ | |
function _users_with_authenticated_role_only() { | |
return db_query('SELECT uid, name, mail FROM users u WHERE uid > 0 AND NOT EXISTS (SELECT 1 from users_roles ur WHERE u.uid = ur.uid)')->fetchAll(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment