Created
June 20, 2012 22:22
-
-
Save Repflez/2962588 to your computer and use it in GitHub Desktop.
Personal ABXD upgrade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('lib/common.php'); | |
// Get user IP. Source: http://roshanbh.com.np/2007/12/getting-real-ip-address-in-php.html | |
function getRealIpAddr() | |
{ | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) | |
{ | |
$ip=$_SERVER['HTTP_CLIENT_IP']; | |
} | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) | |
{ | |
$ip=$_SERVER['HTTP_X_FORWARDED_FOR']; | |
} | |
else | |
{ | |
$ip=$_SERVER['REMOTE_ADDR']; | |
} | |
return $ip; | |
} | |
if($loguser['powerlevel'] < 4) // Only founders can upgrade the board. | |
{ | |
$qIPBan = "insert into {$dbpref}ipbans (ip, reason, date) values ('".getRealIpAddr()."', 'He didn\'t listened', " . (time() + 86400) . ")"; | |
// The ban is for 24 hours. | |
$rIPBan = Query($qIPBan); | |
die("This is what we call not listening to the admin."); | |
} | |
Upgrade(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment