diff options
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/agent.class.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/class/agent.class.php b/app/class/agent.class.php index 52bfc1e..038c485 100644 --- a/app/class/agent.class.php +++ b/app/class/agent.class.php @@ -51,6 +51,24 @@ abstract class agent extends object } /* + * Get the display name for this agent. For groups this is the + * object name; for users, this is the object name, unless an + * alias is set. + */ + public function getDisplayName() : string + { + if ($this->objtype != "user") + return $this->name; + + $user = new user($this->guid); + + if ($user->alias != "") + return $user->alias; + + return $user->name; + } + + /* * Check whether this agent has access permission for given * object */ |