Avoid ordering just by a timestamp
Try to also employ an id when possible. Involves reworking some of the indices.
This commit is contained in:
		@@ -1,42 +1,39 @@
 | 
			
		||||
<?php
 | 
			
		||||
// This file is part of GNU social - https://www.gnu.org/software/social
 | 
			
		||||
//
 | 
			
		||||
// GNU social is free software: you can redistribute it and/or modify
 | 
			
		||||
// it under the terms of the GNU Affero General Public License as published by
 | 
			
		||||
// the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
// (at your option) any later version.
 | 
			
		||||
//
 | 
			
		||||
// GNU social is distributed in the hope that it will be useful,
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
// GNU Affero General Public License for more details.
 | 
			
		||||
//
 | 
			
		||||
// You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
// along with GNU social.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Data class for storing IP addresses of new registrants.
 | 
			
		||||
 *
 | 
			
		||||
 * PHP version 5
 | 
			
		||||
 *
 | 
			
		||||
 * @category Data
 | 
			
		||||
 * @package  StatusNet
 | 
			
		||||
 * @author   Evan Prodromou <evan@status.net>
 | 
			
		||||
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 | 
			
		||||
 * @link     http://status.net/
 | 
			
		||||
 *
 | 
			
		||||
 * StatusNet - the distributed open-source microblogging tool
 | 
			
		||||
 * Copyright (C) 2010, StatusNet, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software: you can redistribute it and/or modify
 | 
			
		||||
 * it under the terms of the GNU Affero General Public License as published by
 | 
			
		||||
 * the Free Software Foundation, either version 3 of the License, or
 | 
			
		||||
 * (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the
 | 
			
		||||
 * GNU Affero General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU Affero General Public License
 | 
			
		||||
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
 * @category  Data
 | 
			
		||||
 * @package   GNUsocial
 | 
			
		||||
 * @author    Evan Prodromou <evan@status.net>
 | 
			
		||||
 * @copyright 2010 StatusNet, Inc.
 | 
			
		||||
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
if (!defined('GNUSOCIAL')) { exit(1); }
 | 
			
		||||
defined('GNUSOCIAL') || die();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Data class for storing IP addresses of new registrants.
 | 
			
		||||
 *
 | 
			
		||||
 * @category Spam
 | 
			
		||||
 * @package  StatusNet
 | 
			
		||||
 * @author   Evan Prodromou <evan@status.net>
 | 
			
		||||
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
 | 
			
		||||
 * @link     http://status.net/
 | 
			
		||||
 * @category  Spam
 | 
			
		||||
 * @package   GNUsocial
 | 
			
		||||
 * @author    Evan Prodromou <evan@status.net>
 | 
			
		||||
 * @copyright 2010 StatusNet, Inc.
 | 
			
		||||
 * @license   https://www.gnu.org/licenses/agpl.html GNU AGPL v3 or later
 | 
			
		||||
 */
 | 
			
		||||
class Registration_ip extends Managed_DataObject
 | 
			
		||||
{
 | 
			
		||||
@@ -60,8 +57,7 @@ class Registration_ip extends Managed_DataObject
 | 
			
		||||
                'registration_ip_user_id_fkey' => array('user', array('user_id' => 'id')),
 | 
			
		||||
            ),
 | 
			
		||||
            'indexes' => array(
 | 
			
		||||
                'registration_ip_ipaddress_idx' => array('ipaddress'),
 | 
			
		||||
                'registration_ip_created_idx' => array('created'),
 | 
			
		||||
                'registration_ip_ipaddress_created_idx' => array('ipaddress', 'created'),
 | 
			
		||||
            ),
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
@@ -73,7 +69,7 @@ class Registration_ip extends Managed_DataObject
 | 
			
		||||
     *
 | 
			
		||||
     * @return Array IDs of users who registered with this address.
 | 
			
		||||
     */
 | 
			
		||||
    static function usersByIP($ipaddress)
 | 
			
		||||
    public static function usersByIP($ipaddress)
 | 
			
		||||
    {
 | 
			
		||||
        $ids = array();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user