update: now player cannot delete link of another player

This commit is contained in:
unknown
2012-06-15 21:31:37 +03:00
parent 415bf988dd
commit 4946a51468
2 changed files with 17 additions and 21 deletions
+2 -6
View File
@@ -2907,13 +2907,11 @@
function getLinks($id){ function getLinks($id){
$q = 'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $id . ' ORDER BY `pos` ASC'; $q = 'SELECT * FROM `' . TB_PREFIX . 'links` WHERE `userid` = ' . $id . ' ORDER BY `pos` ASC';
return mysql_query($q, $this->connection); return mysql_query($q, $this->connection);
} }
function removeLinks($id){ function removeLinks($id,$uid){
$q = "DELETE FROM " . TB_PREFIX . "links WHERE `id` = ".$id.""; $q = "DELETE FROM " . TB_PREFIX . "links WHERE `id` = ".$id." and `userid` = ".$uid."";
return mysql_query($q, $this->connection); return mysql_query($q, $this->connection);
} }
function getVilFarmlist($wref){ function getVilFarmlist($wref){
@@ -2940,13 +2938,11 @@
return mysql_query($q, $this->connection); return mysql_query($q, $this->connection);
} }
function delSlotFarm($id) { function delSlotFarm($id) {
$q = "DELETE FROM " . TB_PREFIX . "raidlist where id = $id"; $q = "DELETE FROM " . TB_PREFIX . "raidlist where id = $id";
return mysql_query($q, $this->connection); return mysql_query($q, $this->connection);
} }
function createFarmList($wref, $owner, $name) { function createFarmList($wref, $owner, $name) {
$q = "INSERT INTO " . TB_PREFIX . "farmlist (`wref`, `owner`, `name`) VALUES ('$wref', '$owner', '$name')"; $q = "INSERT INTO " . TB_PREFIX . "farmlist (`wref`, `owner`, `name`) VALUES ('$wref', '$owner', '$name')";
return mysql_query($q, $this->connection); return mysql_query($q, $this->connection);
+1 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
if(isset($_GET['del'])){ if(isset($_GET['del'])){
$database->removeLinks($_GET['del']); $database->removeLinks($_GET['del'],$session->uid);
header("Location: spieler.php?s=2"); header("Location: spieler.php?s=2");
} }
################################################################################# #################################################################################