|
|
@ -52,7 +52,7 @@ function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGH
|
|
|
|
return 'Entweder bist du nicht in einem Clan oder der andere Clan existiert nicht mehr!!';
|
|
|
|
return 'Entweder bist du nicht in einem Clan oder der andere Clan existiert nicht mehr!!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(isAuthorizedClanfightCoordinator($user['id'])){
|
|
|
|
if(!isAuthorizedClanfightCoordinator($user['clan'], $user['id'])){
|
|
|
|
return 'Nur der Leader, Co-Leader oder freigeschaltete Mitglieder können andere Clans herausfordern!!';
|
|
|
|
return 'Nur der Leader, Co-Leader oder freigeschaltete Mitglieder können andere Clans herausfordern!!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -160,7 +160,7 @@ function acceptChallengeRequest($challenged_clan, array $user) {
|
|
|
|
return 'Du bist in keinem Clan!!';
|
|
|
|
return 'Du bist in keinem Clan!!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(isAuthorizedClanfightCoordinator($user['id'])){
|
|
|
|
if(!isAuthorizedClanfightCoordinator($user['clan'], $user['id'])){
|
|
|
|
return 'Nur der Leader, Co-Leader oder freigeschaltete Mitglieder können Herausforderungen anderer Clans annehmen!!';
|
|
|
|
return 'Nur der Leader, Co-Leader oder freigeschaltete Mitglieder können Herausforderungen anderer Clans annehmen!!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -242,7 +242,7 @@ function denyChallengeRequest($challenged_clan, array $user) {
|
|
|
|
return 'Du bist in keinem Clan!!';
|
|
|
|
return 'Du bist in keinem Clan!!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(isAuthorizedClanfightCoordinator($user['id'])){
|
|
|
|
if(!isAuthorizedClanfightCoordinator($user['clan'], $user['id'])){
|
|
|
|
return 'Nur der Leader, Co-Leader oder freigeschaltete Mitglieder können Herausforderungen anderer Clans ablehnen!!';
|
|
|
|
return 'Nur der Leader, Co-Leader oder freigeschaltete Mitglieder können Herausforderungen anderer Clans ablehnen!!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -735,13 +735,14 @@ function getClanFightCapableClanIds() {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function isAuthorizedClanfightCoordinator($clan_id, $user_id, $clan_fight_id = NULL) {
|
|
|
|
function isAuthorizedClanfightCoordinator($clan_id, $user_id, $clan_fight_id = NULL) {
|
|
|
|
// do we require this information for a specific clan_fight???
|
|
|
|
// do we require this information for a specific clan_fight???
|
|
|
|
if($clan_fight_id === NULL) {
|
|
|
|
if($clan_fight_id !== NULL) {
|
|
|
|
$sql = 'SELECT COUNT(*) FROM `clan_challenge_clans` WHERE `clan_coordinator` = ' .$user_id. ' AND `clan_id` = '.$clan_id . ' AND `clan_challenge_id` = ' .$clan_fight_id;
|
|
|
|
$sql = 'SELECT COUNT(*) FROM `clan_challenge_clans` WHERE `clan_coordinator` = ' .$user_id. ' AND `clan_id` = '.$clan_id . ' AND `clan_challenge_id` = ' .$clan_fight_id;
|
|
|
|
|
|
|
|
//echo $sql . '<br>';
|
|
|
|
$row = mysql_fetch_row(mysql_query($sql));
|
|
|
|
$row = mysql_fetch_row(mysql_query($sql));
|
|
|
|
if($row[0] <= 0) {
|
|
|
|
if($row[0] <= 0) {
|
|
|
|
// okay, maybe its a leader ;)
|
|
|
|
// okay, maybe its a leader ;)
|
|
|
|
$clan = getClan($clan_id);
|
|
|
|
$clan = getClan($clan_id);
|
|
|
|
if($clan['leader'] == $user_id || $clan['co_leader'] = $user_id) {
|
|
|
|
if($clan['leader'] == $user_id || $clan['co_leader'] == $user_id) {
|
|
|
|
// the leader or the co_leader is always authorized!
|
|
|
|
// the leader or the co_leader is always authorized!
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -755,6 +756,17 @@ function isAuthorizedClanfightCoordinator($clan_id, $user_id, $clan_fight_id = N
|
|
|
|
// it is a more general thing ;)
|
|
|
|
// it is a more general thing ;)
|
|
|
|
$sql = 'SELECT COUNT(*) FROM `clan_challenge_whitelist` WHERE `user_id` = ' .$user_id. ' AND `clan_id` = '.$clan_id;
|
|
|
|
$sql = 'SELECT COUNT(*) FROM `clan_challenge_whitelist` WHERE `user_id` = ' .$user_id. ' AND `clan_id` = '.$clan_id;
|
|
|
|
$row = mysql_fetch_row(mysql_query($sql));
|
|
|
|
$row = mysql_fetch_row(mysql_query($sql));
|
|
|
|
|
|
|
|
if($row[0] <= 0) {
|
|
|
|
|
|
|
|
// okay, maybe its a leader ;)
|
|
|
|
|
|
|
|
$clan = getClan($clan_id);
|
|
|
|
|
|
|
|
if($clan['leader'] == $user_id || $clan['co_leader'] == $user_id) {
|
|
|
|
|
|
|
|
// the leader or the co_leader is always authorized!
|
|
|
|
|
|
|
|
//echo 'true<br>';
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// not authorized!
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|