summaryrefslogtreecommitdiff
path: root/classes/User_group.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/User_group.php')
-rw-r--r--classes/User_group.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/classes/User_group.php b/classes/User_group.php
index 0fcfee8c6..1a24124bb 100644
--- a/classes/User_group.php
+++ b/classes/User_group.php
@@ -225,4 +225,18 @@ class User_group extends Memcached_DataObject
return true;
}
+
+ static function getForNickname($nickname)
+ {
+ $nickname = common_canonical_nickname($nickname);
+ $group = User_group::staticGet('nickname', $nickname);
+ if (!empty($group)) {
+ return $group;
+ }
+ $alias = Group_alias::staticGet('alias', $nickname);
+ if (!empty($alias)) {
+ return User_group::staticGet('id', $alias->group_id);
+ }
+ return null;
+ }
}