]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/RegisterThrottle/Registration_ip.php
Use InboxNoticeStream class for inbox
[quix0rs-gnu-social.git] / plugins / RegisterThrottle / Registration_ip.php
index 5c7396b9b06ddb2e8935452b41a410f3378ec99d..2486e36b462d6109d81cc4978acc3ff10218806d 100644 (file)
@@ -111,8 +111,33 @@ class Registration_ip extends Memcached_DataObject
      *
      * @return array magic three-false array that stops auto-incrementing.
      */
+
     function sequenceKey()
     {
         return array(false, false, false);
     }
+
+    /**
+     * Get the users who've registered with this ip address.
+     *
+     * @param Array $ipaddress IP address to check for
+     *
+     * @return Array IDs of users who registered with this address.
+     */
+
+    static function usersByIP($ipaddress)
+    {
+        $ids = array();
+
+        $ri            = new Registration_ip();
+        $ri->ipaddress = $ipaddress;
+
+        if ($ri->find()) {
+            while ($ri->fetch()) {
+                $ids[] = $ri->user_id;
+            }
+        }
+
+        return $ids;
+    }
 }