From 2a787b1f36b4249f5a0720be94b268f66a74513f Mon Sep 17 00:00:00 2001 From: hecht Date: Tue, 26 Aug 2014 19:21:55 +0000 Subject: [PATCH] Zuweisung Chars zu Clanraeume verbessert! --- ag/clan/c_ware.php | 61 ++++++++++++++++++++++++----------------- ag/include/char.inc.php | 2 +- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/ag/clan/c_ware.php b/ag/clan/c_ware.php index 0ec25bf..6e8f17d 100644 --- a/ag/clan/c_ware.php +++ b/ag/clan/c_ware.php @@ -10,6 +10,7 @@ include_once(ROOT_PATH.'/include/config.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php'); include_once (ROOT_PATH . '/include/parse.inc.php'); +include_once (ROOT_PATH . '/include/sqlwrapper.inc.php'); // GET-Section // Kritisch (SQL-Injections) $char_id = validateUnsignedInteger($_GET['char_id'], null); @@ -18,13 +19,13 @@ $c_ware = validateUnsignedInteger($_GET['c_ware'], null); //Unkritisch $charm = $_GET['charm']; -if(!$char_id) { - include(ROOT_PATH.'/char_index.php'); - exit; -} +if($charm == 1) { + $chars = getCharsOfUser($user_ida['id']); -if($charm) { - mysql_query("UPDATE chars SET clan_train='$c_ware' WHERE id='$char_id' AND besitzer='$user_ida[id]' LIMIT 1"); + foreach($chars as $char) { + $c_ware = validateUnsignedInteger($_GET['c_ware_'.$char['id']], null); + db_query('UPDATE chars SET clan_train='.$c_ware.' WHERE id='.$char['id'].' AND besitzer='.$user_ida[id]); + } } $char = getChar($char_id, false); @@ -43,7 +44,6 @@ if(!isUserOwnerOf($user_ida['id'], $char_id)){
- @@ -51,25 +51,36 @@ if(!isUserOwnerOf($user_ida['id'], $char_id)){ - - - + + + + - - - diff --git a/ag/include/char.inc.php b/ag/include/char.inc.php index fc91cbb..5a87398 100644 --- a/ag/include/char.inc.php +++ b/ag/include/char.inc.php @@ -203,7 +203,7 @@ function getCharsOfUser($userid, $buffer_enabled = true) { $GLOBALS['chars_read_out_user'][$userid] = array(); $qry = mysql_query('Select id from chars where besitzer = '.$userid.' order by id'); while($char = mysql_fetch_assoc($qry)){ - $GLOBALS['chars_read_out_user'][$userid][] = &getChar($char['id']); + $GLOBALS['chars_read_out_user'][$userid][] = &getChar($char['id'], $buffer_enabled); } } return $GLOBALS['chars_read_out_user'][$userid]; // Gebe das globale Userfeld zurück.

Clan Items

- Raum für -
+ Raum für + + +