mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Trying to fix this monstrosity #3
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#################################################################################
|
||||
|
||||
session_start();
|
||||
include_once("../GameEngine/config.php");
|
||||
include_once("../GameEngine/Database.php");
|
||||
include_once ("../GameEngine/Lang/" . LANG . ".php");
|
||||
include_once("../GameEngine/Admin/database.php");
|
||||
|
||||
@@ -36,14 +36,14 @@ class adm_DB {
|
||||
|
||||
function Login($username,$password){
|
||||
$q = "SELECT password FROM ".TB_PREFIX."users where username = '$username' and access >= ".MULTIHUNTER;
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
$result = mysqli_query($this->connection,$q);
|
||||
$dbarray = mysqli_fetch_array($result);
|
||||
if($dbarray['password'] == md5($password)) {
|
||||
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,'X','$username logged in (IP: <b>".$_SERVER['REMOTE_ADDR']."</b>)',".time().")");
|
||||
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,'X','$username logged in (IP: <b>".$_SERVER['REMOTE_ADDR']."</b>)',".time().")");
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,'X','<font color=\'red\'><b>IP: ".$_SERVER['REMOTE_ADDR']." tried to log in with username <u> $username</u> but access was denied!</font></b>',".time().")");
|
||||
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,'X','<font color=\'red\'><b>IP: ".$_SERVER['REMOTE_ADDR']." tried to log in with username <u> $username</u> but access was denied!</font></b>',".time().")");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class adm_DB {
|
||||
}
|
||||
}
|
||||
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
|
||||
mysqli_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
}
|
||||
|
||||
function buildingPOP($f,$lvl){
|
||||
@@ -115,7 +115,7 @@ class adm_DB {
|
||||
|
||||
function getWref($x,$y) {
|
||||
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
|
||||
$result = mysqli_query($q, $this->connection);
|
||||
$result = mysqli_query($this->connection,$q);
|
||||
$r = mysqli_fetch_array($result);
|
||||
return $r['id'];
|
||||
}
|
||||
@@ -165,16 +165,16 @@ class adm_DB {
|
||||
if($post['clean_ware']){
|
||||
$time = time();
|
||||
$q = "UPDATE ".TB_PREFIX."vdata SET `wood` = '0', `clay` = '0', `iron` = '0', `crop` = '0', `lastupdate` = '$time' WHERE wref = $vid;";
|
||||
mysqli_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
}
|
||||
}
|
||||
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Punished user: <a href=\'admin.php?p=player&uid=".$post['uid']."\'>".$post['uid']."</a> with <b>-".$post['punish']."%</b> population',".time().")");
|
||||
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Punished user: <a href=\'admin.php?p=player&uid=".$post['uid']."\'>".$post['uid']."</a> with <b>-".$post['punish']."%</b> population',".time().")");
|
||||
}
|
||||
|
||||
function PunishBuilding($vid,$proc,$pop){
|
||||
global $database;
|
||||
$q = "UPDATE ".TB_PREFIX."vdata set pop = $pop where wref = $vid;";
|
||||
mysqli_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
$fdata = $database->getResourceLevel($vid);
|
||||
for ($i = 1; $i <= 40; $i++) {
|
||||
if($fdata['f'.$i]>1){
|
||||
@@ -194,7 +194,7 @@ class adm_DB {
|
||||
|
||||
function DelUnits2($vid,$unit){
|
||||
$q = "UPDATE ".TB_PREFIX."units SET `u$unit` = '0' WHERE `vref` = $vid;";
|
||||
mysqli_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
}
|
||||
|
||||
function DelPlayer($uid,$pass){
|
||||
@@ -206,12 +206,12 @@ class adm_DB {
|
||||
$this->DelVillage($villages[$i]['wref'], 1);
|
||||
}
|
||||
$q = "DELETE FROM ".TB_PREFIX."hero where uid = $uid";
|
||||
mysqli_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
|
||||
$name = $database->getUserField($uid,"username",0);
|
||||
mysqli_query("Insert into ".TB_PREFIX."admin_log values (0,$ID,'Deleted user <a>$name</a>',".time().")");
|
||||
mysqli_query($this->connection,"Insert into ".TB_PREFIX."admin_log values (0,$ID,'Deleted user <a>$name</a>',".time().")");
|
||||
$q = "DELETE FROM ".TB_PREFIX."users WHERE `id` = $uid;";
|
||||
mysqli_query($q, $this->connection);
|
||||
mysqli_query($this->connection,$q);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
#################################################################################
|
||||
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
|
||||
## --------------------------------------------------------------------------- ##
|
||||
@@ -10,7 +10,7 @@
|
||||
#################################################################################
|
||||
|
||||
|
||||
$txt="";
|
||||
$txt="Asd";
|
||||
|
||||
//bbcode = html code
|
||||
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
|
||||
|
||||
+10
-13
@@ -11,16 +11,14 @@
|
||||
|
||||
include_once("GameEngine/Account.php");
|
||||
$max_per_pass = 1000;
|
||||
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysql_select_db(SQL_DB);
|
||||
if (mysql_num_rows(mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
|
||||
if (mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
|
||||
|
||||
if(isset($_GET['del'])){
|
||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||
$result=mysql_query($query) or die (mysql_error());
|
||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '0' WHERE id = '".$row[0]."'")
|
||||
or die(mysql_error());
|
||||
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '0' WHERE id = '".$row[0]."'")
|
||||
or die(mysqli_error());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +45,10 @@ if (@isset($_POST['confirm']))
|
||||
fwrite($fh, $text);
|
||||
|
||||
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
|
||||
$result=mysql_query($query) or die (mysql_error());
|
||||
for ($i=0; $row=mysql_fetch_row($result); $i++) {
|
||||
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||
or die(mysql_error());
|
||||
$result=mysqli_query($GLOBALS['link'],$query) or die (mysqli_error());
|
||||
for ($i=0; $row=mysqli_fetch_row($result); $i++) {
|
||||
$updateattquery = mysqli_query($GLOBALS['link'],"UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
|
||||
or die(mysqli_error());
|
||||
}
|
||||
$done = true;
|
||||
} else { die("<br/><br/><br/>wrong"); }
|
||||
@@ -184,5 +182,4 @@ System Message was sent
|
||||
<?php include("Templates/footer.tpl"); ?>
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
<?php mysql_close(); ?>
|
||||
</html>
|
||||
@@ -168,7 +168,7 @@ function fd(url,gd,hd,id){
|
||||
switch(kd){
|
||||
case'application/json':
|
||||
if (jd.responseText.indexOf('[]') < 0) {
|
||||
gd((jd.responseText==''?null:eval('('+jd.responseText+')')));
|
||||
gd(jd.responseText==''?null:eval('('+jd.responseText+')'));
|
||||
}
|
||||
break;
|
||||
case'text/plain':case'text/html':gd(jd.responseText);break;
|
||||
|
||||
Reference in New Issue
Block a user