From 5f8c596d4107c41e8628989ba043f6d277ccdb57 Mon Sep 17 00:00:00 2001 From: Git Date: Sun, 22 Jul 2012 08:00:16 +0000 Subject: [PATCH] Empty commit --- sections/ajax/forum/main.php | 5 +++ sections/tools/index.php | 4 +- sections/tools/misc/quick_ban.php | 24 +++++++++++ sections/userhistory/ip_history.php | 65 ++++++++++++++++++++++++++++- 4 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 sections/tools/misc/quick_ban.php 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 @@
Elapsed to_array(); foreach($Results as $Index => $Result) { list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result; @@ -111,8 +151,28 @@ function ShowIPs(rowname) { ?> - ()
- + () +query($sql); + + if($DB->record_count() > 0) { + $IPs[$IP] = true; + ?> + [Banned] + + [Ban] + + + +
+ ('.count($UserIDs).')' : '(0)')?> @@ -149,3 +209,4 @@ function ShowIPs(rowname) { +