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 Releases
CMS Releases
Ban Error Fix
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="HabboME" data-source="post: 85513" data-attributes="member: 8007"><p>Here is a fix for the ban error that is suppose to show when a user tries to log in.</p><p> </p><p>Below is how to fix it.</p><p> </p><p>Find in class.users.php</p><p> </p><p>[PHP] final public function isBanned($value)</p><p> {</p><p> global $engine;</p><p> if($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' LIMIT 1") > 0)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false;</p><p> }[/PHP]</p><p> </p><p>Replace With</p><p> </p><p>[PHP] final public function isBanned($value)</p><p> {</p><p> global $engine;</p><p> </p><p> if ($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' AND expire >= '" . time() . "' ") > 0)</p><p> {</p><p> return true;</p><p> }</p><p> </p><p> return false; </p><p> }[/PHP]</p><p> </p><p>Find in class.users.php</p><p> </p><p>[PHP] if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)</p><p> {</p><p> if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))</p><p> {</p><p> $this->turnOn($template->form->log_username);</p><p> $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);</p><p> $template->form->unsetData();</p><p> header('Location: ' . $_CONFIG['hotel']['url'] . '/me');</p><p> exit;</p><p> }</p><p> else</p><p> {</p><p> $template->form->error = 'Details do not match';</p><p> return;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $template->form->error = 'Sorry, it appears this user is banned<br />';</p><p> $template->form->error .= 'Reason: ' . $this->getReason($template->form->log_username);</p><p> return;</p><p> }[/PHP]</p><p> </p><p>Replace With</p><p> </p><p>[PHP]if($this->isBanned($_SERVER['REMOTE_ADDR']) == false)</p><p> {</p><p> if($this->isBanned($template->form->log_username) == false)</p><p> {</p><p> if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))</p><p> {</p><p> $this->turnOn($template->form->log_username);</p><p> $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);</p><p> $template->form->unsetData();</p><p> header('Location: ' . $_CONFIG['hotel']['url'] . '/me');</p><p> exit;</p><p> }</p><p> else</p><p> {</p><p> $template->form->error = 'Details do not match';</p><p> return;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $template->form->error = 'Sorry, it appears this user is banned<br />';</p><p> $template->form->error .= 'Reason: ' . $this->getReason($template->form->log_username);</p><p> return;</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $template->form->error = 'Sorry, it appears this IP is banned.<br />';</p><p> $template->form->error .= 'Reason: ' . $this->getReason($_SERVER['REMOTE_ADDR']);</p><p> return;</p><p> }[/PHP]</p></blockquote><p></p>
[QUOTE="HabboME, post: 85513, member: 8007"] Here is a fix for the ban error that is suppose to show when a user tries to log in. Below is how to fix it. Find in class.users.php [PHP] final public function isBanned($value) { global $engine; if($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' LIMIT 1") > 0) { return true; } return false; }[/PHP] Replace With [PHP] final public function isBanned($value) { global $engine; if ($engine->num_rows("SELECT * FROM bans WHERE value = '" . $value . "' AND expire >= '" . time() . "' ") > 0) { return true; } return false; }[/PHP] Find in class.users.php [PHP] if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false) { if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password))) { $this->turnOn($template->form->log_username); $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']); $template->form->unsetData(); header('Location: ' . $_CONFIG['hotel']['url'] . '/me'); exit; } else { $template->form->error = 'Details do not match'; return; } } else { $template->form->error = 'Sorry, it appears this user is banned<br />'; $template->form->error .= 'Reason: ' . $this->getReason($template->form->log_username); return; }[/PHP] Replace With [PHP]if($this->isBanned($_SERVER['REMOTE_ADDR']) == false) { if($this->isBanned($template->form->log_username) == false) { if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password))) { $this->turnOn($template->form->log_username); $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']); $template->form->unsetData(); header('Location: ' . $_CONFIG['hotel']['url'] . '/me'); exit; } else { $template->form->error = 'Details do not match'; return; } } else { $template->form->error = 'Sorry, it appears this user is banned<br />'; $template->form->error .= 'Reason: ' . $this->getReason($template->form->log_username); return; } } else { $template->form->error = 'Sorry, it appears this IP is banned.<br />'; $template->form->error .= 'Reason: ' . $this->getReason($_SERVER['REMOTE_ADDR']); return; }[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
CMS Releases
Ban Error Fix
Top