diff --git a/ag/auktion.php b/ag/auktion.php
index d82db61..142d39a 100644
--- a/ag/auktion.php
+++ b/ag/auktion.php
@@ -395,4 +395,5 @@ if(isset($user_ida[id])){
stelleAuktionsuebersichtDar($user_ida['id'],$kategorie,$itemname,$entries,$page,$maxpreis,$order,$dir);
}
}
+
?>
diff --git a/ag/clan/clan_info.php b/ag/clan/clan_info.php
index ba11509..7898be5 100644
--- a/ag/clan/clan_info.php
+++ b/ag/clan/clan_info.php
@@ -373,7 +373,6 @@ function sendClanNewsletter($user, $text){
}
function setProfile($what, $value1, $value2, $clanid, $rootlvl){
- echo 'setProfile
';
if($rootlvl < 1) {
return 'Du hast keine Rechte um diese Aktion auszuführen!';
}
@@ -391,7 +390,6 @@ function setProfile($what, $value1, $value2, $clanid, $rootlvl){
mysql_query('UPDATE clan SET Info = \''.$value1.'\' where id = '.$clanid);
return NULL;
case 'Leadership':
- echo 'setLeadership!
';
$clan = getClan($clanid);
if($value1 == 0 && $rootlvl == 2){$value1 = 'null';}
@@ -411,7 +409,7 @@ function setProfile($what, $value1, $value2, $clanid, $rootlvl){
if($rootlvl == 1){ // the co leader may only set the co leader XD
$sql = 'UPDATE clan SET co_leader = '.$value2.' where id = '.$clanid;
- echo $sql.'
';
+ //echo $sql.'
';
mysql_query($sql);
} else if($rootlvl == 2) { // the leader may set the leader and the co leader
$sql = 'UPDATE clan SET leader = '.$value1.', co_leader = '.$value2.' where id = '.$clanid;
@@ -540,7 +538,6 @@ if($action !== NULL) { // this is done to not require to reprogramm the whole st
$rootlvl = 1; // co_leader
}
- echo 'Rootlvl = ' . $rootlvl . '
';;
switch ($action) {
case 'edit':
$errorMsg = NULL;
diff --git a/ag/include/auktion_functions.inc.php b/ag/include/auktion_functions.inc.php
index 94c1301..253b3db 100644
--- a/ag/include/auktion_functions.inc.php
+++ b/ag/include/auktion_functions.inc.php
@@ -41,6 +41,17 @@ function aktuellesMindestgebot($auktionsid){
}
}
+function getUserAvailableMoney($userid) {
+ //Nun muss noch geprueft werden ob der User genug Geld hat und auch mit allen Geboten gesamt nicht in den Minusbereich kommt
+ $user_a = mysql_fetch_assoc(mysql_query('SELECT nickname, geld FROM user WHERE id = '.$userid));
+ $usermoney = $user_a['geld'];
+ $auktionensumme = mysql_fetch_assoc(mysql_query('SELECT SUM(aktuellesgebot) as summe FROM auktion WHERE bieter = '.$userid));
+ $auktionensumme = $auktionensumme['summe'];
+ return $usermoney - $auktionensumme;
+
+}
+
+
// Funktion zum bieten für eine Auktion
// Returns '' wenn alles ok, ansonsten eine Fehlerausgabe
// @Return String
diff --git a/ag/item.php b/ag/item.php
index b58aae1..9c034cb 100644
--- a/ag/item.php
+++ b/ag/item.php
@@ -11,6 +11,7 @@ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/fehlerausgabe.inc.php');
include_once ($_SERVER['DOCUMENT_ROOT'] . 'ag/include/char.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/parse.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/messagefunctions.inc.php');
+include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/auktion_functions.inc.php');
// GET-Section
// Kritisch (SQL-Injections)
@@ -218,7 +219,7 @@ if($charm == 3) {
$tausch_geld = round($tausch_geld);
if($tausch_geld <= ($arenalvl * 10000) && $tausch_geld > 0) {
- if($tausch_geld <= $user['geld']) {
+ if($tausch_geld <= getUserAvailableMoney($user['id'])) {
$qry = 'UPDATE user SET geld = geld - '.$tausch_geld.' WHERE id = '.$user['id'].';';
mysql_query($qry);
$qry = 'UPDATE user SET geld = geld + '.$tausch_geld.' WHERE id = '.$tausch_user_id.';';
diff --git a/ag/turnier.php b/ag/turnier.php
index 561fb40..ee46960 100644
--- a/ag/turnier.php
+++ b/ag/turnier.php
@@ -12,6 +12,7 @@ include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/fehlerausgabe.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/designfunctions.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/char.inc.php');
include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/halloffame.inc.php');
+include_once($_SERVER['DOCUMENT_ROOT'].'ag/include/auktion_functions.inc.php');
// GET-Section
// Kritisch (SQL-Injections)
@@ -36,7 +37,7 @@ function anmelden($user, $charid, $art){
$gebuehr = mysql_fetch_assoc(mysql_query('SELECT gebuehr FROM turnier_gebuehr WHERE art = \''.$art.'\';'));
$gebuehr = $gebuehr['gebuehr'];
- if($user['geld'] < $gebuehr) {
+ if(getUserAvailableMoney($user['id']) < $gebuehr) {
displayErrorMessage(NULL,'Nicht genug Geld um am Turnier teilzunehmen!','weiter...');
return;
}
@@ -198,4 +199,4 @@ if($charm == 1){
-?>
\ No newline at end of file
+?>