mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-07 13:24:22 +00:00
fix: logging works, tech log link added to Admin
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
## Copyright: TravianZ (c) 2010-2014. All rights reserved. ##
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
if(!isset($_SESSION)) session_start();
|
||||
if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!");
|
||||
include_once("../../Database.php");
|
||||
@@ -25,7 +24,7 @@ for($i=1; $i<9; $i++) {
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."abdata SET ".$atech.$btech." WHERE vref = $id";
|
||||
$database->query($q);
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop anmount in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop upgrade levels in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=village&did=".$id."&ab");
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ for($i=1; $i<11; $i++) {
|
||||
}
|
||||
$q = "UPDATE ".TB_PREFIX."units SET ".$units." WHERE vref = ".(int) $id;
|
||||
$database->query($q);
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop anmount in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".(int) $_SESSION['id'].",'Changed troop amounts in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=village&did=".$id."&d");
|
||||
?>
|
||||
@@ -126,7 +126,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Admin Info',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Extra server settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed Log Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed NewsBox Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed PLUS setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed PLUS Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ $fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: GameEngine\con
|
||||
fwrite($fh, $text);
|
||||
fclose($fh);
|
||||
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed server setting',".time().")");
|
||||
$database->query("Insert into ".TB_PREFIX."admin_log values (0,".$id.",'Changed General Server Settings',".time().")");
|
||||
|
||||
header("Location: ../../../Admin/admin.php?p=config");
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Logging {
|
||||
$log .= "access village $ref";
|
||||
break;
|
||||
}
|
||||
$q = "Insert into ".TB_PREFIX."illegal_log values (0,$uid,'$log')";
|
||||
$q = "Insert into ".TB_PREFIX."illegal_log SET user = $uid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ class Logging {
|
||||
global $database;
|
||||
list($id,$ip) = $database->escape_input((int) $id,$ip);
|
||||
if(LOG_LOGIN) {
|
||||
$q = "Insert into ".TB_PREFIX."login_log values (0,$id,'$ip')";
|
||||
$q = "Insert into ".TB_PREFIX."login_log SET uid = $id, ip = '".$_SERVER['REMOTE_ADDR']."'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -45,8 +45,8 @@ class Logging {
|
||||
else {
|
||||
$log = "Start Upgrade of ";
|
||||
}
|
||||
$log .= $building." at level ".$level;
|
||||
$q = "Insert into ".TB_PREFIX."build_log values (0,$wid,'$log')";
|
||||
$log .= $building." to level ".$level;
|
||||
$q = "Insert into ".TB_PREFIX."build_log SET wid = $wid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class Logging {
|
||||
list($wid,$tech,$level) = $database->escape_input((int) $wid,$tech,$level);
|
||||
if(LOG_TECH) {
|
||||
$log = "Upgrading of tech ".$tech." to level ".$level;
|
||||
$q = "Insert into ".TB_PREFIX."tech_log values (0,$wid,'$log')";
|
||||
$q = "Insert into ".TB_PREFIX."tech_log SET wid = $wid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class Logging {
|
||||
else if($type == 2) {
|
||||
$log = "Traded resource between ".$wid." and ".$data[0]." market ref is ".$data[1];
|
||||
}
|
||||
$q = "Insert into ".TB_PREFIX."market_log values (0,$wid,'$log')";
|
||||
$q = "Insert into ".TB_PREFIX."market_log SET wid = $wid, log = '$log'";
|
||||
$database->query($q);
|
||||
}
|
||||
}
|
||||
@@ -107,8 +107,8 @@ class Logging {
|
||||
//fwrite($fh,"\n".date("Y-m-d H:i:s")." : ".$time.",".$uid.",".$debug_info."\n");
|
||||
//fclose($fh);
|
||||
|
||||
$q = "INSERT INTO ".TB_PREFIX."debug_log (time,uid,debug_info) VALUES ($time,$uid,'$debug_info')";
|
||||
$database->query($q);
|
||||
//$q = "INSERT INTO ".TB_PREFIX."debug_log (time,uid,debug_info) VALUES ($time,$uid,'$debug_info')";
|
||||
//$database->query($q);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user