diff --git a/sections/ajax/forum/main.php b/sections/ajax/forum/main.php index 9b0ae8dc..9e1bd235 100644 --- a/sections/ajax/forum/main.php +++ b/sections/ajax/forum/main.php @@ -82,6 +82,11 @@ 'sticky' => $Sticky == 1 ); } +// ...And an extra one to catch the last category. +if (!empty($JsonForums) && !empty($JsonCategory)) { + $JsonCategory['forums'] = $JsonForums; + $JsonCategories[] = $JsonCategory; +} print json_encode( array( diff --git a/sections/tools/index.php b/sections/tools/index.php index b3a92ecd..6658f68b 100644 --- a/sections/tools/index.php +++ b/sections/tools/index.php @@ -265,7 +265,9 @@ //TODO: Clean up db table ip_bans. include("managers/bans.php"); break; - + case 'quick_ban': + include("misc/quick_ban.php"); + break; //Data case 'registration_log': include('data/registration_log.php'); diff --git a/sections/tools/misc/quick_ban.php b/sections/tools/misc/quick_ban.php new file mode 100644 index 00000000..5c190d2b --- /dev/null +++ b/sections/tools/misc/quick_ban.php @@ -0,0 +1,24 @@ +query('DELETE FROM ip_bans WHERE ID='.$_GET['id']); + $Bans = $Cache->delete_value('ip_bans'); + } + elseif($_GET['perform'] == 'create') { + $Notes = db_string($_GET['notes']); + $IP = ip2unsigned($_GET['ip']); //Sanitized by Validation regex + $DB->query("INSERT INTO ip_bans + (FromIP, ToIP, Reason) VALUES + ('$IP','$IP', '$Notes')"); + $ID = $DB->inserted_id(); + $Bans = $Cache->get_value('ip_bans'); + $Bans[$ID] = array($ID, $Start, $End); + $Cache->cache_value('ip_bans', $Bans, 0); + } +} + + +?> diff --git a/sections/userhistory/ip_history.php b/sections/userhistory/ip_history.php index c2e22201..449e2260 100644 --- a/sections/userhistory/ip_history.php +++ b/sections/userhistory/ip_history.php @@ -29,7 +29,45 @@