/**
 * @return string
 */
function getfunctionOutput() {
	if(get_phpbb_info::$instance->user_id && mb_strtolower(get_phpbb_info::$instance->username) != 'anonymous') { //todo check server before doing this implement
		// Escape Userdata
		$_GET = output::escapeALL($_GET);
		$_POST = output::escapeALL($_POST);
		$_COOKIE = output::escapeALL($_COOKIE);
		$_SERVER = output::escapeALL($_SERVER);

		//Set URL
		$roa_url = "?mod=" . MOD;

		switch(MOD) {
			case 'control':
				//todo
			case 'wow_account_info':
				// Include Mainfunctions
				require_once(ROA_MAINCLASSDIR . DS . 'class.account.php');
				// Include Lib
				require_once(LIB_DIR . DS . 'class.auth_account.php');

				return output::HTMLTemplate("World of Warcraft-Account Status", output::accountInfo());
			case 'points_history':
				// Include LIB
				require_once(LIB_DIR . DS . 'class.user_points.php');
				require_once(LIB_DIR . DS . 'class.point_costs.php');

				return output::HTMLTemplate("Punkte Log", output::point_management());
			case 'points_management':
				// Include LIB
				require_once(LIB_DIR . DS . 'class.auth_account.php');
				require_once(LIB_DIR . DS . 'class.user_points.php');
				require_once(LIB_DIR . DS . 'class.point_costs.php');
				require_once(LIB_DIR . DS . 'class.code_functions.php');
				require_once(LIB_DIR . DS . 'class.points_exchange.php');

				return output::HTMLTemplate("Punkte verwalten", output::exchange_points());
		}
	}

	// No-Login req
	switch(MOD) {
		case 'impressum':
			return output::HTMLTemplate("Impressum", output::implementImpressum());
		default:
			// Default Value
			return output::HTMLTemplate("Info", "Unbekannter Modus oder logge dich ein!");
	}
}
	/**
	 * @param int $id
	 * @return array
	 */
	private static function updateFaction($id) {
		if(! isset($_POST['char_guid']))
			$_POST['char_guid'] = "";

		$char_guid = output::escapeALL($_POST['char_guid'], true);
		$error = false;

		if($char_guid) {
			$char = char_character::get($char_guid);
			$own_wow_acc = auth_account::getByName(get_phpbb_info::$instance->username);

			// Check input and data
			if($char === false)
				$error = "Der Charakter existiert nicht!";
			else if($char["account"] != $own_wow_acc[0]["id"])
				$error = "Der Charakter gehört dir nicht!";
			else {
				// Change Faction
				if(! char_character::updateFlag($char_guid, 64))
					$error = "Ein unbekannter Fehler ist beim ändern der Fraktion aufgetreten...";
			}
			unset($char);
			unset($own_wow_acc);
		}

		if(! $char_guid || $error) {
			$product = point_costs::get($id);
			user_points::update(get_phpbb_info::$instance->user_id, $product["name"] . " - Angaben fehlten -> Rückgabe der Punkte", $product["points"]);
			return array("result" => "other", "code" => output::getChar($id, $_POST['char_guid'], $error));
		}
		return array("result" => true);
	}