From 762208664a9173bc9507a66fbd0c8020e382db88 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 10 Nov 2018 09:12:01 -0500 Subject: Add function agent::getContainedUsers() This function helps further abstract agents. We want to get all users belonging to a pad that is owned by a group, or more specifically - an agent. If this agent is a user, that user is our only user to collect. If this agent is a group, we want to capture _it's_ owner along with all of it's members. Signed-off-by: Malf Furious --- app/class/user.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/class/user.class.php') diff --git a/app/class/user.class.php b/app/class/user.class.php index 90aac44..231111d 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -293,6 +293,15 @@ class user extends agent return $groups; } + /* + * Get all contained users. This is just an array containing + * the user object. + */ + public function getContainedUsers() : array + { + return array($this); + } + /* * Send an email message to this user using stored configuration * parameters. If config is not established, delivery is not -- cgit v1.2.3