Beispiel #1
0
<?php

include "modules/tournament2/class_team.php";
$tteam = new team();
$tournamentid = $_GET["tournamentid"];
$tournament = $db->qry_first("SELECT name, teamplayer, over18, status, groupid, coins, wwcl_gameid, ngl_gamename, lgz_gamename, maxteams FROM %prefix%tournament_tournaments WHERE tournamentid = %int%", $tournamentid);
if ($auth["userid"] == "") {
    $auth["userid"] = 0;
}
$user = $db->qry_first("SELECT wwclid, wwclclanid, nglid, nglclanid, lgzid, lgzclanid FROM %prefix%user WHERE userid = %int%", $auth["userid"]);
if ($tteam->SignonCheck($tournamentid)) {
    switch ($_GET["step"]) {
        case 3:
            if (!$sec->locked("t_join")) {
                $error = array();
                // If joining an existing team
                if ($_POST['existing_team_name'] != "" and $tournament['teamplayer'] > 1) {
                    $success = $tteam->join($_POST["existing_team_name"], $auth["userid"], $_POST["password"]);
                    // If creating a new team
                } else {
                    if ($tournament['teamplayer'] == 1) {
                        $_POST['team_name'] = "";
                    }
                    if ($_POST["set_password"] and $_POST["set_password"] != $_POST["set_password2"]) {
                        $error["set_password2"] = t('Die Passworteingaben stimmen nicht überein');
                    }
                    if ($_POST['team_name'] == "" and $tournament['teamplayer'] > 1) {
                        $error["team_name"] = t('Bitte gib einen Teamnamen ein, oder wähle ein vorhandenes Team aus');
                    }
                    if (count($error) == 0) {
                        $success = $tteam->create($_GET["tournamentid"], $auth["userid"], $_POST['team_name'], $_POST["set_password"], $_POST['team_comment'], "team_banner");