diff --git a/ext/ipban/main.php b/ext/ipban/main.php index c9e1b387..59e53d70 100644 --- a/ext/ipban/main.php +++ b/ext/ipban/main.php @@ -43,6 +43,7 @@ class IPBan extends Extension { if($config->get_int("ext_ipban_version") < 8) { $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 http://whatismyipaddress.com/dynamic-static for more information.\n"); $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) { global $user; if($user->can("ban_ip")) { @@ -218,9 +225,10 @@ class IPBan extends Extension { $reason = $row[$prefix.'reason']; $admin = User::by_id($row[$prefix.'banner_id']); $date = date("Y-m-d", $row[$prefix.'end_timestamp']); + $msg = $config->get_string("ipban_message"); header("HTTP/1.0 403 Forbidden"); print "IP $ip has been banned until $date by {$admin->name} because of $reason\n"; - print "

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 http://whatismyipaddress.com/dynamic-static for more information.\n"; + print "

$msg"; $contact_link = contact_link(); if(!empty($contact_link)) {