Author: david
Date: Tue Sep  6 14:42:57 2011
New Revision: 9674

Log:
Add method to grab 'system admin' user, which for now is the first user with 
administrator priviliges

Modified:
   trunk/lib/model/QubitUser.php

Modified: trunk/lib/model/QubitUser.php
==============================================================================
--- trunk/lib/model/QubitUser.php       Tue Sep  6 14:20:28 2011        (r9673)
+++ trunk/lib/model/QubitUser.php       Tue Sep  6 14:42:57 2011        (r9674)
@@ -163,4 +163,23 @@
 
     return $hasGroup;
   }
+
+  /**
+   * Get system admin
+   *
+   * We are assuming the first admin user is the system admin
+   *
+   * @return QubitUser
+   */
+  public static function getSystemAdmin()
+  {
+    foreach (self::getAll() as $user)
+    {
+      var_dump($user->email);
+      if ($user->hasGroup(QubitAclGroup::ADMINISTRATOR_ID))
+      {
+        return $user;
+      }
+    }
+  }
 } // User

-- 
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.com/group/qubit-commits?hl=en.

Reply via email to