]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/RegisterThrottle/Registration_ip.php
Merge branch '1.1.x' of gitorious.org:statusnet/mainline into 1.1.x
[quix0rs-gnu-social.git] / plugins / RegisterThrottle / Registration_ip.php
index 5c7396b9b06ddb2e8935452b41a410f3378ec99d..f9fc4918d53b8be387e6499ca7ec630d9debbf76 100644 (file)
@@ -115,4 +115,27 @@ class Registration_ip extends Memcached_DataObject
     {
         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;
+    }
 }