\cge_userops

Utility methods to deal with admin users.

Summary

Methods
Properties
Constants
expand_userlist()
get_grouplist()
get_groupid()
get_group_members()
expand_group_emails()
get_uid_emails()
get_uid_email()
get_admin_membergroups()
get_userlist()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

expand_userlist()

expand_userlist(mixed  $useridlist) : array

A function to return an expanded list of user id's given an input list if one of the id's specified is negative, it is assumed to be a group id and is expanded to its members.

Parameters

mixed $useridlist

A comma separated string, or an array of userid's or negative group id's.

Returns

array

get_grouplist()

get_grouplist(boolean  $inclnone = TRUE) : array

Retrieve an associative array containing a list of CMSMS admin groups that is suitable for formatting in a dropdown.

Parameters

boolean $inclnone

Flag indicating whether "none" should be the first item.

Returns

array

get_groupid()

get_groupid(string  $groupname) : integer|null

Given a group name, return a group id.

Parameters

string $groupname

Returns

integer|null

get_group_members()

get_group_members(integer  $groupid, boolean  $all = false) : array<mixed,integer>

Get all of the GID members for all users in the specified group

Parameters

integer $groupid

The CMSMS admin group id

boolean $all

Optionally include inactive users

Returns

array<mixed,integer>

expand_group_emails()

expand_group_emails(integer  $groupid) : array<mixed,string>

Get all of the known email addresses for an admin group id

Parameters

integer $groupid

The CMSMS admin group id

Returns

array<mixed,string>

get_uid_emails()

get_uid_emails(integer|array<mixed,integer>  $list) : array<mixed,string>

Get a list of email addresses matching a uid list

Parameters

integer|array<mixed,integer> $list

The list of CMSMS admin UIDs

Returns

array<mixed,string>

get_uid_email()

get_uid_email(integer  $uid = null) : string

Get the email address (if any) for the specified uid If no uid is specified, use the currently logged in admin uid

Parameters

integer $uid

The desired CMSMS admin user id. If no userid is provided, the currently logged in admin user account (if any) is used.

Returns

string

get_admin_membergroups()

get_admin_membergroups(integer  $uid) : array<mixed,integer>

Given an admin Userid get his member groups (if any)

Parameters

integer $uid

The admin userid

Returns

array<mixed,integer> —

Array of integer groups, or null.

get_userlist()

get_userlist(array<mixed,integer>  $uid_list = null) : array

Given an array of userids, get a hash of uids and usernames suitable for use in a dropdown.

Parameters

array<mixed,integer> $uid_list

Returns

array