diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php
index 6291d9d9c..d8935ce6a 100644
--- a/e107_admin/admin_log.php
+++ b/e107_admin/admin_log.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/admin_log.php,v $
-| $Revision: 1.12 $
-| $Date: 2008-01-11 21:53:33 $
+| $Revision: 1.13 $
+| $Date: 2008-05-17 15:00:32 $
| $Author: e107steved $
|
| Preferences:
@@ -71,6 +71,29 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_log_messages.php');
+// Delete comments if appropriate
+if (isset($_POST['deleteitems']) && ($action == 'comments'))
+{
+ $c_list = array();
+ foreach ($_POST['del_item'] as $di)
+ {
+ if (intval($di) > 0) $c_list[] = '`comment_id`='.intval($di);
+ }
+ if ($count = $sql->db_Delete('comments',implode(' OR ',$c_list)))
+ {
+ $text = str_replace('--NUMBER--', $count,RL_LAN_112);
+ $admin_log->log_event('COMMENT_01','ID: '.implode(',',$_POST['del_item']),E_LOG_INFORMATIVE,'');
+ }
+ else
+ {
+ $text = RL_LAN_113;
+ }
+ $ns -> tablerender(LAN_DELETE, "
".$text."
");
+ unset($c_list);
+}
+
+
+
// ****************** MAINTENANCE ******************
unset($back_count);
if (isset($_POST['deleteoldadmin']) && isset($_POST['rolllog_clearadmin']))
@@ -193,11 +216,10 @@ if (($action == "confdel") || ($action == "auditdel"))
-// Arrays of options for the various logs
-$log_db_table = array('adminlog' => 'admin_log', 'auditlog' => 'audit_log', 'rolllog' => 'dblog', 'downlog' => 'download_requests');
-$back_day_count = array('adminlog' => 30, 'auditlog' => 30, 'rolllog' => max(intval($pref['roll_log_days']),1), 'downlog' => 60);
-$page_title = array('adminlog' => RL_LAN_030, 'auditlog' => RL_LAN_062, 'rolllog' => RL_LAN_002, 'downlog' => RL_LAN_067);
-$col_count = array('adminlog' => 8, 'auditlog' => 8, 'rolllog' => 9);
+// Arrays of options for the various logs - the $page_title array is used to determine the allowable values for $action ('options' is a special case)
+$log_db_table = array('adminlog' => 'admin_log', 'auditlog' => 'audit_log', 'rolllog' => 'dblog', 'downlog' => 'download_requests', 'comments' => 'comments');
+$back_day_count = array('adminlog' => 30, 'auditlog' => 30, 'rolllog' => max(intval($pref['roll_log_days']),1), 'downlog' => 60, 'detailed' => 20, 'comments' => 30);
+$page_title = array('adminlog' => RL_LAN_030, 'auditlog' => RL_LAN_062, 'rolllog' => RL_LAN_002, 'downlog' => RL_LAN_067, 'detailed' => RL_LAN_094, 'comments' => RL_LAN_099);
@@ -214,14 +236,26 @@ $sort_field = "dblog_id";
$sort_order = "DESC";
$downloadid_filter = '';
+$last_noted_time = 0;
+
+
// Maintain the log view filter across pages
$rl_cookiename = $pref['cookie_name']."_rl_admin";
-if (isset($_POST['updatefilters']))
+if (isset($_POST['updatefilters']) || isset($_POST['clearfilters']))
{ // Need to put the filter values into the cookie
+ if (!isset($_POST['clearfilters']))
+ { // Only update filter values from S_POST[] if 'clear filters' not active
$start_time = $_POST['starttimedate'] + $_POST['starttimehours']*3600 + $_POST['starttimemins']*60;
$start_enabled = isset($_POST['start_enabled']);
- $end_time = $_POST['endtimedate'] + $_POST['endtimehours']*3600 + $_POST['endtimemins']*60;
+ if (isset($_POST['timelength']))
+ {
+ $end_time = intval($_POST['timelength'])*60 + $start_time;
+ }
+ else
+ {
+ $end_time = $_POST['endtimedate'] + $_POST['endtimehours']*3600 + $_POST['endtimemins']*60;
+ }
$end_enabled = isset($_POST['end_enabled']);
$user_filter = $_POST['roll_user_filter'];
$event_filter = $_POST['roll_event_filter'];
@@ -230,6 +264,7 @@ if (isset($_POST['updatefilters']))
$caller_filter = $_POST['roll_caller_filter'];
$ipaddress_filter = $_POST['roll_ipaddress_filter'];
$downloadid_filter = $_POST['roll_downloadid_filter'];
+ }
$cookie_string = implode("|",array($start_time,$start_enabled,$end_time,$end_enabled,$user_filter,$event_filter,$pri_filter_cond,$pri_filter_val,$caller_filter,$ipaddress_filter,$downloadid_filter));
// echo $cookie_string."
";
// Create session cookie to store values
@@ -240,11 +275,16 @@ else
// Now try and get the filters from the cookie
if (isset($_COOKIE[$rl_cookiename]))
list($start_time,$start_enabled,$end_time,$end_enabled,$user_filter,$event_filter,$pri_filter_cond,$pri_filter_val, $caller_filter,$ipaddress_filter,$downloadid_filter) = explode("|",$_COOKIE[$rl_cookiename]);
+ if (isset($qs[1]) && isset($qs[2]) && ($qs[1] == 'user') && ctype_digit($qs[2]) && (intval($qs[2]) > 0))
+ {
+ $user_filter = intval($qs[2]);
+ }
}
+$timelength = 5;
+if ($start_time != 0 && $end_time != 0) $timelength = intval(($end_time - $start_time)/60);
-
-function time_box($boxname, $this_time, $day_count, $inc_tomorrow = FALSE)
+function time_box($boxname, $this_time, $day_count, $inc_tomorrow = FALSE, $all_mins = FALSE)
{ // Generates boxes for date and time for today and the preceding days
// Appends 'date', 'hours', 'mins' to the specified boxname
@@ -276,7 +316,7 @@ function time_box($boxname, $this_time, $day_count, $inc_tomorrow = FALSE)
// Minutes
$ret .= "