]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User_group.php
Allow users to be unblocked from a group
[quix0rs-gnu-social.git] / classes / User_group.php
index 1be34b60bd34ec96ac3dedd00acc4f6553445cd9..9f9977755be5e8182a1f20637f7c42e7bdb7b6b9 100644 (file)
@@ -125,6 +125,29 @@ class User_group extends Memcached_DataObject
         return $members;
     }
 
+    function getBlocked($offset=0, $limit=null)
+    {
+        $qry =
+          'SELECT profile.* ' .
+          'FROM profile JOIN group_block '.
+          'ON profile.id = group_block.blocked ' .
+          'WHERE group_block.group_id = %d ' .
+          'ORDER BY group_block.modified DESC ';
+
+        if ($limit != null) {
+            if (common_config('db','type') == 'pgsql') {
+                $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
+            } else {
+                $qry .= ' LIMIT ' . $offset . ', ' . $limit;
+            }
+        }
+
+        $blocked = new Profile();
+
+        $blocked->query(sprintf($qry, $this->id));
+        return $blocked;
+    }
+
     function setOriginal($filename)
     {
         $imagefile = new ImageFile($this->id, Avatar::path($filename));