1
0
mirror of https://github.com/e107inc/e107.git synced 2025-09-03 11:22:40 +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).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/banlist.php,v $
| $Revision: 1.8 $
| $Date: 2008-01-13 10:51:34 $
| $Revision: 1.9 $
| $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -67,7 +67,7 @@ if (isset($_POST['update_ban_prefs']))
$pref['ban_durations'][$i] = intval(varset($_POST['ban_time'][$i],0));
}
save_prefs();
banlist_adminlog("AL_BAN_LAN_08","",8);
banlist_adminlog('08',"");
$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');
if ($_POST['entry_intent'] == 'add')
{
banlist_adminlog("AL_BAN_LAN_01",$new_vals['banlist_ip'],1);
banlist_adminlog('01',$new_vals['banlist_ip']);
}
else
{
banlist_adminlog("AL_BAN_LAN_04",$new_vals['banlist_ip'],4);
banlist_adminlog('04',$new_vals['banlist_ip']);
}
}
else
@@ -131,11 +131,11 @@ if (isset($_POST['ban_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);
banlist_adminlog("09",$new_vals['banlist_ip']);
}
else
{
banlist_adminlog("AL_BAN_LAN_10",$new_vals['banlist_ip'],10);
banlist_adminlog("10",$new_vals['banlist_ip']);
}
}
unset($ban_ip);
@@ -151,12 +151,12 @@ if (($action == "remove" || $action == "whremove") && isset($_POST['ban_secure']
if ($action == "remove")
{
$action = 'list';
banlist_adminlog("AL_BAN_LAN_02",$sub_action,2);
banlist_adminlog("02",$sub_action);
}
else
{
$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;
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';
}
@@ -493,7 +493,7 @@ switch ($action)
intval(varset($_POST['ban_over_expiry'],0)),
$separator_char[intval(varset($_POST['ban_separator'],1))],
$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
function banlist_adminlog($title, $woffle,$msg_num='00')
function banlist_adminlog($msg_num='00', $woffle='')
{
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);
// $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).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/banlist_export.php,v $
| $Revision: 1.2 $
| $Date: 2007-12-23 21:15:48 $
| $Revision: 1.3 $
| $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -73,7 +73,7 @@ if ($error_string = do_export($filename, $type_list, $format_array, $use_separat
// Need to report an error here
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 = '"')
@@ -136,11 +136,12 @@ function do_export($filename, $type_list='',$format_array, $sep = ',', $quot = '
}
// Log event to admin log
function banlist_adminlog($title, $woffle,$msg_num='00')
function banlist_adminlog($msg_num='00', $woffle='')
{
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);
// $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).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/userclass.php,v $
| $Revision: 1.2 $
| $Date: 2008-01-01 18:18:05 $
| $Revision: 1.3 $
| $Date: 2008-01-16 22:18:19 $
| $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);
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']);

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/userclass2.php,v $
| $Revision: 1.7 $
| $Date: 2008-01-13 17:47:27 $
| $Revision: 1.8 $
| $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -77,7 +77,7 @@ if (isset($_POST['set_initial_classes']))
{
$pref['initial_user_classes'] = $newval;
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;
}
else
@@ -103,7 +103,7 @@ if (isset($_POST['delete']))
if ($e_userclass->delete_class($class_id) !== FALSE)
{
// $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}$')"))
{ // Delete existing users from class
while ($row = $sql->db_Fetch())
@@ -153,7 +153,7 @@ if (isset($_POST['updateclass']) || isset($_POST['createclass']))
check_allowed($_POST['userclass_id']);
$class_record['userclass_id'] = intval($_POST['userclass_id']);
$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;
$message = UCSLAN_5;
}
@@ -172,7 +172,7 @@ if (isset($_POST['updateclass']) || isset($_POST['createclass']))
{
$class_record['userclass_id'] = $i;
$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;
}
$message = UCSLAN_6;
@@ -648,7 +648,7 @@ $ns->tablerender(UCSLAN_21, $text);
}
$uclass->class_remove($class_id, $uidList);
$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)
@@ -675,7 +675,7 @@ $ns->tablerender(UCSLAN_21, $text);
}
$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
function userclass2_adminlog($title, $woffle,$msg_num='00')
function userclass2_adminlog($msg_num='00', $woffle='')
{
global $pref, $admin_log;
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).
|
| $Source: /cvs_backup/e107_0.8/e107_admin/users.php,v $
| $Revision: 1.12 $
| $Date: 2008-01-02 20:14:05 $
| $Revision: 1.13 $
| $Date: 2008-01-16 22:18:19 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -150,7 +150,7 @@ if (isset($_POST['update_options']))
$pref['memberlist_access'] = $_POST['memberlist_access'];
save_prefs();
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);
}
@@ -171,7 +171,7 @@ if (isset($_POST['prune']))
$sql->db_Delete("user", "user_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>");
unset($text);
@@ -277,7 +277,7 @@ if (isset($_POST['adduser']))
if (admin_update($sql -> db_Insert("user", $user_data), 'insert', USRLAN_70))
{
// 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
$admin_log->user_audit(USER_AUDIT_ADD_ADMIN,$user_data, 0,$user_data['user_loginname']);
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']."' "))
{
$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);
}
if(trim($row['user_ip']) == "")
@@ -367,7 +367,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "unban")
$row = $sql->db_Fetch();
$sql->db_Update("user", "user_ban='0' WHERE user_id='".$_POST['userid']."' ");
$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);
$action = "main";
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.'"))
{
$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);
}
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']."'");
$row = $sql->db_Fetch();
$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>");
$action = "main";
if(!$sub_action){ $sub_action = "user_id"; }
@@ -488,7 +488,7 @@ if (isset($_POST['useraction']) && $_POST['useraction'] == "unadmin" && getperms
else
{
$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);
$action = "main";
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."' ");
$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?
$user->show_message(USRLAN_86);
@@ -1220,7 +1220,7 @@ class users
if(sendemail($email, LAN_404." ".SITENAME, $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'].") ");
}
else
@@ -1268,7 +1268,7 @@ class users
}
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)
{
$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);
}