mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Add admin logging to banlist manager
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/banlist.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/banlist.php,v $
|
||||||
| $Revision: 1.5 $
|
| $Revision: 1.6 $
|
||||||
| $Date: 2007-12-16 11:14:47 $
|
| $Date: 2007-12-23 21:15:48 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -67,6 +67,7 @@ if (isset($_POST['update_ban_prefs']))
|
|||||||
$pref['ban_durations'][$i] = intval(varset($_POST['ban_time'][$i],0));
|
$pref['ban_durations'][$i] = intval(varset($_POST['ban_time'][$i],0));
|
||||||
}
|
}
|
||||||
save_prefs();
|
save_prefs();
|
||||||
|
banlist_adminlog("AL_BAN_LAN_08","",8);
|
||||||
$ns->tablerender(BANLAN_9, "<div style='text-align:center'>".BANLAN_33.'</div>');
|
$ns->tablerender(BANLAN_9, "<div style='text-align:center'>".BANLAN_33.'</div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,6 +110,14 @@ if (isset($_POST['ban_ip']))
|
|||||||
if (isset($_POST['add_ban']))
|
if (isset($_POST['add_ban']))
|
||||||
{ // Insert new value - can just pass an array
|
{ // Insert new value - can just pass an array
|
||||||
admin_update($sql -> db_Insert("banlist",$new_vals), 'insert');
|
admin_update($sql -> db_Insert("banlist",$new_vals), 'insert');
|
||||||
|
if ($_POST['entry_intent'] == 'add')
|
||||||
|
{
|
||||||
|
banlist_adminlog("AL_BAN_LAN_01",$new_vals['banlist_ip'],1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
banlist_adminlog("AL_BAN_LAN_04",$new_vals['banlist_ip'],4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Update existing value
|
{ // Update existing value
|
||||||
@@ -120,6 +129,14 @@ if (isset($_POST['ban_ip']))
|
|||||||
$spacer = ', ';
|
$spacer = ', ';
|
||||||
}
|
}
|
||||||
admin_update($sql -> db_Update("banlist", $qry." WHERE banlist_ip='".$_POST['old_ip']."'"));
|
admin_update($sql -> db_Update("banlist", $qry." WHERE banlist_ip='".$_POST['old_ip']."'"));
|
||||||
|
if ($_POST['entry_intent'] == 'edit')
|
||||||
|
{
|
||||||
|
banlist_adminlog("AL_BAN_LAN_09",$new_vals['banlist_ip'],9);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
banlist_adminlog("AL_BAN_LAN_10",$new_vals['banlist_ip'],10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
unset($ban_ip);
|
unset($ban_ip);
|
||||||
}
|
}
|
||||||
@@ -131,7 +148,16 @@ if (($action == "remove" || $action == "whremove") && isset($_POST['ban_secure']
|
|||||||
{
|
{
|
||||||
$sql -> db_Delete("generic", "gen_type='failed_login' AND gen_ip='{$sub_action}'");
|
$sql -> db_Delete("generic", "gen_type='failed_login' AND gen_ip='{$sub_action}'");
|
||||||
admin_update($sql -> db_Delete("banlist", "banlist_ip='{$sub_action}'"), 'delete');
|
admin_update($sql -> db_Delete("banlist", "banlist_ip='{$sub_action}'"), 'delete');
|
||||||
if ($action == "remove") $action = 'list'; else $action = 'white';
|
if ($action == "remove")
|
||||||
|
{
|
||||||
|
$action = 'list';
|
||||||
|
banlist_adminlog("AL_BAN_LAN_02",$sub_action,2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$action = 'white';
|
||||||
|
banlist_adminlog("AL_BAN_LAN_05",$sub_action,5);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -140,10 +166,12 @@ if ($action == 'newtime')
|
|||||||
{
|
{
|
||||||
$end_time = $id ? time() + ($id*60*60) : 0;
|
$end_time = $id ? time() + ($id*60*60) : 0;
|
||||||
admin_update($sql -> db_Update("banlist", "banlist_banexpires='".intval($end_time)."' WHERE banlist_ip='".$sub_action."'"));
|
admin_update($sql -> db_Update("banlist", "banlist_banexpires='".intval($end_time)."' WHERE banlist_ip='".$sub_action."'"));
|
||||||
|
banlist_adminlog("AL_BAN_LAN_03",$sub_action,3);
|
||||||
$action = 'list';
|
$action = 'list';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Edit modes - get existing entry
|
||||||
if ($action == "edit" || $action == "whedit")
|
if ($action == "edit" || $action == "whedit")
|
||||||
{
|
{
|
||||||
$sql->db_Select("banlist", "*", "banlist_ip='{$sub_action}'");
|
$sql->db_Select("banlist", "*", "banlist_ip='{$sub_action}'");
|
||||||
@@ -363,6 +391,7 @@ switch ($action)
|
|||||||
intval(varset($_POST['ban_over_expiry'],0)),
|
intval(varset($_POST['ban_over_expiry'],0)),
|
||||||
$separator_char[intval(varset($_POST['ban_separator'],1))],
|
$separator_char[intval(varset($_POST['ban_separator'],1))],
|
||||||
$quote_char[intval(varset($_POST['ban_quote'],3))]);
|
$quote_char[intval(varset($_POST['ban_quote'],3))]);
|
||||||
|
banlist_adminlog("AL_BAN_LAN_07",'File: '.e_FILE."public/".$files[0]['name'].'<br />'.$message,7);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -607,4 +636,13 @@ function process_csv($filename, $override_imports, $override_expiry, $separator
|
|||||||
return str_replace('--NUM--',$line_num, BANLAN_51).$filename;
|
return str_replace('--NUM--',$line_num, BANLAN_51).$filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Log event to admin log
|
||||||
|
function banlist_adminlog($title, $woffle,$msg_num='00')
|
||||||
|
{
|
||||||
|
global $pref, $admin_log;
|
||||||
|
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
|
||||||
|
$admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'BANLIST_'.$msg_num);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/banlist_export.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/banlist_export.php,v $
|
||||||
| $Revision: 1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2007-12-11 22:48:36 $
|
| $Date: 2007-12-23 21:15:48 $
|
||||||
| $Author: e107steved $
|
| $Author: e107steved $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -73,6 +73,8 @@ if ($error_string = do_export($filename, $type_list, $format_array, $use_separat
|
|||||||
// Need to report an error here
|
// Need to report an error here
|
||||||
echo "Error report: {$error_string}<br />";
|
echo "Error report: {$error_string}<br />";
|
||||||
}
|
}
|
||||||
|
banlist_adminlog("AL_BAN_LAN_06","File: ".$filename.'<br />'.$error_string,6);
|
||||||
|
|
||||||
|
|
||||||
function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '"')
|
function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '"')
|
||||||
{
|
{
|
||||||
@@ -133,4 +135,13 @@ function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log event to admin log
|
||||||
|
function banlist_adminlog($title, $woffle,$msg_num='00')
|
||||||
|
{
|
||||||
|
global $pref, $admin_log;
|
||||||
|
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
|
||||||
|
$admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'BANLIST_'.$msg_num);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
// e107 Language File.
|
// e107 Language File.
|
||||||
// $Id: lan_log_messages.php,v 1.1 2007-12-15 22:15:50 e107steved Exp $
|
// $Id: lan_log_messages.php,v 1.2 2007-12-23 21:15:54 e107steved Exp $
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The definitions in this file are for standard 'explanatory' messages which might be entered
|
The definitions in this file are for standard 'explanatory' messages which might be entered
|
||||||
@@ -36,7 +36,7 @@ define('LAN_AUDIT_LOG_020', "");
|
|||||||
|
|
||||||
// Admin log events
|
// Admin log events
|
||||||
//-----------------
|
//-----------------
|
||||||
define('LAN_ADMIN_LOG_001', '');
|
define('LAN_ADMIN_LOG_001', 'Admin edited user data');
|
||||||
define('LAN_ADMIN_LOG_002', '');
|
define('LAN_ADMIN_LOG_002', '');
|
||||||
define('LAN_ADMIN_LOG_003', '');
|
define('LAN_ADMIN_LOG_003', '');
|
||||||
define('LAN_ADMIN_LOG_004', '');
|
define('LAN_ADMIN_LOG_004', '');
|
||||||
@@ -48,12 +48,25 @@ define('LAN_ADMIN_LOG_009', '');
|
|||||||
define('LAN_ADMIN_LOG_010', '');
|
define('LAN_ADMIN_LOG_010', '');
|
||||||
define('LAN_ADMIN_LOG_011', '');
|
define('LAN_ADMIN_LOG_011', '');
|
||||||
|
|
||||||
define("AL_UC_LAN_01","Userclass created");
|
define('AL_UC_LAN_00',"Unknown userclass-related event");
|
||||||
define("AL_UC_LAN_02","Userclass deleted");
|
define('AL_UC_LAN_01',"Userclass created");
|
||||||
define("AL_UC_LAN_03","Userclass edited");
|
define('AL_UC_LAN_02',"Userclass deleted");
|
||||||
define("AL_UC_LAN_04","Class membership updated");
|
define('AL_UC_LAN_03',"Userclass edited");
|
||||||
define("AL_UC_LAN_05","Initial userclass settings edited");
|
define('AL_UC_LAN_04',"Class membership updated");
|
||||||
define("AL_UC_LAN_06","Class membership emptied");
|
define('AL_UC_LAN_05',"Initial userclass settings edited");
|
||||||
|
define('AL_UC_LAN_06',"Class membership emptied");
|
||||||
|
|
||||||
|
define('AL_BAN_LAN_00','Unknown ban-related event');
|
||||||
|
define('AL_BAN_LAN_01','Manual ban added');
|
||||||
|
define('AL_BAN_LAN_02','Ban deleted');
|
||||||
|
define('AL_BAN_LAN_03','Ban time changed');
|
||||||
|
define('AL_BAN_LAN_04','Whitelist entry added');
|
||||||
|
define('AL_BAN_LAN_05','Whitelist entry deleted');
|
||||||
|
define('AL_BAN_LAN_06','Banlist exported');
|
||||||
|
define('AL_BAN_LAN_07','Banlist imported');
|
||||||
|
define('AL_BAN_LAN_08','Banlist options updated');
|
||||||
|
define('AL_BAN_LAN_09','Banlist entry edited');
|
||||||
|
define('AL_BAN_LAN_10','Whitelist entry edited');
|
||||||
|
|
||||||
|
|
||||||
// Rolling log events
|
// Rolling log events
|
||||||
|
Reference in New Issue
Block a user