Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
How can I change registration limit per ip?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="5050" data-source="post: 428959" data-attributes="member: 57136"><p>Add another class before line 131:</p><p>[PHP]public static function ipTaken($username)</p><p> {</p><p> global $dbh;</p><p> $stmt = $dbh->prepare("SELECT ip_last,ip_reg FROM users WHERE ip_last = :ip OR ip_reg = :ip LIMIT 1");</p><p> $stmt->bindParam(':ip', $_SERVER['REMOTE_ADDR']);</p><p> $stmt->execute();</p><p> if ($stmt->RowCount() > 0)</p><p> {</p><p> return true;</p><p> }</p><p> else</p><p> {</p><p> return false;</p><p> }</p><p> }[/PHP]</p><p>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.</p><p>[PHP]if (!self::ipTaken($_POST['username']))</p><p> {[/PHP]</p><p>Go to line 262 and complete it:</p><p>[PHP]}</p><p> else</p><p> {</p><p> echo 'used_ip';</p><p> return;</p><p> }[/PHP]</p><p></p><p>For the hell of it, you could add your new function to the index at the top, starting at line six.</p><p>[PHP]/*</p><p> Functions list Class User.</p><p> ---------------</p><p> checkUser();</p><p> hashed();</p><p> validName();</p><p> userData();</p><p> emailTaken();</p><p> userTaken();</p><p> ipTaken();</p><p> refUser();</p><p> login();</p><p> register();</p><p> userRefClaim();</p><p> editPassword();</p><p> editEmail();</p><p> editHotelSettings();</p><p> editUsername();</p><p> */[/PHP]</p><p></p><p>Keep in mind:</p><ul> <li data-xf-list-type="ul"></li> <li data-xf-list-type="ul"><a href="https://support.cloudflare.com/hc/en-us/articles/200170786-Why-do-my-server-logs-show-Cloudflare-s-IPs-using-Cloudflare-" target="_blank">CloudFlare proxies user IPs.</a></li> </ul></blockquote><p></p>
[QUOTE="5050, post: 428959, member: 57136"] 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; } }[/PHP] 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'])) {[/PHP] Go to line 262 and complete it: [PHP]} else { echo 'used_ip'; return; }[/PHP] 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(); */[/PHP] Keep in mind: [LIST] [*] [*][URL='https://support.cloudflare.com/hc/en-us/articles/200170786-Why-do-my-server-logs-show-Cloudflare-s-IPs-using-Cloudflare-']CloudFlare proxies user IPs.[/URL] [/LIST] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
How can I change registration limit per ip?
Top