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)){