How can I change registration limit per ip?

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
Should be in the CMS engine somewhere. Never looked into BrainCMS so I only know where it is in RevCMS.

It could be in some of the register pages or core of those files.
 

Jerry

not rly active lol
Jul 8, 2013
1,956
522
Limiting IPs on registration is quite useless nowadays because the user can just easily use a VPN or change their IP address.

Even if you add cookie checks, the user can just use a different browser or clear their cookies, lol.
 

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
Limiting IPs on registration is quite useless nowadays because the user can just easily use a VPN or change their IP address.

Even if you add cookie checks, the user can just use a different browser or clear their cookies, lol.
Stops idiots doing it. Also makes it harder for people to do it.

The only way to stop this stuff from happening would be email validation or making the user x amount of minutes/hours old before they can trade.
 

Jwake

Member
Feb 12, 2016
140
10
Stops idiots doing it. Also makes it harder for people to do it.

The only way to stop this stuff from happening would be email validation or making the user x amount of minutes/hours old before they can trade.
Would this even work? 10minute email or w/e.
 

Joe

Well-Known Member
Jun 10, 2012
4,090
1,918
Would this even work? 10minute email or w/e.
You can disable trading on new accounts until they're 1 hour old or something. Can also make it so they have to validate their email before they can trade.

I wouldn't recommend these on small hotels though, pisses people off.
 

5050

Member
Feb 25, 2015
34
13
Add another class before line 131:
PHP:
public static function ipTaken($username)
        {
            global $dbh;
            $stmt = $dbh->prepare("SELECT ip_last,ip_reg FROM users WHERE ip_last = :ip OR ip_reg = :ip  LIMIT 1");
            $stmt->bindParam(':ip', $_SERVER['REMOTE_ADDR']);
            $stmt->execute();
            if ($stmt->RowCount() > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
Then add another conditional under the user register function in the user class (system/app/classes/class.user.php), you could add it on line 269.
PHP:
if (!self::ipTaken($_POST['username']))
                                            {
Go to line 262 and complete it:
PHP:
}
                                            else
                                            {
                                                echo 'used_ip';
                                                return;
                                            }

For the hell of it, you could add your new function to the index at the top, starting at line six.
PHP:
/*
        Functions list Class User.
        ---------------
        checkUser();
        hashed();
        validName();
        userData();
        emailTaken();
        userTaken();
        ipTaken();
        refUser();
        login();
        register();
        userRefClaim();
        editPassword();
        editEmail();
        editHotelSettings();
        editUsername();
    */

Keep in mind:
  • Limiting IPs on registration is quite useless nowadays because the user can just easily use a VPN or change their IP address.

    Even if you add cookie checks, the user can just use a different browser or clear their cookies, lol.
 

MayoMayn

BestDev
Oct 18, 2016
1,423
683
Stops idiots doing it. Also makes it harder for people to do it.

The only way to stop this stuff from happening would be email validation or making the user x amount of minutes/hours old before they can trade.
To actually restrict per IP, you should disallow the usage of VPNs otherwise people will just mask their IP that way.

 

Users who are viewing this thread

Top