|
|
@ -609,7 +609,7 @@ function leaveChallenge($clan_challenge_id, array $user, $charid) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($char['besitzer'] != $user['id']) {
|
|
|
|
if($char['besitzer'] != $user['id']) {
|
|
|
|
if(!isAuthorizedClanfightCoordinator($clan_id, $user['id'], $clan_challenge_id)) {
|
|
|
|
if(!isAuthorizedClanfightCoordinator($clan['id'], $user['id'], $clan_challenge_id)) {
|
|
|
|
// authorized coordinators may remove a char!! But this one is not authorized
|
|
|
|
// authorized coordinators may remove a char!! But this one is not authorized
|
|
|
|
return 'Du kannst den Char nicht vom Kampf zurückziehen, da er dir nicht gehört!';
|
|
|
|
return 'Du kannst den Char nicht vom Kampf zurückziehen, da er dir nicht gehört!';
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -627,6 +627,31 @@ function leaveChallenge($clan_challenge_id, array $user, $charid) {
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function cancelChallenge($clan_challenge_id, array $user) {
|
|
|
|
|
|
|
|
$clan = getClan($user['clan']);
|
|
|
|
|
|
|
|
if(!$clan) {
|
|
|
|
|
|
|
|
return 'Du bist in keinem Clan!!';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$clans = getParticipatingClanIDs($clan_challenge_id);
|
|
|
|
|
|
|
|
if(!in_array($clan['id'], $clans)) {
|
|
|
|
|
|
|
|
return 'Dein Clan nimmt überhaupt nicht an diesem Clan-Fight teil!';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!isAuthorizedClanfightCoordinator($clan['id'], $user['id'], $clan_challenge_id)) {
|
|
|
|
|
|
|
|
return 'Du hast nicht die Rechte diesen Clan-Fight zurück zu ziehen!';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// kay, finish him !!!
|
|
|
|
|
|
|
|
$sql = 'DELETE FROM clan_challenges WHERE clan_challenge_id = ' .$clan_challenge_id . ' AND calculated = FALSE';
|
|
|
|
|
|
|
|
// echo $sql . '<br>';
|
|
|
|
|
|
|
|
$res = mysql_query($sql);
|
|
|
|
|
|
|
|
if(!$res)
|
|
|
|
|
|
|
|
return 'Beim zurückziehen des Clan-Fights ist ein technischer Fehler aufgetreten!';
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* This function does the calculation of the clan fight.
|
|
|
|
* This function does the calculation of the clan fight.
|
|
|
|
* @param int $clan_challenge_id the id of the challenge
|
|
|
|
* @param int $clan_challenge_id the id of the challenge
|
|
|
|