mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-01 19:59:22 +02:00
Guilds: You can not invite a player to your guild if he is already in a guild. Fix #136
This commit is contained in:
parent
d3807bfafe
commit
d7adcd1990
44
guilds.php
44
guilds.php
@ -369,22 +369,36 @@ if ($highest_access >= 2) {
|
|||||||
}
|
}
|
||||||
if (!empty($_POST['invite'])) {
|
if (!empty($_POST['invite'])) {
|
||||||
if (user_character_exist($_POST['invite'])) {
|
if (user_character_exist($_POST['invite'])) {
|
||||||
//
|
// Make sure they are not in another guild
|
||||||
$status = false;
|
|
||||||
if ($inv_data !== false) {
|
|
||||||
foreach ($inv_data as $inv) {
|
|
||||||
if ($inv['player_id'] == user_character_id($_POST['invite'])) $status = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach ($players as $player) {
|
|
||||||
if ($player['name'] == $_POST['invite']) $status = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($status == false) {
|
if ($config['TFSVersion'] != 'TFS_10') {
|
||||||
guild_invite_player(user_character_id($_POST['invite']), $gid);
|
$charname = sanitize($_POST['invite']);
|
||||||
header('Location: guilds.php?name='. $_GET['name']);
|
$playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
|
||||||
exit();
|
$charid = $playerdata['id'];
|
||||||
} else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
|
$membership = ($playerdata['rank_id'] > 0) ? true : false;
|
||||||
|
} else {
|
||||||
|
$charid = user_character_id($_POST['invite']);
|
||||||
|
$membership = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$charid' LIMIT 1;");
|
||||||
|
}
|
||||||
|
if (!$membership) {
|
||||||
|
//
|
||||||
|
$status = false;
|
||||||
|
if ($inv_data !== false) {
|
||||||
|
foreach ($inv_data as $inv) {
|
||||||
|
if ($inv['player_id'] == user_character_id($_POST['invite'])) $status = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($players as $player) {
|
||||||
|
if ($player['name'] == $_POST['invite']) $status = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($status == false) {
|
||||||
|
guild_invite_player($charid, $gid);
|
||||||
|
header('Location: guilds.php?name='. $_GET['name']);
|
||||||
|
exit();
|
||||||
|
} else echo '<font color="red" size="4">That character is already invited(or a member) on this guild.</font>';
|
||||||
|
} else echo '<font color="red" size="4">That character is already in a guild.</font>';
|
||||||
|
|
||||||
} else echo '<font color="red" size="4">That character name does not exist.</font>';
|
} else echo '<font color="red" size="4">That character name does not exist.</font>';
|
||||||
}
|
}
|
||||||
// Guild Message (motd)
|
// Guild Message (motd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user