custom ipban message
This commit is contained in:
parent
d918f058bf
commit
7abf1aa591
@ -43,6 +43,7 @@ class IPBan extends Extension {
|
|||||||
if($config->get_int("ext_ipban_version") < 8) {
|
if($config->get_int("ext_ipban_version") < 8) {
|
||||||
$this->install();
|
$this->install();
|
||||||
}
|
}
|
||||||
|
$config->set_default_string("ipban_message", "If you couldn't possibly be guilty of what you're banned for, the person we banned probably had a dynamic IP address and so do you. See <a href='http://whatismyipaddress.com/dynamic-static'>http://whatismyipaddress.com/dynamic-static</a> for more information.\n");
|
||||||
$this->check_ip_ban();
|
$this->check_ip_ban();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,6 +82,12 @@ class IPBan extends Extension {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onSetupBuilding(SetupBuildingEvent $event) {
|
||||||
|
$sb = new SetupBlock("IP Ban");
|
||||||
|
$sb->add_longtext_option("ipban_message", 'Message to show to banned users:');
|
||||||
|
$event->panel->add_block($sb);
|
||||||
|
}
|
||||||
|
|
||||||
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
public function onUserBlockBuilding(UserBlockBuildingEvent $event) {
|
||||||
global $user;
|
global $user;
|
||||||
if($user->can("ban_ip")) {
|
if($user->can("ban_ip")) {
|
||||||
@ -218,9 +225,10 @@ class IPBan extends Extension {
|
|||||||
$reason = $row[$prefix.'reason'];
|
$reason = $row[$prefix.'reason'];
|
||||||
$admin = User::by_id($row[$prefix.'banner_id']);
|
$admin = User::by_id($row[$prefix.'banner_id']);
|
||||||
$date = date("Y-m-d", $row[$prefix.'end_timestamp']);
|
$date = date("Y-m-d", $row[$prefix.'end_timestamp']);
|
||||||
|
$msg = $config->get_string("ipban_message");
|
||||||
header("HTTP/1.0 403 Forbidden");
|
header("HTTP/1.0 403 Forbidden");
|
||||||
print "IP <b>$ip</b> has been banned until <b>$date</b> by <b>{$admin->name}</b> because of <b>$reason</b>\n";
|
print "IP <b>$ip</b> has been banned until <b>$date</b> by <b>{$admin->name}</b> because of <b>$reason</b>\n";
|
||||||
print "<p>If you couldn't possibly be guilty of what you're banned for, the person we banned probably had a dynamic IP address and so do you. See <a href='http://whatismyipaddress.com/dynamic-static'>http://whatismyipaddress.com/dynamic-static</a> for more information.\n";
|
print "<p>$msg";
|
||||||
|
|
||||||
$contact_link = contact_link();
|
$contact_link = contact_link();
|
||||||
if(!empty($contact_link)) {
|
if(!empty($contact_link)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user