summaryrefslogtreecommitdiffstats
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/user.class.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/class/user.class.php b/app/class/user.class.php
index f1f7ff1..1130396 100644
--- a/app/class/user.class.php
+++ b/app/class/user.class.php
@@ -59,6 +59,22 @@ class User extends Object
}
/*
+ * Get all users -- ordered by admin DESC (admins first), then by name
+ */
+ function getAllUsers_orderByAdminByName()
+ {
+ $query = "SELECT o.guid FROM object o JOIN user u ON o.guid = u.guid WHERE o.type = 'user' ORDER BY u.admin DESC, o.name";
+ $result = $this->db->query($query);
+
+ $users = array();
+
+ foreach ($result as $u)
+ $users[] = new User($u['guid']);
+
+ return $users;
+ }
+
+ /*
* Check whether a given username is currently in use
*/
function usernameInUse($username)