/** * @param string $username * @param string $paswd * @param string $email * @param string $ip * @param bool $allow_get_existing * @return bool */ public static function game_account_create($username, $paswd, $email = "*****@*****.**", $ip = "127.0.0.1", $allow_get_existing = true) { if (! empty($username) && ! empty($paswd) && ! empty($email) && ! empty($ip)) { // Make little $username = mb_strtolower($username); $email = mb_strtolower($email); // Generate WoW-Password $pass_sha = self::sha_password($username, $paswd); // Check is Username Already exist in wow account Database? if(auth_account::exists($username, false) && $allow_get_existing) { // Check if the use typed the same data like the existing account $wow_acc_info = auth_account::getByName($username); if($wow_acc_info[0]["sha_pass_hash"] == $pass_sha && mb_strtolower($wow_acc_info[0]["email"]) == $email) { // Disable WoW-Account until Forums-Account is activated auth_account::update_activated($wow_acc_info[0]["id"], $ip, 1); // return true for successfully "creation" return true; } // Failed verification return "Die von dir eingegebenen Daten (Passwort & E-Mailadresse) stimmen nicht mit dem bereits existierenden WoW-User " . $username . " überein!<br />" . "WICHTIGE INFO: WoW-Accounts ignorieren die Groß/Kleinschreibung!<br />" . "Bitte gebe die korrekten Daten an, um deinen alten WoW-Account zu erhalten oder nutze einen nicht vergebenen Usernamen, wenn du einen neuen erstellen möchtest!<hr />" . "(WoW-Account exists, if its yours, type in the correct E-Mail and Password of your old Acc! If its not yours please choose another Name.)"; } elseif(auth_account::exists($username, false)) return "Der Account existiert bereits!"; // Get recruiter-field $recruiter = self::check_refferer($username); auth_account::add($username, $pass_sha, $email, gmdate("Y-m-d H:i:s", time()), $ip, 1, 3, 3, $recruiter); if(auth_account::exists($username, false) !== false) return true; // Success! return "Account konnte nicht erstellt werden... Unbekannter Fehler! (Can't create WoW-Account - Unknown Error...)"; } return "Angaben fehlen, bitte fülle alles erforderliche aus! (Please fill all out whats needed!)"; }
/** * @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); }