1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Simplify admin logging messages

This commit is contained in:
e107steved
2008-01-16 22:18:27 +00:00
parent be137a06e4
commit bcd40463a7
9 changed files with 111 additions and 96 deletions

View File

@@ -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.8 $ | $Revision: 1.9 $
| $Date: 2008-01-13 10:51:34 $ | $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -67,7 +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); banlist_adminlog('08',"");
$ns->tablerender(BANLAN_9, "<div style='text-align:center'>".BANLAN_33.'</div>'); $ns->tablerender(BANLAN_9, "<div style='text-align:center'>".BANLAN_33.'</div>');
} }
@@ -112,11 +112,11 @@ if (isset($_POST['ban_ip']))
admin_update($sql -> db_Insert("banlist",$new_vals), 'insert'); admin_update($sql -> db_Insert("banlist",$new_vals), 'insert');
if ($_POST['entry_intent'] == 'add') if ($_POST['entry_intent'] == 'add')
{ {
banlist_adminlog("AL_BAN_LAN_01",$new_vals['banlist_ip'],1); banlist_adminlog('01',$new_vals['banlist_ip']);
} }
else else
{ {
banlist_adminlog("AL_BAN_LAN_04",$new_vals['banlist_ip'],4); banlist_adminlog('04',$new_vals['banlist_ip']);
} }
} }
else else
@@ -131,11 +131,11 @@ if (isset($_POST['ban_ip']))
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') if ($_POST['entry_intent'] == 'edit')
{ {
banlist_adminlog("AL_BAN_LAN_09",$new_vals['banlist_ip'],9); banlist_adminlog("09",$new_vals['banlist_ip']);
} }
else else
{ {
banlist_adminlog("AL_BAN_LAN_10",$new_vals['banlist_ip'],10); banlist_adminlog("10",$new_vals['banlist_ip']);
} }
} }
unset($ban_ip); unset($ban_ip);
@@ -151,12 +151,12 @@ if (($action == "remove" || $action == "whremove") && isset($_POST['ban_secure']
if ($action == "remove") if ($action == "remove")
{ {
$action = 'list'; $action = 'list';
banlist_adminlog("AL_BAN_LAN_02",$sub_action,2); banlist_adminlog("02",$sub_action);
} }
else else
{ {
$action = 'white'; $action = 'white';
banlist_adminlog("AL_BAN_LAN_05",$sub_action,5); banlist_adminlog("05",$sub_action);
} }
} }
@@ -166,7 +166,7 @@ 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); banlist_adminlog("03",$sub_action);
$action = 'list'; $action = 'list';
} }
@@ -493,7 +493,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); banlist_adminlog("07",'File: '.e_FILE."public/".$files[0]['name'].'<br />'.$message);
} }
} }
@@ -745,11 +745,12 @@ function process_csv($filename, $override_imports, $override_expiry, $separator
// Log event to admin log // Log event to admin log
function banlist_adminlog($title, $woffle,$msg_num='00') function banlist_adminlog($msg_num='00', $woffle='')
{ {
global $pref, $admin_log; global $pref, $admin_log;
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return; // if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
$admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'BANLIST_'.$msg_num); // $admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'BANLIST_'.$msg_num);
$admin_log->log_event('BANLIST_'.$msg_num,$woffle,E_LOG_INFORMATIVE,'');
} }
?> ?>

View File

@@ -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.2 $ | $Revision: 1.3 $
| $Date: 2007-12-23 21:15:48 $ | $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -73,7 +73,7 @@ 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); banlist_adminlog('06',"File: ".$filename.'<br />'.$error_string);
function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '"') function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '"')
@@ -136,11 +136,12 @@ function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '
} }
// Log event to admin log // Log event to admin log
function banlist_adminlog($title, $woffle,$msg_num='00') function banlist_adminlog($msg_num='00', $woffle='')
{ {
global $pref, $admin_log; global $pref, $admin_log;
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return; // if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
$admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'BANLIST_'.$msg_num); // $admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'BANLIST_'.$msg_num);
$admin_log->log_event('BANLIST_'.$msg_num,$woffle,E_LOG_INFORMATIVE,'');
} }

