mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-20 21:21:37 +00:00
Empty commit
This commit is contained in:
parent
3ada9b8640
commit
5f8c596d41
@ -82,6 +82,11 @@
|
|||||||
'sticky' => $Sticky == 1
|
'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(
|
print json_encode(
|
||||||
array(
|
array(
|
||||||
|
@ -265,7 +265,9 @@
|
|||||||
//TODO: Clean up db table ip_bans.
|
//TODO: Clean up db table ip_bans.
|
||||||
include("managers/bans.php");
|
include("managers/bans.php");
|
||||||
break;
|
break;
|
||||||
|
case 'quick_ban':
|
||||||
|
include("misc/quick_ban.php");
|
||||||
|
break;
|
||||||
//Data
|
//Data
|
||||||
case 'registration_log':
|
case 'registration_log':
|
||||||
include('data/registration_log.php');
|
include('data/registration_log.php');
|
||||||
|
24
sections/tools/misc/quick_ban.php
Normal file
24
sections/tools/misc/quick_ban.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if(!check_perms('admin_manage_ipbans')) { error(403); }
|
||||||
|
if(isset($_GET['perform'])) {
|
||||||
|
if($_GET['perform'] == 'delete') {
|
||||||
|
if(!is_number($_GET['id']) || $_GET['id'] == ''){ error(0); }
|
||||||
|
$DB->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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
@ -29,7 +29,45 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function ShowIPs(rowname) {
|
function ShowIPs(rowname) {
|
||||||
$('tr[name="'+rowname+'"]').toggle();
|
$('tr[name="'+rowname+'"]').toggle();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function Ban(ip, id, elemID) {
|
||||||
|
var notes = prompt("Enter notes for this ban");
|
||||||
|
if(notes != null && notes.length > 0) {
|
||||||
|
var xmlhttp;
|
||||||
|
if (window.XMLHttpRequest) {
|
||||||
|
xmlhttp=new XMLHttpRequest();
|
||||||
|
} else {
|
||||||
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
|
}
|
||||||
|
xmlhttp.onreadystatechange=function() {
|
||||||
|
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
|
||||||
|
document.getElementById(elemID).innerHTML = "<strong>[Banned]</strong>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xmlhttp.open("GET","tools.php?action=quick_ban&perform=create&ip=" + ip + "¬es=" + notes,true);
|
||||||
|
xmlhttp.send();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
function UnBan(ip, id, elemID) {
|
||||||
|
var xmlhttp;
|
||||||
|
if (window.XMLHttpRequest) {
|
||||||
|
xmlhttp=new XMLHttpRequest();
|
||||||
|
} else {
|
||||||
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
|
}
|
||||||
|
xmlhttp.onreadystatechange=function() {
|
||||||
|
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
|
||||||
|
document.getElementById(elemID).innerHTML = "Ban";
|
||||||
|
document.getElementById(elemID).onClick = function() { Ban(ip, id, elemID); return false;};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
xmlhttp.open("GET","tools.php?action=quick_ban&perform=delete&id="+id,true);
|
||||||
|
xmlhttp.send();
|
||||||
|
}
|
||||||
|
*/
|
||||||
</script>
|
</script>
|
||||||
<div class="thin">
|
<div class="thin">
|
||||||
<?
|
<?
|
||||||
@ -92,6 +130,8 @@ function ShowIPs(rowname) {
|
|||||||
<td>Elapsed</td>
|
<td>Elapsed</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
|
$counter = 0;
|
||||||
|
$IPs = array();
|
||||||
$Results = $DB->to_array();
|
$Results = $DB->to_array();
|
||||||
foreach($Results as $Index => $Result) {
|
foreach($Results as $Index => $Result) {
|
||||||
list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result;
|
list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result;
|
||||||
@ -111,8 +151,28 @@ function ShowIPs(rowname) {
|
|||||||
?>
|
?>
|
||||||
<tr class="rowa">
|
<tr class="rowa">
|
||||||
<td>
|
<td>
|
||||||
<?=$IP?> (<?=get_cc($IP)?>) <br />
|
<?=$IP?> (<?=get_cc($IP)?>)
|
||||||
<?=get_host($IP)?>
|
<?
|
||||||
|
if(!isset($IPs[$IP])) {
|
||||||
|
$sql = "SELECT ID, FromIP, ToIP FROM ip_bans WHERE '".ip2unsigned($IP)."' BETWEEN FromIP AND ToIP LIMIT 1";
|
||||||
|
$DB->query($sql);
|
||||||
|
|
||||||
|
if($DB->record_count() > 0) {
|
||||||
|
$IPs[$IP] = true;
|
||||||
|
?>
|
||||||
|
<strong>[Banned]
|
||||||
|
<? }
|
||||||
|
else {
|
||||||
|
$IPs[$IP] = false; ?>
|
||||||
|
<a id="<?=$counter?>" href="#" onclick="Ban('<?=$IP?>', '<?=$ID?>', '<?=$counter?>'); this.onclick=null;return false;">[Ban]</a>
|
||||||
|
<? }
|
||||||
|
$counter++;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<?=get_host($IP)?>
|
||||||
<?=($HasDupe ?
|
<?=($HasDupe ?
|
||||||
'<a href="#" onclick="ShowIPs('.$Index.'); return false;">('.count($UserIDs).')</a>'
|
'<a href="#" onclick="ShowIPs('.$Index.'); return false;">('.count($UserIDs).')</a>'
|
||||||
: '(0)')?></td>
|
: '(0)')?></td>
|
||||||
@ -149,3 +209,4 @@ function ShowIPs(rowname) {
|
|||||||
<?
|
<?
|
||||||
show_footer();
|
show_footer();
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user