Hey,
I thought I would contribute something that is fairly helpful to the people who use this, because in every CMS that I’ve seen Jonteh release he has never implemented a failsafe for use against TheHabbos.org.
Effectively if you are using TheHabbos or VotingAPI your site can be rendered useless as soon as somebody attacks either of them websites.
To combat this, all you need to do is check to see if the website is online before forcing the redirect to the website, to achieve this just use my code as found below and as soon as the VotingAPI is down your users will not be directed to that website.
1) Go to engine/lightcms.php and add the following code at the very bottom of the lightcms.php page; before the closing }
Code:
public function checkVoting ()
{
$chk = curl_init("http://www.votingapi.com");
curl_setopt($chk, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($chk, CURLOPT_HEADER, true);
curl_setopt($chk, CURLOPT_NOBODY, true);
curl_setopt($chk, CURLOPT_RETURNTRANSFER, true);
$chkDown = curl_exec($chk);
curl_close($chk);
if ($chkDown) return true;
return false;
}
2) Go to /client.php & /index.php and change the following code from this
Code:
if(!isset($_GET["novote"]) && $light->thehabbos_enabled) {
$vote_uri = str_replace('/', '!', WWW);
header ("Location: http://votingapi.com/vote.php?username=" . $light->thehabbos_username . "&api=" . $vote_uri . "!?novote");
}
to this
Code:
if(!isset($_GET["novote"]) && $light->thehabbos_enabled && $light->checkVoting() == true) {
$vote_uri = str_replace('/', '!', WWW);
header ("Location: http://votingapi.com/vote.php?username=" . $light->thehabbos_username . "&api=" . $vote_uri . "!client?novote");
}