View File

@@ -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/userclass.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/userclass.php,v $
| $Revision: 1.2 $ | $Revision: 1.3 $
| $Date: 2008-01-01 18:18:05 $ | $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -72,7 +72,7 @@ if (isset($_POST['updateclass']))
// $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","User class change",str_replace("\n","<br />",$message),FALSE,LOG_TO_ROLLING); // $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","User class change",str_replace("\n","<br />",$message),FALSE,LOG_TO_ROLLING);
sendemail($send_to, $subject, $message); sendemail($send_to, $subject, $message);
} }
$admin_log->log_event('LAN_ADMIN_LOG_016',str_replace(array('--UID--','--CLASSES--'),array($id,$svar),UCSLAN_11),E_LOG_INFORMATIVE,'USET_14'); $admin_log->log_event('USET_14',str_replace(array('--UID--','--CLASSES--'),array($id,$svar),UCSLAN_11),E_LOG_INFORMATIVE);
header("location: ".$_POST['adminreturn']); header("location: ".$_POST['adminreturn']);

View File

@@ -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/userclass2.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/userclass2.php,v $
| $Revision: 1.7 $ | $Revision: 1.8 $
| $Date: 2008-01-13 17:47:27 $ | $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -77,7 +77,7 @@ if (isset($_POST['set_initial_classes']))
{ {
$pref['initial_user_classes'] = $newval; $pref['initial_user_classes'] = $newval;
save_prefs(); save_prefs();
userclass2_adminlog("AL_UC_LAN_05","New: {$newval}, Old: {$temp}, Stage: ".$pref['init_class_stage'],5); userclass2_adminlog("05","New: {$newval}, Old: {$temp}, Stage: ".$pref['init_class_stage']);
$message = UCSLAN_41; $message = UCSLAN_41;
} }
else else
@@ -103,7 +103,7 @@ if (isset($_POST['delete']))
if ($e_userclass->delete_class($class_id) !== FALSE) if ($e_userclass->delete_class($class_id) !== FALSE)
{ {
// $sql->db_Delete('userclass_classes', "userclass_id='".$class_id."' "); // $sql->db_Delete('userclass_classes', "userclass_id='".$class_id."' ");
userclass2_adminlog("AL_UC_LAN_02","ID:{$class_id} (".$e_userclass->uc_get_classname($class_id).")",2); userclass2_adminlog("02","ID:{$class_id} (".$e_userclass->uc_get_classname($class_id).")");
if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')")) if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
{ // Delete existing users from class { // Delete existing users from class
while ($row = $sql->db_Fetch()) while ($row = $sql->db_Fetch())
@@ -153,7 +153,7 @@ if (isset($_POST['updateclass']) || isset($_POST['createclass']))
check_allowed($_POST['userclass_id']); check_allowed($_POST['userclass_id']);
$class_record['userclass_id'] = intval($_POST['userclass_id']); $class_record['userclass_id'] = intval($_POST['userclass_id']);
$e_userclass->save_edited_class($class_record); $e_userclass->save_edited_class($class_record);
userclass2_adminlog("AL_UC_LAN_03","ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")",3); userclass2_adminlog("03","ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")");
$do_tree = TRUE; $do_tree = TRUE;
$message = UCSLAN_5; $message = UCSLAN_5;
} }
@@ -172,7 +172,7 @@ if (isset($_POST['updateclass']) || isset($_POST['createclass']))
{ {
$class_record['userclass_id'] = $i; $class_record['userclass_id'] = $i;
$e_userclass->add_new_class($class_record); $e_userclass->add_new_class($class_record);
userclass2_adminlog("AL_UC_LAN_01","ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")",1); userclass2_adminlog("01","ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")");
$do_tree = TRUE; $do_tree = TRUE;
} }
$message = UCSLAN_6; $message = UCSLAN_6;
@@ -648,7 +648,7 @@ $ns->tablerender(UCSLAN_21, $text);
} }
$uclass->class_remove($class_id, $uidList); $uclass->class_remove($class_id, $uidList);
$message = UCSLAN_1; $message = UCSLAN_1;
userclass2_adminlog("AL_UC_LAN_06","ID:{$class_id} (".$e_userclass->uc_get_classname($class_id).")",6); userclass2_adminlog("06","ID:{$class_id} (".$e_userclass->uc_get_classname($class_id).")");
} }
} }
elseif($params) elseif($params)
@@ -675,7 +675,7 @@ $ns->tablerender(UCSLAN_21, $text);
} }
$uclass->class_add($class_id, $uidList); $uclass->class_add($class_id, $uidList);
} }
userclass2_adminlog("AL_UC_LAN_04","ID:{$class_id} (".$e_userclass->uc_get_classname($class_id).")",4); userclass2_adminlog("04","ID:{$class_id} (".$e_userclass->uc_get_classname($class_id).")");
} }
@@ -847,11 +847,12 @@ if(isset($_POST['class_members_edit']))
// Log event to admin log // Log event to admin log
function userclass2_adminlog($title, $woffle,$msg_num='00') function userclass2_adminlog($msg_num='00', $woffle='')
{ {
global $pref, $admin_log; global $pref, $admin_log;
if (!varset($pref['admin_log_log']['admin_userclass'],0)) return; if (!varset($pref['admin_log_log']['admin_userclass'],0)) return;
$admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'UCLASS_'.$msg_num); // $admin_log->log_event($title,$woffle,E_LOG_INFORMATIVE,'UCLASS_'.$msg_num);
$admin_log->log_event('UCLASS_'.$msg_num,$woffle,E_LOG_INFORMATIVE,'');
} }

