Created
June 28, 2013 05:11
-
-
Save umidjons/5882601 to your computer and use it in GitHub Desktop.
BX: Retrieves active users list in specified groups.
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
<? | |
/** | |
* Callback to use in array_filter function, which filters only active users. | |
* @param $userID int id of the user | |
* @return bool true if user is active, otherwise false | |
*/ | |
function IsActive( $userID ) | |
{ | |
$rsUser = CUser::GetByID( $userID ); | |
$user = $rsUser->Fetch(); | |
return ( $user[ 'ACTIVE' ] == "Y" ); | |
} | |
/* Gets users in groups 1 and 36, merges them. */ | |
$list = array_merge( CGroup::GetGroupUser( 1 ), CGroup::GetGroupUser( 36 ) ); | |
$list = array_filter( $list, 'IsActive' ); // list of active users | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment