From f7218a677d928c264b25e0af416f794ad24a9bb3 Mon Sep 17 00:00:00 2001 From: shish Date: Fri, 11 Apr 2008 05:23:11 +0000 Subject: [PATCH] IP Ban list on its own page git-svn-id: file:///home/shish/svn/shimmie2/trunk@801 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/ipban/main.php | 15 ++++++++++----- ext/ipban/theme.php | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ext/ipban/main.php b/ext/ipban/main.php index 2c03be6a..33c18397 100644 --- a/ext/ipban/main.php +++ b/ext/ipban/main.php @@ -61,6 +61,16 @@ class IPBan extends Extension { $page->set_redirect(make_link("admin")); } } + else if($event->get_arg(0) == "list") { + global $page; + $this->theme->display_bans($page, $this->get_bans()); + } + } + } + + if(is_a($event, 'UserBlockBuildingEvent')) { + if($event->user->is_admin()) { + $event->add_link("IP Bans", make_link("ip_ban/list")); } } @@ -72,11 +82,6 @@ class IPBan extends Extension { if(is_a($event, 'RemoveIPBanEvent')) { $this->remove_ip_ban($event->id); } - - if(is_a($event, 'AdminBuildingEvent')) { - global $page; - $this->theme->display_bans($page, $this->get_bans()); - } } // }}} // installer {{{ diff --git a/ext/ipban/theme.php b/ext/ipban/theme.php index 63d3eba5..43ddc0fa 100644 --- a/ext/ipban/theme.php +++ b/ext/ipban/theme.php @@ -42,6 +42,9 @@ class IPBanTheme extends Themelet { "; + $page->set_title("IP Bans"); + $page->set_heading("IP Bans"); + $page->add_block(new NavBlock()); $page->add_block(new Block("Edit IP Bans", $html)); } }