Ejemplo n.º 1
0
	/**
	 * @param string $tablename
	 */
	public static function setTablename($tablename) {
		self::$tablename = $tablename;
	}
Ejemplo n.º 2
0
	/**
	 * @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);
	}