Author: david
Date: Wed Oct 21 17:51:51 2009
New Revision: 3793

Log:
Add listGroups() method.

Modified:
   trunk/apps/qubit/lib/myUser.class.php

Modified: trunk/apps/qubit/lib/myUser.class.php
==============================================================================
--- trunk/apps/qubit/lib/myUser.class.php       Wed Oct 21 16:11:36 2009        
(r3792)
+++ trunk/apps/qubit/lib/myUser.class.php       Wed Oct 21 17:51:51 2009        
(r3793)
@@ -128,4 +128,26 @@
 
     return $hasGroup;
   }
+
+  public function listGroups()
+  {
+    if (null !== ($qubitUser = $this->getQubitUser()))
+    {
+      $groups = array(QubitAclGroup::getById(QubitAclGroup::AUTHENTICATED_ID));
+
+      if (null !== $qubitUser->aclUserGroups)
+      {
+        foreach ($qubitUser->aclUserGroups as $aclUserGroup)
+        {
+          $groups[] = QubitAclGroup::getById($aclUserGroup->groupId);
+        }
+      }
+
+      return $groups;
+    }
+    else
+    {
+      return QubitAclGroup::getById(QubitAclGroup::ANONYMOUS_ID);
+    }
+  }
 }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to