function cas_drush_user_get_users_from_arguments in CAS 6.3
Same name and namespace in other branches
- 7 cas.drush.inc \cas_drush_user_get_users_from_arguments()
Look up user ids from a comma-separated list of CAS usernames.
Parameters
$users string: Comma separated list of CAS usernames.
Return value
array An array of user ids corresponding to the given CAS usernames. Unknown CAS usernames are ignored.
1 call to cas_drush_user_get_users_from_arguments()
- cas_drush_user_add_role in ./
cas.drush.inc - Add a role to the specified CAS user accounts.
File
- ./
cas.drush.inc, line 113 - Drush commands for CAS.
Code
function cas_drush_user_get_users_from_arguments($users) {
$uids = array();
if ($users !== '') {
$users = explode(',', $users);
foreach ($users as $user) {
$account = cas_user_load_by_name($user);
if ($account) {
$uids[] = $account->uid;
}
}
}
return $uids;
}