View File

@@ -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/users.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
| $Revision: 1.12 $ | $Revision: 1.13 $
| $Date: 2008-01-02 20:14:05 $ | $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -150,7 +150,7 @@ if (isset($_POST['update_options']))
$pref['memberlist_access'] = $_POST['memberlist_access']; $pref['memberlist_access'] = $_POST['memberlist_access'];
save_prefs(); save_prefs();
unset($_POST['update_options']); // So we don't log it unset($_POST['update_options']); // So we don't log it
$admin_log->log_event('LAN_ADMIN_LOG_005',$tp->toDB(implode('; ',$_POST)),E_LOG_INFORMATIVE,'USET_03'); $admin_log->log_event('USET_03',$tp->toDB(implode('; ',$_POST)),E_LOG_INFORMATIVE);
$user->show_message(USRLAN_1); $user->show_message(USRLAN_1);
} }
@@ -171,7 +171,7 @@ if (isset($_POST['prune']))
$sql->db_Delete("user", "user_id='{$u['user_id']}' "); $sql->db_Delete("user", "user_id='{$u['user_id']}' ");
$sql->db_Delete("user_extended", "user_extended_id='{$u['user_id']}' "); $sql->db_Delete("user_extended", "user_extended_id='{$u['user_id']}' ");
} }
$admin_log->log_event('LAN_ADMIN_LOG_006',str_replace(array('--COUNT--','--TYPE--'),array(count($uList),$bantype),USRLAN_160),E_LOG_INFORMATIVE,'USET_04'); $admin_log->log_event('USET_04',str_replace(array('--COUNT--','--TYPE--'),array(count($uList),$bantype),USRLAN_160),E_LOG_INFORMATIVE);
} }
$ns->tablerender(USRLAN_57, "<div style='text-align:center'><b>".$text."</b></div>"); $ns->tablerender(USRLAN_57, "<div style='text-align:center'><b>".$text."</b></div>");
unset($text); unset($text);
@@ -277,7 +277,7 @@ if (isset($_POST['adduser']))
if (admin_update($sql -> db_Insert("user", $user_data), 'insert', USRLAN_70)) if (admin_update($sql -> db_Insert("user", $user_data), 'insert', USRLAN_70))
{ {
// Add to admin log // Add to admin log
$admin_log->log_event('LAN_ADMIN_LOG_004',"UName: {$user_data['user_name']}; Email: {$user_data['user_email']}",E_LOG_INFORMATIVE,'USET_02'); $admin_log->log_event('USET_02',"UName: {$user_data['user_name']}; Email: {$user_data['user_email']}",E_LOG_INFORMATIVE);
// Add to user audit trail // Add to user audit trail
$admin_log->user_audit(USER_AUDIT_ADD_ADMIN,$user_data, 0,$user_data['user_loginname']); $admin_log->user_audit(USER_AUDIT_ADD_ADMIN,$user_data, 0,$user_data['user_loginname']);
if (isset($_POST['sendconfemail'])) if (isset($_POST['sendconfemail']))
@@ -329,7 +329,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "ban")
{ {
if($sql->db_Update("user", "user_ban='1' WHERE user_id='".$_POST['userid']."' ")) if($sql->db_Update("user", "user_ban='1' WHERE user_id='".$_POST['userid']."' "))
{ {
$admin_log->log_event('LAN_ADMIN_LOG_007',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_161),E_LOG_INFORMATIVE,'USET_05'); $admin_log->log_event('USET_05',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_161),E_LOG_INFORMATIVE);
$user->show_message(USRLAN_8); $user->show_message(USRLAN_8);
} }
if(trim($row['user_ip']) == "") if(trim($row['user_ip']) == "")
@@ -367,7 +367,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "unban")
$row = $sql->db_Fetch(); $row = $sql->db_Fetch();
$sql->db_Update("user", "user_ban='0' WHERE user_id='".$_POST['userid']."' "); $sql->db_Update("user", "user_ban='0' WHERE user_id='".$_POST['userid']."' ");
$sql -> db_Delete("banlist", " banlist_ip='{$row['user_ip']}' "); $sql -> db_Delete("banlist", " banlist_ip='{$row['user_ip']}' ");
$admin_log->log_event('LAN_ADMIN_LOG_008',str_replace(array('--UID--','--NAME--'),array($_POST['userid'],$row['user_name']),USRLAN_162),E_LOG_INFORMATIVE,'USET_06'); $admin_log->log_event('USET_06',str_replace(array('--UID--','--NAME--'),array($_POST['userid'],$row['user_name']),USRLAN_162),E_LOG_INFORMATIVE);
$user->show_message(USRLAN_9); $user->show_message(USRLAN_9);
$action = "main"; $action = "main";
if(!$sub_action){$sub_action = "user_id"; } if(!$sub_action){$sub_action = "user_id"; }
@@ -426,7 +426,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == 'deluser')
if ($sql->db_Delete("user", "user_id='".$_POST['userid']."' AND user_perms != '0' AND user_perms != '0.'")) if ($sql->db_Delete("user", "user_id='".$_POST['userid']."' AND user_perms != '0' AND user_perms != '0.'"))
{ {
$sql->db_Delete("user_extended", "user_extended_id='".$_POST['userid']."' "); $sql->db_Delete("user_extended", "user_extended_id='".$_POST['userid']."' ");
$admin_log->log_event('LAN_ADMIN_LOG_009',str_replace('--UID--',$_POST['userid'],USRLAN_163),E_LOG_INFORMATIVE,'USET_07'); $admin_log->log_event('USET_07',str_replace('--UID--',$_POST['userid'],USRLAN_163),E_LOG_INFORMATIVE);
$user->show_message(USRLAN_10); $user->show_message(USRLAN_10);
} }
if(!$sub_action){ $sub_action = "user_id"; } if(!$sub_action){ $sub_action = "user_id"; }
@@ -464,7 +464,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "admin" && getperms('
$sql->db_Select("user", "user_id, user_name", "user_id='".$_POST['userid']."'"); $sql->db_Select("user", "user_id, user_name", "user_id='".$_POST['userid']."'");
$row = $sql->db_Fetch(); $row = $sql->db_Fetch();
$sql->db_Update("user", "user_admin='1' WHERE user_id='".$_POST['userid']."' "); $sql->db_Update("user", "user_admin='1' WHERE user_id='".$_POST['userid']."' ");
$admin_log->log_event('LAN_ADMIN_LOG_010',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_164),E_LOG_INFORMATIVE,'USET_08'); $admin_log->log_event('USET_08',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_164),E_LOG_INFORMATIVE);
$user->show_message($row['user_name']." ".USRLAN_3." <a href='".e_ADMIN."administrator.php?edit.{$row['user_id']}'>".USRLAN_4."</a>"); $user->show_message($row['user_name']." ".USRLAN_3." <a href='".e_ADMIN."administrator.php?edit.{$row['user_id']}'>".USRLAN_4."</a>");
$action = "main"; $action = "main";
if(!$sub_action){ $sub_action = "user_id"; } if(!$sub_action){ $sub_action = "user_id"; }
@@ -488,7 +488,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "unadmin" && getperms
else else
{ {
$sql->db_Update("user", "user_admin='0', user_perms='' WHERE user_id='".$_POST['userid']."'"); $sql->db_Update("user", "user_admin='0', user_perms='' WHERE user_id='".$_POST['userid']."'");
$admin_log->log_event('LAN_ADMIN_LOG_011',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_165),E_LOG_INFORMATIVE,'USET_09'); $admin_log->log_event('USET_09',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_165),E_LOG_INFORMATIVE);
$user->show_message($user_name." ".USRLAN_6); $user->show_message($user_name." ".USRLAN_6);
$action = "main"; $action = "main";
if(!$sub_action){ $sub_action = "user_id"; } if(!$sub_action){ $sub_action = "user_id"; }
@@ -520,7 +520,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "verify")
} }
} }
$sql->db_Update("user", "user_ban='0'{$init_classes} WHERE user_id='".$uid."' "); $sql->db_Update("user", "user_ban='0'{$init_classes} WHERE user_id='".$uid."' ");
$admin_log->log_event('LAN_ADMIN_LOG_012',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_166),E_LOG_INFORMATIVE,'USET_10'); $admin_log->log_event('USET_10',str_replace(array('--UID--','--NAME--'),array($row['user_id'],$row['user_name']),USRLAN_166),E_LOG_INFORMATIVE);
// $e_event->trigger("userveri", $row); // We do this from signup.php - should we do it here? // $e_event->trigger("userveri", $row); // We do this from signup.php - should we do it here?
$user->show_message(USRLAN_86); $user->show_message(USRLAN_86);
@@ -1220,7 +1220,7 @@ class users
if(sendemail($email, LAN_404." ".SITENAME, $message)) if(sendemail($email, LAN_404." ".SITENAME, $message))
{ {
// echo str_replace("\n","<br>",$message); // echo str_replace("\n","<br>",$message);
$admin_log->log_event('LAN_ADMIN_LOG_013',str_replace(array('--ID--','--NAME--','--EMAIL--'),array($id,$name,$email),USRLAN_167),E_LOG_INFORMATIVE,'USET_11'); $admin_log->log_event('USET_11',str_replace(array('--ID--','--NAME--','--EMAIL--'),array($id,$name,$email),USRLAN_167),E_LOG_INFORMATIVE);
$this->show_message(USRLAN_140.": <a href='mailto:".$email."?body=".$return_address."' title=\"".DUSRLAN_7."\" >".$name."</a> (".$row['user_language'].") "); $this->show_message(USRLAN_140.": <a href='mailto:".$email."?body=".$return_address."' title=\"".DUSRLAN_7."\" >".$name."</a> (".$row['user_language'].") ");
} }
else else
@@ -1268,7 +1268,7 @@ class users
} }
if ($count) if ($count)
{ {
$admin_log->log_event('LAN_ADMIN_LOG_014',str_replace('--COUNT--',$count,USRLAN_168),E_LOG_INFORMATIVE,'USET_12'); $admin_log->log_event('USET_12',str_replace('--COUNT--',$count,USRLAN_168),E_LOG_INFORMATIVE);
} }
} }
@@ -1409,7 +1409,7 @@ class users
if ($del_count) if ($del_count)
{ {
$admin_log->log_event('LAN_ADMIN_LOG_015',str_replace('--COUNT--',$del_count,USRLAN_169),E_LOG_INFORMATIVE,'USET_13'); $admin_log->log_event('USET_13',str_replace('--COUNT--',$del_count,USRLAN_169),E_LOG_INFORMATIVE);
} }

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/admin_log_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/admin_log_class.php,v $
| $Revision: 1.8 $ | $Revision: 1.9 $
| $Date: 2008-01-01 21:26:16 $ | $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $ | $Author: e107steved $
To do: To do:
@@ -91,14 +91,26 @@ class e_admin_log {
// Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point. // Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point.
// ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03') // ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03')
// We also log everything (unlike 0.7, where admin log and debug stuff were all mixed up together) // We also log everything (unlike 0.7, where admin log and debug stuff were all mixed up together)
function log_event($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE, $eventcode='ADMIN') function log_event($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE, $event_code='')
{ {
global $e107, $tp; global $e107, $tp;
if ($event_code == '')
{
if (strlen($event_title) <= 10)
{ // Assume the title is actually a reference to the event
$event_code = $event_title;
$event_title = 'LAN_AL_'.$event_title;
}
else
{
$event_code = 'ADMIN';
}
}
if($this->_options['backtrace'] == true) if($this->_options['backtrace'] == true)
{ {
$event_detail .= "\n\n".debug_backtrace(); $event_detail .= "\n\n".debug_backtrace();
} }
$this->e_log_event($event_type,-1,$eventcode,$event_title,$event_detail,FALSE,LOG_TO_ADMIN); $this->e_log_event($event_type,-1,$event_code,$event_title,$event_detail,FALSE,LOG_TO_ADMIN);
} }
/* /*

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
| $Revision: 1.14 $ | $Revision: 1.15 $
| $Date: 2008-01-16 10:55:42 $ | $Date: 2008-01-16 22:18:20 $
| $Author: e107coders $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -203,7 +203,7 @@ class e107{
// If return permitted, will never display a message for a banned user; otherwise will display any message then exit // If return permitted, will never display a message for a banned user; otherwise will display any message then exit
function check_ban($query,$show_error=TRUE, $do_return = FALSE) function check_ban($query,$show_error=TRUE, $do_return = FALSE)
{ {
global $sql, $tp, $pref, $admin_log; global $sql, $tp, $pref, $admin_log, $e107;
// $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","Check for Ban",$query,FALSE,LOG_TO_ROLLING); // $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"DBG","Check for Ban",$query,FALSE,LOG_TO_ROLLING);
if ($sql->db_Select('banlist','*',$query.' ORDER BY `banlist_bantype` DESC')) if ($sql->db_Select('banlist','*',$query.' ORDER BY `banlist_bantype` DESC'))
{ {
@@ -251,7 +251,7 @@ class e107{
// Returns FALSE if ban not accepted (i.e. because on whitelist, or invalid IP specified) // Returns FALSE if ban not accepted (i.e. because on whitelist, or invalid IP specified)
function add_ban($bantype,$ban_message='',$ban_ip='',$ban_user = 0,$ban_notes='') function add_ban($bantype,$ban_message='',$ban_ip='',$ban_user = 0,$ban_notes='')
{ {
global $sql, $pref; global $sql, $pref, $e107;
if (!$ban_message) $ban_message = 'No explanation given'; if (!$ban_message) $ban_message = 'No explanation given';
if (!$ban_ip) $ban_ip = $this->getip(); if (!$ban_ip) $ban_ip = $this->getip();
$ban_ip = preg_replace("/[^\w@\.]*/",'',urldecode($ban_ip)); // Make sure no special characters $ban_ip = preg_replace("/[^\w@\.]*/",'',urldecode($ban_ip)); // Make sure no special characters
@@ -259,12 +259,12 @@ class e107{
// See if the address is in the whitelist // See if the address is in the whitelist
if ($sql->db_Select('banlist','*','`banlist_bantype` >= '.BAN_TYPE_WHITELIST)) if ($sql->db_Select('banlist','*','`banlist_bantype` >= '.BAN_TYPE_WHITELIST))
{ // Got a whitelist entry for this { // Got a whitelist entry for this
$admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"BANLIST_11",'AL_BAN_LAN_11',$ban_ip,FALSE,LOG_TO_ROLLING); $admin_log->e_log_event(4,__FILE__."|".__FUNCTION__."@".__LINE__,"BANLIST_11",'LAN_AL_BANLIST_11',$ban_ip,FALSE,LOG_TO_ROLLING);
return FALSE; return FALSE;
} }
if (varsettrue($pref['enable_rdns_on_ban'])) if (varsettrue($pref['enable_rdns_on_ban']))
{ {
$ban_message .= 'Host: '.$e107->get_host_name(getenv('REMOTE_ADDR')); $ban_message .= 'Host: '.$e107->get_host_name($ban_ip);
} }
// Add using an array - handles DB changes better // Add using an array - handles DB changes better
$sql->db_Insert('banlist',array('banlist_ip' => $ban_ip, 'banlist_bantype' => $bantype, 'banlist_datestamp' => time(), $sql->db_Insert('banlist',array('banlist_ip' => $ban_ip, 'banlist_bantype' => $bantype, 'banlist_datestamp' => time(),

View File

@@ -1,6 +1,6 @@
<?php <?php
// e107 Language File. // e107 Language File.
// $Id: lan_log_messages.php,v 1.7 2008-01-01 21:26:23 e107steved Exp $ // $Id: lan_log_messages.php,v 1.8 2008-01-16 22:18:27 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,50 +36,50 @@ define('LAN_AUDIT_LOG_020', 'User added by admin');
// Admin log events // Admin log events
//----------------- //-----------------
define('LAN_ADMIN_LOG_001', 'Admin edited user data');
define('LAN_ADMIN_LOG_002', 'Admin log - delete old data'); define('LAN_ADMIN_LOG_002', 'Admin log - delete old data');
define('LAN_ADMIN_LOG_003', 'User Audit log - delete old data'); define('LAN_ADMIN_LOG_003', 'User Audit log - delete old data');
define('LAN_ADMIN_LOG_004', 'User added by Admin');
define('LAN_ADMIN_LOG_005', 'User options updated'); // User edits
define('LAN_ADMIN_LOG_006', 'Users pruned'); //-----------
define('LAN_ADMIN_LOG_007', 'User banned'); define('LAN_AL_USET_01', 'Admin edited user data');
define('LAN_ADMIN_LOG_008', 'User unbanned'); define('LAN_AL_USET_02', 'User added by Admin');
define('LAN_ADMIN_LOG_009', 'User deleted'); define('LAN_AL_USET_03', 'User options updated');
define('LAN_ADMIN_LOG_010', 'User made admin'); define('LAN_AL_USET_04', 'Users pruned');
define('LAN_ADMIN_LOG_011', 'User admin status revoked'); define('LAN_AL_USET_05', 'User banned');
define('LAN_ADMIN_LOG_012', 'User approved'); define('LAN_AL_USET_06', 'User unbanned');
define('LAN_ADMIN_LOG_013', 'Resend validation email'); define('LAN_AL_USET_07', 'User deleted');
define('LAN_ADMIN_LOG_014', 'Resend all validation emails'); define('LAN_AL_USET_08', 'User made admin');
define('LAN_ADMIN_LOG_015', 'Bounced emails deleted'); define('LAN_AL_USET_09', 'User admin status revoked');
define('LAN_ADMIN_LOG_016', 'Class membership updated'); define('LAN_AL_USET_10', 'User approved');
define('LAN_ADMIN_LOG_017', ''); define('LAN_AL_USET_11', 'Resend validation email');
define('LAN_ADMIN_LOG_018', ''); define('LAN_AL_USET_12', 'Resend all validation emails');
define('LAN_ADMIN_LOG_019', ''); define('LAN_AL_USET_13', 'Bounced emails deleted');
define('LAN_AL_USET_14', 'Class membership updated');
// Userclass events // Userclass events
//------------------ //------------------
define('AL_UC_LAN_00',"Unknown userclass-related event"); define('LAN_AL_UCLASS_00',"Unknown userclass-related event");
define('AL_UC_LAN_01',"Userclass created"); define('LAN_AL_UCLASS_01',"Userclass created");
define('AL_UC_LAN_02',"Userclass deleted"); define('LAN_AL_UCLASS_02',"Userclass deleted");
define('AL_UC_LAN_03',"Userclass edited"); define('LAN_AL_UCLASS_03',"Userclass edited");
define('AL_UC_LAN_04',"Class membership updated"); define('LAN_AL_UCLASS_04',"Class membership updated");
define('AL_UC_LAN_05',"Initial userclass settings edited"); define('LAN_AL_UCLASS_05',"Initial userclass settings edited");
define('AL_UC_LAN_06',"Class membership emptied"); define('LAN_AL_UCLASS_06',"Class membership emptied");
// Banlist events // Banlist events
//---------------- //----------------
define('AL_BAN_LAN_00','Unknown ban-related event'); define('LAN_AL_BANLIST_00','Unknown ban-related event');
define('AL_BAN_LAN_01','Manual ban added'); define('LAN_AL_BANLIST_01','Manual ban added');
define('AL_BAN_LAN_02','Ban deleted'); define('LAN_AL_BANLIST_02','Ban deleted');
define('AL_BAN_LAN_03','Ban time changed'); define('LAN_AL_BANLIST_03','Ban time changed');
define('AL_BAN_LAN_04','Whitelist entry added'); define('LAN_AL_BANLIST_04','Whitelist entry added');
define('AL_BAN_LAN_05','Whitelist entry deleted'); define('LAN_AL_BANLIST_05','Whitelist entry deleted');
define('AL_BAN_LAN_06','Banlist exported'); define('LAN_AL_BANLIST_06','Banlist exported');
define('AL_BAN_LAN_07','Banlist imported'); define('LAN_AL_BANLIST_07','Banlist imported');
define('AL_BAN_LAN_08','Banlist options updated'); define('LAN_AL_BANLIST_08','Banlist options updated');
define('AL_BAN_LAN_09','Banlist entry edited'); define('LAN_AL_BANLIST_09','Banlist entry edited');
define('AL_BAN_LAN_10','Whitelist entry edited'); define('LAN_AL_BANLIST_10','Whitelist entry edited');
define('AL_BAN_LAN_11','Whitelist hit for ban entry'); define('LAN_AL_BANLIST_11','Whitelist hit for ban entry');
// Rolling log events // Rolling log events

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/usersettings.php,v $ | $Source: /cvs_backup/e107_0.8/usersettings.php,v $
| $Revision: 1.21 $ | $Revision: 1.22 $
| $Date: 2008-01-15 21:57:17 $ | $Date: 2008-01-16 22:18:20 $
| $Author: e107steved $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
@@ -524,7 +524,7 @@ if (isset($_POST['updatesettings']))
$log_action = ''; $log_action = '';
if ($_uid) if ($_uid)
{ // Its an admin changing someone elses data - make an admin log entry here { // Its an admin changing someone elses data - make an admin log entry here
$admin_log->log_event('LAN_ADMIN_LOG_001',"UID: {$udata['user_id']}. UName: {$udata['user_name']}",E_LOG_INFORMATIVE,'USET_01'); $admin_log->log_event('USET_01',"UID: {$udata['user_id']}. UName: {$udata['user_name']}",E_LOG_INFORMATIVE);
// Check against the class of the target user, not the admin! // Check against the class of the target user, not the admin!
if (!check_class(varset($pref['user_audit_class'],''),$udata['user_class'])) $user_logging_opts = array(); if (!check_class(varset($pref['user_audit_class'],''),$udata['user_class'])) $user_logging_opts = array();
} }