/** * 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; }
/** * Gets the Nth registration with the given IP address. * * @param string $ipaddress Address to key on * @param integer $n Nth address * * @return Registration_ip nth registration or null if not found. */ private function _getNthReg($ipaddress, $n) { $reg = new Registration_ip(); $reg->ipaddress = $ipaddress; $reg->orderBy('created DESC'); $reg->limit($n - 1, 1); if ($reg->find(true)) { return $reg; } else { return null; } }